variables: image_name: ocp_tezos image_id: ${CI_BUILD_REF_NAME} build_image_name: ${image_name}_build_deps build_image_id: ${CI_BUILD_REF} private_registry: registry.ocamlpro.com:8443 private_image_id: $private_registry/${CI_PROJECT_PATH} public_image_id: docker.io/tezosledger/tezos:latest image: ${build_image_name}:${build_image_id} stages: - build_deps - build - build_test - test - expurge - publish - cleanup build_deps: stage: build_deps image: ocp:docker tags: - docker_builder script: - ./scripts/create_build_deps_docker_image.sh ${build_image_name} ${build_image_id} build: stage: build tags: - tezos_builder script: - echo "PRODUCTION=yes" > src/Makefile.local - make -j4 artifacts: expire_in: 1 week untracked: true build:test: stage: build_test tags: - tezos_builder script: - make -C test build-test -j4 dependencies: - build artifacts: expire_in: 1 week untracked: true test:store: stage: test tags: - tezos_builder script: - make -C test run-test-store dependencies: - build - build:test test:context: stage: test tags: - tezos_builder script: - make -C test run-test-context dependencies: - build - build:test test:state: stage: test tags: - tezos_builder script: - make -C test run-test-state dependencies: - build - build:test test:basic: stage: test tags: - tezos_builder script: - make -C test run-test-basic dependencies: - build - build:test test:basic.sh: stage: test tags: - tezos_builder script: - make -C test run-test-basic.sh dependencies: - build - build:test test:data-encoding: stage: test tags: - tezos_builder script: - make -C test run-test-data-encoding dependencies: - build - build:test test:p2p-io-scheduler: stage: test tags: - tezos_builder script: - make -C test run-test-p2p-io-scheduler dependencies: - build - build:test test:p2p-connection: stage: test tags: - tezos_builder script: - make -C test run-test-p2p-connection dependencies: - build - build:test test:p2p-connection-pool: stage: test tags: - tezos_builder script: - make -C test run-test-p2p-connection-pool dependencies: - build - build:test publish:docker: stage: publish image: ocp:docker tags: - public_docker_builder script: - ./scripts/create_docker_image.sh ${image_name} ${build_image_id} - docker tag ${image_name}:${build_image_id} "$private_image_id:$CI_BUILD_REF_NAME" - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $private_registry - docker push "$private_image_id:$CI_BUILD_REF_NAME" - docker rmi "$private_image_id:$CI_BUILD_REF_NAME" - if [ "$CI_PROJECT_PATH" = "tezos/tezos" -a "$CI_BUILD_REF_NAME" = "master" ]; then mkdir -p ~/.docker ; echo "$CI_DOCKER_AUTH" > ~/.docker/config.json ; docker tag ${image_name}:${build_image_id} ${public_image_id} ; docker push ${public_image_id} ; docker rmi ${public_image_id} ; fi publish:github: image: ocaml/opam stage: publish tags: - tezos_builder only: - master@tezos/tezos script: - echo "${CI_KH}" > ~/.ssh/known_hosts - echo "${CI_PK_GITHUB}" > ~/.ssh/id_rsa - chmod 400 ~/.ssh/id_rsa - rm -fr .git/refs/original - git filter-branch --prune-empty --index-filter 'git rm -r --cached --ignore-unmatch .gitlab-ci.yml "docs/proof of stake.md" src/client/embedded/bootstrap/mining/' --env-filter 'if [ $GIT_COMMIT != "f42e9d12ac75d2876a4cf600d44976b7090d4533" ] ; then export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" ; export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" ; export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" ; export GIT_AUTHOR_NAME="Dynamic Ledger Solutions, Inc." ; export GIT_AUTHOR_EMAIL="contact@tezos.com" ; fi' HEAD - git push git@github.com:tezos/tezos.git -f HEAD:master cleanup: stage: cleanup image: ocp:docker tags: - docker_builder script: - docker tag ${build_image_name}:${build_image_id} ${build_image_name}:${CI_PROJECT_NAMESPACE}_${CI_BUILD_REF_NAME} - docker rmi ${build_image_name}:${build_image_id} when: always allow_failure: true