image: registry.gitlab.com/gitlab-org/gitaly/build-golang-1.8-git-2.8.4:latest stages: - build_images - build_test - package - publish verify: stage: build_test script: - make verify .test_template: &test_definition stage: build_test script: - go version - git version - make test .build_template: &build_definition stage: build_test script: - make build:default: <<: *build_definition test:default: <<: *test_definition # If we want to build and test on other golang version in future.... # # build:go1.9: # <<: *build_definition # image: ... # # test:go1.9: # <<: *test_definition # image: ... cover: stage: build_test script: - make cover artifacts: paths: - _build/cover/all.html package: stage: package only: - tags script: - GOOS=linux GOARCH=amd64 make clean package - ls -l # Want to see permissions as they went into the .deb - dpkg -e *.deb - cat DEBIAN/control - cat DEBIAN/md5sums - rm -rf DEBIAN artifacts: paths: - ./*.deb publish: stage: publish only: - tags variables: GIT_STRATEGY: none script: - gem install package_cloud - ls -lh *.deb - shasum -a256 *.deb - package_cloud push $PACKAGECLOUD_REPO *.deb --url=https://packages.gitlab.com allow_failure: true # Create a code quality report codeclimate: image: docker:latest stage: build_test variables: DOCKER_DRIVER: overlay services: - docker:dind script: - docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze -f json > codeclimate.json artifacts: paths: [codeclimate.json] allow_failure: true build_images: variables: DOCKER_DRIVER: overlay stage: build_images only: - schedules image: docker:latest services: - docker:dind script: - cp ruby/Gemfile ruby/Gemfile.lock _support/build-images/golang-1.8-git-2.8.4/ - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com - docker build -t registry.gitlab.com/gitlab-org/gitaly/build-golang-1.8-git-2.8.4:latest _support/build-images/golang-1.8-git-2.8.4/ - docker push registry.gitlab.com/gitlab-org/gitaly/build-golang-1.8-git-2.8.4:latest