variables: opam_image: ${CI_REGISTRY_IMAGE}/opam build_deps_image: ${CI_REGISTRY_IMAGE}/build_deps public_docker_image: docker.io/${CI_PROJECT_PATH} stages: - precheck - prepare - build_deps - build - test - opam - publish - deploy - cleanup ## Check zeronet/alphanet precheck:constant: image: ${opam_image} stage: precheck only: - zeronet - alphanet script: - ./scripts/check_patch.sh "${CI_COMMIT_REF_NAME}" ## Template for `docker_in_docker` jobs .dind_template: &dind_definition image: docker:latest variables: DOCKER_DRIVER: overlay2 services: - docker:dind before_script: - docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}" - apk add --no-cache curl jq - . ./scripts/version.sh tags: - safe_docker prepare:opam: <<: *dind_definition stage: prepare only: variables: - $UPDATE_OPAM script: - ./scripts/ci/create_docker_image.opam.sh "${opam_image}" - docker push "${opam_image}:alpine-${alpine_version}_ocaml-${ocaml_version}" - docker tag "${opam_image}:alpine-${alpine_version}_ocaml-${ocaml_version}" "${opam_image}:latest" - docker push "${opam_image}:latest" ## Tezos build dependencies build_deps: <<: *dind_definition stage: build_deps script: ## Building dependencies... - ./scripts/ci/create_docker_image.build_deps.sh "${build_deps_image}" "${CI_COMMIT_SHA}" "${opam_image}:alpine-${alpine_version}_ocaml-${ocaml_version}" "yes" .build_deps_template: &build_deps_definition image: ${build_deps_image}:${CI_COMMIT_SHA} before_script: - opam list tags: - gitlab-org ## Tezos build: <<: *build_deps_definition stage: build except: - master - alphanet - zeronet script: - make all - make build-test artifacts: paths: - _build expire_in: 1 day ## Basic tests (run on merge requests) .test_template: &test_definition <<: *build_deps_definition stage: test except: - master - alphanet - zeronet dependencies: - build test:opam_packaging: <<: *test_definition script: - ./scripts/check_opam_test.sh "$CI_PROJECT_DIR/$CI_CONFIG_PATH" test:ocp-indent: <<: *test_definition script: - jbuilder build @runtest_indent test:stdlib: <<: *test_definition script: - jbuilder build @src/lib_stdlib/runtest test:stdlib_unix: <<: *test_definition script: - jbuilder build @src/lib_stdlib_unix/runtest test:data_encoding: <<: *test_definition script: - jbuilder build @src/lib_data_encoding/runtest test:storage: <<: *test_definition script: - jbuilder build @src/lib_storage/runtest test:crypto: <<: *test_definition script: - jbuilder build @src/lib_crypto/runtest test:shell: <<: *test_definition script: - jbuilder build @src/lib_shell/runtest test:p2p:io-scheduler: <<: *test_definition script: - jbuilder build @src/lib_p2p/runtest_p2p_io_scheduler test:p2p:socket: <<: *test_definition script: - jbuilder build @src/lib_p2p/runtest_p2p_socket test:p2p:pool: <<: *test_definition script: - jbuilder build @src/lib_p2p/runtest_p2p_pool test:proto_alpha: <<: *test_definition script: - jbuilder build @src/proto_alpha/lib_protocol/runtest test:p2p:peerset: <<: *test_definition script: - jbuilder build @src/lib_p2p/runtest_p2p_peerset test:p2p:ipv6set: <<: *test_definition script: - jbuilder build @src/lib_p2p/runtest_p2p_ipv6set test:p2p:banned_peers: <<: *test_definition script: - jbuilder build @src/lib_p2p/runtest_p2p_banned_peers # test:client_alpha:transaction: # <<: *test_definition # script: # - jbuilder build @src/proto_alpha/lib_baking/runtest_transaction # test:client_alpha:origination: # <<: *test_definition # script: # - jbuilder build @src/proto_alpha/lib_baking/runtest_origination test:client_alpha:endorsement: <<: *test_definition script: - jbuilder build @src/proto_alpha/lib_baking/runtest_endorsement test:client_alpha:vote: <<: *test_definition script: - jbuilder build @src/proto_alpha/lib_baking/runtest_vote test:basic.sh: <<: *test_definition script: - jbuilder build @src/bin_client/runtest_basic.sh test:contracts.sh: <<: *test_definition script: - jbuilder build @src/bin_client/runtest_contracts.sh test:multinode.sh: <<: *test_definition script: - jbuilder build @src/bin_client/runtest_multinode.sh test:inject.sh: <<: *test_definition script: - jbuilder build @src/bin_client/runtest_injection.sh test:inject_alpha.sh: <<: *test_definition script: - jbuilder build @src/bin_client/runtest_injection_alpha.sh test:fork.sh: <<: *test_definition script: - jbuilder build @src/bin_client/runtest_fork.sh test:proto:sandbox: <<: *test_definition script: - jbuilder build @runtest_sandbox ## Basic tests through opam packaged (run on master only) .opam_template: &opam_definition image: ${opam_image} stage: opam dependencies: [] only: - master - /^.*opam.*$/ script: - ./scripts/opam-pin.sh - opam depext --yes ${package} - opam install --yes ${package} - opam reinstall --yes --with-test ${package} tags: - gitlab-org ##BEGIN_OPAM## opam:00:ocplib-json-typed: <<: *opam_definition variables: package: ocplib-json-typed opam:01:ocplib-json-typed-bson: <<: *opam_definition variables: package: ocplib-json-typed-bson opam:02:tezos-stdlib: <<: *opam_definition variables: package: tezos-stdlib opam:03:tezos-data-encoding: <<: *opam_definition variables: package: tezos-data-encoding opam:04:ocplib-resto: <<: *opam_definition variables: package: ocplib-resto opam:05:tezos-error-monad: <<: *opam_definition variables: package: tezos-error-monad opam:06:ocplib-resto-directory: <<: *opam_definition variables: package: ocplib-resto-directory opam:07:blake2: <<: *opam_definition variables: package: blake2 opam:08:secp256k1: <<: *opam_definition variables: package: secp256k1 opam:09:tezos-clic: <<: *opam_definition variables: package: tezos-clic opam:10:tezos-rpc: <<: *opam_definition variables: package: tezos-rpc opam:11:tweetnacl: <<: *opam_definition variables: package: tweetnacl opam:12:tezos-crypto: <<: *opam_definition variables: package: tezos-crypto opam:13:tezos-micheline: <<: *opam_definition variables: package: tezos-micheline opam:14:tezos-base: <<: *opam_definition variables: package: tezos-base opam:15:pbkdf: <<: *opam_definition variables: package: pbkdf opam:16:ocplib-resto-cohttp: <<: *opam_definition variables: package: ocplib-resto-cohttp opam:17:irmin-leveldb: <<: *opam_definition variables: package: irmin-leveldb opam:18:tezos-protocol-environment-sigs: <<: *opam_definition variables: package: tezos-protocol-environment-sigs opam:19:tezos-stdlib-unix: <<: *opam_definition variables: package: tezos-stdlib-unix opam:20:bip39: <<: *opam_definition variables: package: bip39 opam:21:tezos-rpc-http: <<: *opam_definition variables: package: tezos-rpc-http opam:22:tezos-shell-services: <<: *opam_definition variables: package: tezos-shell-services opam:23:tezos-storage: <<: *opam_definition variables: package: tezos-storage opam:24:tezos-protocol-compiler: <<: *opam_definition variables: package: tezos-protocol-compiler opam:25:tezos-client-base: <<: *opam_definition variables: package: tezos-client-base opam:26:tezos-protocol-alpha: <<: *opam_definition variables: package: tezos-protocol-alpha opam:27:tezos-protocol-environment: <<: *opam_definition variables: package: tezos-protocol-environment opam:28:tezos-client-alpha: <<: *opam_definition variables: package: tezos-client-alpha opam:29:tezos-client-commands: <<: *opam_definition variables: package: tezos-client-commands opam:30:tezos-protocol-environment-shell: <<: *opam_definition variables: package: tezos-protocol-environment-shell opam:31:tezos-baking-alpha: <<: *opam_definition variables: package: tezos-baking-alpha opam:32:tezos-protocol-genesis: <<: *opam_definition variables: package: tezos-protocol-genesis opam:33:ocplib-resto-json: <<: *opam_definition variables: package: ocplib-resto-json opam:34:tezos-protocol-updater: <<: *opam_definition variables: package: tezos-protocol-updater opam:35:tezos-p2p: <<: *opam_definition variables: package: tezos-p2p opam:36:tezos-baking-alpha-commands: <<: *opam_definition variables: package: tezos-baking-alpha-commands opam:37:tezos-client-alpha-commands: <<: *opam_definition variables: package: tezos-client-alpha-commands opam:38:tezos-client-base-unix: <<: *opam_definition variables: package: tezos-client-base-unix opam:39:tezos-client-genesis: <<: *opam_definition variables: package: tezos-client-genesis opam:40:ocplib-ezresto: <<: *opam_definition variables: package: ocplib-ezresto opam:41:tezos-embedded-protocol-alpha: <<: *opam_definition variables: package: tezos-embedded-protocol-alpha opam:42:tezos-embedded-protocol-demo: <<: *opam_definition variables: package: tezos-embedded-protocol-demo opam:43:tezos-embedded-protocol-genesis: <<: *opam_definition variables: package: tezos-embedded-protocol-genesis opam:44:tezos-shell: <<: *opam_definition variables: package: tezos-shell opam:45:tezos-client: <<: *opam_definition variables: package: tezos-client opam:46:ocplib-ezresto-directory: <<: *opam_definition variables: package: ocplib-ezresto-directory opam:47:tezos-baker-alpha: <<: *opam_definition variables: package: tezos-baker-alpha opam:48:tezos-protocol-demo: <<: *opam_definition variables: package: tezos-protocol-demo opam:49:tezos-node: <<: *opam_definition variables: package: tezos-node opam:50:ocplib-json-typed-browser: <<: *opam_definition variables: package: ocplib-json-typed-browser ##END_OPAM## ## Publishing (small) docker images with tezos binaries publish:docker:minimal: <<: *dind_definition stage: publish only: - master - alphanet - zeronet script: - ./scripts/ci/create_docker_image.build.sh "tezos_build" "${CI_COMMIT_REF_NAME}" "${build_deps_image}:${CI_COMMIT_SHA}" - ./scripts/ci/create_docker_image.minimal.sh "${public_docker_image}" "${CI_COMMIT_REF_NAME}" "tezos_build:${CI_COMMIT_REF_NAME}" - mkdir ~/.docker || true - echo "${CI_DOCKER_AUTH}" > ~/.docker/config.json ; - docker push "${public_docker_image}:${CI_COMMIT_REF_NAME}" ## Publish to github... publish:github: image: ${opam_image} stage: publish dependencies: [] only: - master@tezos/tezos - alphanet@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 - sudo apk add --no-cache openssh - git push git@github.com:tezos/tezos.git -f HEAD:${CI_COMMIT_REF_NAME} tags: - gitlab-org ## Publish docs to gitlab... pages: image: ${build_deps_image}:${CI_COMMIT_SHA} stage: publish only: - master@tezos/tezos artifacts: paths: - public script: - sudo apk add --no-cache py3-sphinx py3-sphinx_rtd_theme - sudo ln -s /usr/bin/sphinx-build-3 /usr/bin/sphinx-build - opam install --yes odoc - make doc-html && sudo mv docs/_build "${CI_PROJECT_DIR}"/public tags: - gitlab-org documentation: image: ${build_deps_image}:${CI_COMMIT_SHA} stage: test only: - /^.*doc.*$/ script: - sudo apk add --no-cache py3-sphinx py3-sphinx_rtd_theme - sudo ln -s /usr/bin/sphinx-build-3 /usr/bin/sphinx-build - opam install --yes odoc - make doc-html tags: - gitlab-org ## Relaunching the bootstrap servers of the alphanet/zeronet .bootstrap_template: &bootstrap_definition image: ${opam_image} stage: deploy dependencies: [] before_script: - echo "${CI_KH}" > ~/.ssh/known_hosts - echo "${CI_PK_ALPHANET}" | tr -d "\r" > ~/.ssh/id_ed25519 ; - echo "${CI_SSH_CONFIG}" | tr -d "\r" > ~/.ssh/config - chmod 600 ~/.ssh/id_ed25519 - sudo apk add --no-cache openssh allow_failure: true tags: - gitlab-org deploy:bootstrap1: <<: *bootstrap_definition only: - alphanet@tezos/tezos script: - ssh bootstrap1 deploy:bootstrap2: <<: *bootstrap_definition only: - alphanet@tezos/tezos script: - ssh bootstrap2 deploy:bootstrap3: <<: *bootstrap_definition only: - alphanet@tezos/tezos script: - ssh bootstrap3 deploy:bootstrap4: <<: *bootstrap_definition only: - alphanet@tezos/tezos script: - ssh bootstrap4 deploy:bootstrap5: <<: *bootstrap_definition only: - alphanet@tezos/tezos script: - ssh bootstrap5 deploy:bootstrap6: <<: *bootstrap_definition only: - alphanet@tezos/tezos script: - ssh bootstrap6 deploy:zeronet1: <<: *bootstrap_definition only: - zeronet@tezos/tezos script: - ssh zeronet1 deploy:zeronet2: <<: *bootstrap_definition only: - zeronet@tezos/tezos script: - ssh zeronet2 deploy:zeronet3: <<: *bootstrap_definition only: - zeronet@tezos/tezos script: - ssh zeronet3 # cleanup: # <<: *dind_definition # stage: cleanup # dependencies: [] # script: # - ./scripts/ci/docker_registry_delete.sh # "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" # "${build_deps_image}" "${CI_COMMIT_SHA}"