2016-09-08 21:13:10 +04:00
|
|
|
variables:
|
2017-03-05 05:15:14 +04:00
|
|
|
public_docker_image: docker.io/tezos/tezos
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
- publish
|
2017-03-09 17:43:59 +04:00
|
|
|
- deploy
|
2016-09-08 21:13:10 +04:00
|
|
|
- cleanup
|
|
|
|
|
2017-08-04 20:32:52 +04:00
|
|
|
## Template for `docker_in_docker` jobs
|
|
|
|
|
|
|
|
.dind_template: &dind_definition
|
2017-03-05 05:15:14 +04:00
|
|
|
image: docker:latest
|
2017-08-04 20:32:52 +04:00
|
|
|
variables:
|
|
|
|
DOCKER_DRIVER: overlay2
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
before_script:
|
|
|
|
- docker info
|
|
|
|
- docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" "${CI_REGISTRY}"
|
2016-09-08 21:13:10 +04:00
|
|
|
tags:
|
2017-08-04 20:32:52 +04:00
|
|
|
- docker
|
|
|
|
|
|
|
|
## Tezos
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
build:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *dind_definition
|
2016-09-08 21:13:10 +04:00
|
|
|
stage: build
|
|
|
|
script:
|
2017-08-04 20:32:52 +04:00
|
|
|
## Building dependencies...
|
|
|
|
- ./scripts/create_docker_image.build_deps.sh
|
|
|
|
"build_deps" "${CI_BUILD_REF}"
|
2017-08-08 19:04:11 +04:00
|
|
|
"${CI_REGISTRY_IMAGE}/build_deps"
|
2017-08-04 20:32:52 +04:00
|
|
|
## Preparing sources for the alphanet or the zeronet...
|
|
|
|
- if [ "${CI_PROJECT_PATH}" = "tezos/tezos" ] ; then
|
|
|
|
./scripts/apply_patch.sh "${CI_BUILD_REF_NAME}" ;
|
|
|
|
fi
|
|
|
|
## Building...
|
|
|
|
- ./scripts/create_docker_image.build.sh
|
|
|
|
"${CI_REGISTRY_IMAGE}/build" "${CI_BUILD_REF}"
|
|
|
|
"build_deps:${CI_BUILD_REF}"
|
|
|
|
## Saving the docker image...
|
|
|
|
- docker push "${CI_REGISTRY_IMAGE}/build:${CI_BUILD_REF}"
|
|
|
|
|
|
|
|
## Basic tests
|
|
|
|
|
|
|
|
.test_template: &test_definition
|
|
|
|
stage: test
|
|
|
|
image: ${CI_REGISTRY_IMAGE}/build:${CI_BUILD_REF}
|
|
|
|
before_script:
|
|
|
|
- cd /home/opam/tezos
|
|
|
|
dependencies:
|
|
|
|
- build
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-04-05 20:24:26 +04:00
|
|
|
test:utils:data-encoding:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2016-09-08 21:13:10 +04:00
|
|
|
script:
|
2017-04-05 20:24:26 +04:00
|
|
|
- make -C test/utils run-test-data-encoding
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-04-05 20:24:26 +04:00
|
|
|
test:utils:merkle:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2016-09-08 21:13:10 +04:00
|
|
|
script:
|
2017-04-05 20:24:26 +04:00
|
|
|
- make -C test/utils run-test-merkle
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-04-05 20:24:26 +04:00
|
|
|
test:shell:store:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2016-09-08 21:13:10 +04:00
|
|
|
script:
|
2017-04-05 20:24:26 +04:00
|
|
|
- make -C test/shell run-test-store
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-04-05 20:24:26 +04:00
|
|
|
test:shell:context:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2016-09-08 21:13:10 +04:00
|
|
|
script:
|
2017-04-05 20:24:26 +04:00
|
|
|
- make -C test/shell run-test-context
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-04-05 20:24:26 +04:00
|
|
|
test:shell:state:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2016-10-19 17:09:00 +04:00
|
|
|
script:
|
2017-04-05 20:24:26 +04:00
|
|
|
- make -C test/shell run-test-state
|
2017-03-31 03:17:25 +04:00
|
|
|
|
2017-04-05 20:24:26 +04:00
|
|
|
test:p2p:io-scheduler:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2017-03-31 03:17:25 +04:00
|
|
|
script:
|
2017-04-05 20:24:26 +04:00
|
|
|
- make -C test/p2p run-test-p2p-io-scheduler
|
2016-10-19 17:09:00 +04:00
|
|
|
|
2017-04-05 20:24:26 +04:00
|
|
|
test:p2p:connection:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2017-01-14 16:14:22 +04:00
|
|
|
script:
|
2017-04-05 20:24:26 +04:00
|
|
|
- make -C test/p2p run-test-p2p-connection
|
2017-01-14 16:14:22 +04:00
|
|
|
|
2017-04-05 20:24:26 +04:00
|
|
|
test:p2p:connection-pool:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2017-01-14 16:14:22 +04:00
|
|
|
script:
|
2017-04-05 20:24:26 +04:00
|
|
|
- make -C test/p2p run-test-p2p-connection-pool
|
2017-01-14 16:14:22 +04:00
|
|
|
|
2017-04-06 00:40:02 +04:00
|
|
|
test:proto_alpha:transactions:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2017-04-06 00:40:02 +04:00
|
|
|
script:
|
|
|
|
- make -C test/proto_alpha run-test-transaction
|
|
|
|
|
2017-04-06 00:42:40 +04:00
|
|
|
test:proto_alpha:origination:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2017-04-06 00:42:40 +04:00
|
|
|
script:
|
|
|
|
- make -C test/proto_alpha run-test-origination
|
|
|
|
|
2017-04-06 00:43:50 +04:00
|
|
|
test:proto_alpha:endorsement:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2017-04-06 00:43:50 +04:00
|
|
|
script:
|
|
|
|
- make -C test/proto_alpha run-test-endorsement
|
|
|
|
|
2017-04-12 20:53:23 +04:00
|
|
|
test:proto_alpha:vote:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2017-04-12 20:53:23 +04:00
|
|
|
script:
|
|
|
|
- make -C test/proto_alpha run-test-vote
|
|
|
|
|
2017-04-05 20:24:26 +04:00
|
|
|
test:basic.sh:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2017-01-14 16:14:22 +04:00
|
|
|
script:
|
2017-04-05 20:24:26 +04:00
|
|
|
- make -C test run-basic.sh
|
2017-03-05 05:15:14 +04:00
|
|
|
|
2017-07-24 21:06:40 +04:00
|
|
|
test:contracts.sh:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *test_definition
|
2017-07-24 21:06:40 +04:00
|
|
|
script:
|
|
|
|
- make -C test run-contracts.sh
|
|
|
|
|
2017-08-09 18:09:41 +04:00
|
|
|
test:multinode.sh:
|
|
|
|
<<: *test_definition
|
|
|
|
script:
|
|
|
|
- make -C test run-multinode.sh
|
|
|
|
|
2017-08-04 20:32:52 +04:00
|
|
|
## Publishing (small) docker images with tezos binaries
|
2017-01-14 16:14:22 +04:00
|
|
|
|
2017-08-04 20:32:52 +04:00
|
|
|
publish:docker:minimal:
|
|
|
|
<<: *dind_definition
|
2017-01-22 04:59:18 +04:00
|
|
|
stage: publish
|
2017-03-05 05:15:14 +04:00
|
|
|
only:
|
|
|
|
- master@tezos/tezos
|
2017-03-09 17:43:59 +04:00
|
|
|
- alphanet@tezos/tezos
|
2017-08-04 20:32:52 +04:00
|
|
|
- zeronet@tezos/tezos
|
2017-03-09 17:43:59 +04:00
|
|
|
script:
|
2017-08-04 20:32:52 +04:00
|
|
|
- docker pull "${CI_REGISTRY_IMAGE}/build:${CI_BUILD_REF}"
|
2017-08-08 19:04:11 +04:00
|
|
|
- if [ "${CI_PROJECT_PATH}" = "tezos/tezos" ] ; then
|
|
|
|
./scripts/apply_patch.sh "${CI_BUILD_REF_NAME}" ;
|
|
|
|
fi
|
2017-08-04 20:32:52 +04:00
|
|
|
- ./scripts/create_docker_image.minimal.sh
|
|
|
|
"${public_docker_image}" "${CI_BUILD_REF_NAME}"
|
|
|
|
"${CI_REGISTRY_IMAGE}/build:${CI_BUILD_REF}"
|
2017-03-09 17:43:59 +04:00
|
|
|
- echo "$CI_DOCKER_AUTH" > ~/.docker/config.json ;
|
2017-08-04 20:32:52 +04:00
|
|
|
- docker push "${public_docker_image}:${CI_BUILD_REF_NAME}"
|
2017-03-09 17:43:59 +04:00
|
|
|
|
2017-08-04 20:32:52 +04:00
|
|
|
## Publish to github...
|
2017-03-09 17:43:59 +04:00
|
|
|
|
2017-01-22 04:59:18 +04:00
|
|
|
publish:github:
|
|
|
|
image: ocaml/opam
|
|
|
|
stage: publish
|
2016-09-08 21:13:10 +04:00
|
|
|
only:
|
|
|
|
- master@tezos/tezos
|
2017-08-04 20:32:52 +04:00
|
|
|
- alphanet@tezos/tezos
|
2016-09-08 21:13:10 +04:00
|
|
|
script:
|
|
|
|
- echo "${CI_KH}" > ~/.ssh/known_hosts
|
2017-01-22 04:59:18 +04:00
|
|
|
- echo "${CI_PK_GITHUB}" > ~/.ssh/id_rsa
|
2016-09-08 21:13:10 +04:00
|
|
|
- chmod 400 ~/.ssh/id_rsa
|
|
|
|
- rm -fr .git/refs/original
|
2017-08-04 20:32:52 +04:00
|
|
|
- if [ "${CI_PROJECT_PATH}" = "tezos/tezos" ] ; then
|
|
|
|
./scripts/apply_patch.sh "${CI_BUILD_REF_NAME}" ;
|
|
|
|
fi
|
2017-08-10 20:08:58 +04:00
|
|
|
- git filter-branch --prune-empty --env-filter
|
2016-09-21 17:36:45 +04:00
|
|
|
'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'
|
2016-09-08 21:13:10 +04:00
|
|
|
HEAD
|
2017-08-04 20:32:52 +04:00
|
|
|
- git push git@github.com:tezos/tezos.git -f HEAD:${CI_BUILD_REF_NAME}
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-08-08 19:04:11 +04:00
|
|
|
|
|
|
|
## Relaunching the bootstrap servers of the alphanet.zeronet
|
|
|
|
|
|
|
|
.bootstrap_template: &bootstrap_definition
|
2017-03-09 17:43:59 +04:00
|
|
|
image: ocaml/opam
|
|
|
|
stage: deploy
|
|
|
|
only:
|
|
|
|
- alphanet@tezos/tezos
|
2017-08-08 19:04:11 +04:00
|
|
|
- zeronet@tezos/tezos
|
|
|
|
before_script:
|
2017-03-09 17:43:59 +04:00
|
|
|
- echo "${CI_KH}" > ~/.ssh/known_hosts
|
2017-08-08 19:04:11 +04:00
|
|
|
- if [ "${CI_BUILD_REF_NAME}" = "alphanet" ]; then
|
|
|
|
echo "${CI_PK_ALPHANET}" | tr -d "\r" > ~/.ssh/id_ed25519 ;
|
|
|
|
else
|
|
|
|
echo "${CI_PK_ZERONET}" | tr -d "\r" > ~/.ssh/id_ed25519 ;
|
|
|
|
fi
|
|
|
|
- echo "${CI_SSH_CONFIG}" | tr -d "\r" > ~/.ssh/config
|
2017-07-06 20:09:09 +04:00
|
|
|
- chmod 600 ~/.ssh/id_ed25519
|
2017-03-09 17:43:59 +04:00
|
|
|
allow_failure: true
|
|
|
|
|
2017-08-08 19:04:11 +04:00
|
|
|
deploy:bootstrap1:
|
|
|
|
<<: *bootstrap_definition
|
2017-03-09 17:43:59 +04:00
|
|
|
script:
|
2017-08-08 19:04:11 +04:00
|
|
|
- ssh bootstrap1
|
|
|
|
|
|
|
|
deploy:bootstrap2:
|
|
|
|
<<: *bootstrap_definition
|
|
|
|
script:
|
|
|
|
- ssh bootstrap2
|
|
|
|
|
|
|
|
deploy:bootstrap3:
|
|
|
|
<<: *bootstrap_definition
|
|
|
|
script:
|
|
|
|
- ssh bootstrap3
|
|
|
|
|
|
|
|
deploy:bootstrap4:
|
|
|
|
<<: *bootstrap_definition
|
|
|
|
script:
|
|
|
|
- ssh bootstrap4
|
|
|
|
|
|
|
|
deploy:bootstrap5:
|
|
|
|
<<: *bootstrap_definition
|
|
|
|
script:
|
|
|
|
- ssh bootstrap5
|
|
|
|
|
|
|
|
deploy:bootstrap6:
|
|
|
|
<<: *bootstrap_definition
|
|
|
|
script:
|
|
|
|
- ssh bootstrap6
|
|
|
|
|
|
|
|
## Cleanup...
|
2017-03-09 17:43:59 +04:00
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
cleanup:
|
2017-08-04 20:32:52 +04:00
|
|
|
<<: *dind_definition
|
2016-09-08 21:13:10 +04:00
|
|
|
stage: cleanup
|
2017-03-14 12:18:35 +04:00
|
|
|
script:
|
2017-08-04 20:32:52 +04:00
|
|
|
- ./scripts/delete_ci_image.sh gitlab-ci-token "${CI_BUILD_TOKEN}"
|
|
|
|
"${CI_PROJECT_PATH_SLUG}/build"
|
|
|
|
"${CI_BUILD_REF}"
|
|
|
|
## Temporary allowed failure until image deletion is allowed on gitlab
|
|
|
|
## https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13248
|
2017-01-26 12:58:21 +04:00
|
|
|
allow_failure: true
|