image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.5-golang-1.11-git-2.18 stages: - build - test - publish variables: DOCKER_DRIVER: overlay CUSTOM_IMAGE_VERSION: ruby-2.5-golang-1.11-git-2.18 danger-review: image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger stage: build only: - branches@gitlab-org/gitaly except: - tags - master script: - git version - danger .ruby_template: &ruby_definition cache: key: gems-ruby-2.5 paths: - ruby/vendor/bundle .build_template: &build_definition <<: *ruby_definition stage: build script: - make - _support/test-boot-time . .assemble_template: &assemble_definition <<: *ruby_definition stage: build only: - tags script: # Just in case we start running CI builds on other architectures in future - go version - make binaries artifacts: paths: - _build/assembly/checksums.sha256.txt - _build/assembly/bin/ name: "$CI_JOB_NAME" expire_in: 6 months .go_test_template: &go_test_definition <<: *ruby_definition stage: test # Override the ruby_definition cache definition for pull cache: key: gems-ruby-2.5 paths: - ruby/vendor/bundle policy: pull artifacts: paths: - ruby/tmp/gitaly-rspec-test.log when: on_failure expire_in: 1 week .test_template: &test_definition <<: *go_test_definition script: - go version - git version - make test verify: <<: *ruby_definition stage: test script: - make verify build:go1.12: <<: *build_definition image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.5-golang-1.12-git-2.18 build:go1.11: <<: *build_definition image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.5-golang-1.11-git-2.18 build:go1.10: <<: *build_definition image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.5-golang-1.10-git-2.18 binaries_go1.12: <<: *assemble_definition image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.5-golang-1.12-git-2.18 binaries_go1.11: <<: *assemble_definition image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.5-golang-1.11-git-2.18 binaries_go1.10: <<: *assemble_definition image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.5-golang-1.10-git-2.18 test:go1.12-git-2.18-ruby-2.5: image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.5-golang-1.12-git-2.18 <<: *test_definition test:go1.11-git-2.18-ruby-2.5: image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.5-golang-1.11-git-2.18 <<: *test_definition test:go1.10-git2.18-ruby-2.5: <<: *test_definition image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.5-golang-1.10-git-2.18 test:go1.10-git2.18-ruby-2.4: <<: *test_definition image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.4-golang-1.10-git-2.18 test:proxy: <<: *test_definition image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.5-golang-1.10-git-2.18 script: - make test-with-proxies race: <<: *go_test_definition script: - go version - git version - make race-go cover: <<: *ruby_definition stage: test script: - make cover code_quality: image: docker:stable variables: DOCKER_DRIVER: overlay2 allow_failure: true services: - docker:stable-dind script: - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - docker run --env SOURCE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code artifacts: paths: [gl-code-quality-report.json] .build_image: &build_image stage: publish image: docker:latest services: - docker:dind docker: <<: *build_image script: - mkdir -p _support/build-images/$CI_JOB_NAME/ - cp ruby/Gemfile ruby/Gemfile.lock _support/build-images/$CI_JOB_NAME/ - cp _support/build-images/versioned/Dockerfile _support/build-images/$CI_JOB_NAME/ - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE/gitaly:latest --build-arg CUSTOM_IMAGE_VERSION=$CUSTOM_IMAGE_VERSION _support/build-images/$CI_JOB_NAME - docker push $CI_REGISTRY_IMAGE/gitaly:latest only: - master docker-tag: <<: *build_image script: - mkdir -p _support/build-images/$CI_JOB_NAME/ - cp ruby/Gemfile ruby/Gemfile.lock _support/build-images/$CI_JOB_NAME/ - cp _support/build-images/versioned/Dockerfile _support/build-images/$CI_JOB_NAME/ - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE/gitaly:$CI_COMMIT_TAG --build-arg CUSTOM_IMAGE_VERSION=$CUSTOM_IMAGE_VERSION _support/build-images/$CI_JOB_NAME - docker push $CI_REGISTRY_IMAGE/gitaly:$CI_COMMIT_TAG only: - tags@gitlab-org/gitaly # Create a MR in GitLab-CE when releasing a Gitaly version update-downstream-server-version: stage: publish only: - tags@gitlab-org/gitaly script: - ruby _support/update-downstream-server-version allow_failure: true