/Gitlab

This repo contains docker-compose file which can start Gitlab and Gitlab runner

Primary LanguageRuby

  1. Run docker-compose file docker-compose -f docker-compose.yml up
  2. Wait until gitlab starts on http:\\localhost:8929
  3. Login in: Login: root, Password: My5uper5ecretPa55w0rd!
  4. Choose project, go to Settings -> CI/CD. Click "Expand" on the Runners, and copy the registration token field
  5. Go to docker container docker exec -it gitlab_runner_1 bash
  6. 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
    
  7. Push the repo
  8. Here will be default pipeline, which will always fail. You can create your own pipeline like that:
    1. Create file .gitlab-ci.yml
    2. Edit it:
    image: maven:latest
    build:
        stage: build
        script:
            - mvn package