- Run docker-compose file
docker-compose -f docker-compose.yml up
- Wait until gitlab starts on
http:\\localhost:8929
- Login in:
Login: root, Password: My5uper5ecretPa55w0rd!
- Choose project, go to Settings -> CI/CD. Click "Expand" on the Runners, and copy the registration token field
- Go to docker container
docker exec -it gitlab_runner_1 bash
- Run these commands:
export REGISTRATION_TOKEN=<your_registration_token> gitlab-runner register \ --non-interactive \ --url http://server:8929 \ --registration-token $REGISTRATION_TOKEN \ --executor docker \ --docker-image maven:latest \ --docker-network-mode gitlab_net
- Push the repo
- Here will be default pipeline, which will always fail. You can create your own pipeline like that:
- Create file .gitlab-ci.yml
- Edit it:
image: maven:latest build: stage: build script: - mvn package