2.3 KiB
2.3 KiB
GitLab CI/CD for call-center
What this setup does
- a push to
maintriggers GitLab CI - the job runs on a dedicated
shellrunner with tagcall-center-prod - the runner syncs the repository into
/home/gitlab-runner/deploy/call-center - Docker builds
call-center-app:<commit-sha>and also tagscall-center-app:latest docker composerecreates the stack fromdeployment/docker-compose.server.yml- the public gateway container is named
call-center-app
Required server prerequisites
- Docker installed and running
- outbound access to
https://gitlab.konturai.kz - runner token from GitLab with prefix
glrt-...or a valid project/group runner token
Install and register the runner
Run on the target server as root:
cd /path/to/call-center
RUNNER_TOKEN=glrt-xxxxxxxx bash scripts/install_gitlab_runner.sh
The script:
- installs
gitlab-runnerfrom the official GitLab repository - adds user
gitlab-runnerto thedockergroup - creates deploy directory
/home/gitlab-runner/deploy/call-center - registers runner
call-center-prod-runnerwith tagcall-center-prod
If you first want to install the service without registration:
SKIP_REGISTER=1 bash scripts/install_gitlab_runner.sh
Production environment file
Create the production env file once on the server:
install -m 600 /dev/null /home/gitlab-runner/deploy/call-center/.env.production
Then fill it with the values required by deployment/docker-compose.server.yml.
If the project is already running from /root/call-center, migrate the current env file and SQLite/files before the first CI deploy:
bash scripts/bootstrap_gitlab_deploy.sh
Alternative:
- keep the env file elsewhere
- pass
DEPLOY_ENV_FILE=/absolute/path/to/.env.productionin GitLab CI/CD variables
GitLab CI/CD variables
Optional project variables:
DEPLOY_DIRif you want a different deploy directoryAPP_IMAGE_NAMEif you want a different Docker image nameHEALTHCHECK_URLif the gateway health URL differsDEPLOY_ENV_FILEif.env.productionshould be copied from another location
First deployment
- Register the runner.
- Add the production env file.
- Push this configuration to the
mainbranch. - Confirm the pipeline completes successfully.
- Verify the container:
docker ps --filter name=call-center-app