# Build the Docker image
./build.sh
# Run the Docker image
docker run -it axgn/achievements
# Clone the repository
git clone [email protected]/AlexGustafsson/achievements
# Enter the repository and install the dependencies
cd achievements
npm install
# Start the project
npm start
# Run in production mode
npm start
# Run in development mode
npm run dev
The port can be controlled using the environment variable PORT
. To configure the server to verify GitLab webhooks, use the environment variable GITLAB_ENVIRONMENT
. The directory used for data storage can be configured using the DATA_DIRECTORY
environment variable.
The application should run behind a reverse proxy as it does not handle TLS, load balancing, rate limiting or other imortant techniques.
Currently configuration is done via environment variables. These can be found in the section above.
The API is currently undocumented. Please see the src/index.js
file for current routes.
The list of achievements is currently undocumented. Please see the src/achievements.json
file for current achievements. This file is merely the available achievements, not how achievements are implemented.
The application exposes GitLab's webhooks as hooks available within the hooks
directory. Each file corresponds to an event type available via GitLab's webhooks.
Each exported function in a hook file will be executed when an event is received from GitLab. Currently the documentation of the API is sparse, but there are some implementations from which one should be able to interpolate an implementation.
# Clone the repository
git clone [email protected]/AlexGustafsson/achievements
# Install dependencies
npm install
# Write code and commit it
# Follow the conventions enforced
npm run lint-javascript
npm run lint-shell
npm run lint-docker
npm run test
npm run coverage
npm run check-duplicate-code
# Run the project for manual testing
npm run dev
This project targets NodeJS 13.
The following dependencies need to be manually installed.
- ShellCheck
brew install shellcheck
apt install shellcheck
- hadolint
brew install hadolint