ligo/.gitlab-ci.yml

461 lines
10 KiB
YAML
Raw Normal View History

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:
2017-08-10 12:05:44 +04:00
- prepare
2016-09-08 21:13:10 +04:00
- build
- test
- opam
2016-09-08 21:13:10 +04:00
- 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:
- safe_docker
2017-08-04 20:32:52 +04:00
2017-08-10 12:05:44 +04:00
## Prepare docker image with precompiled OCaml/opam
2017-12-07 02:03:27 +04:00
prepare:opam:
2017-08-10 12:05:44 +04:00
<<: *dind_definition
stage: prepare
only:
- schedules
before_script:
- . ./scripts/version.sh
script:
- ./scripts/create_docker_image.alpine.sh
2017-08-17 21:26:13 +04:00
- mkdir ~/.docker || true
2017-08-10 12:05:44 +04:00
- echo "$CI_DOCKER_AUTH" > ~/.docker/config.json ;
- docker push "tezos/opam:alpine-${alpine_version}_ocaml-${ocaml_version}"
- docker tag "tezos/opam:alpine-${alpine_version}_ocaml-${ocaml_version}"
"tezos/opam:latest"
- docker push "tezos/opam:latest"
2017-12-07 02:03:27 +04:00
prepare:opam2:
<<: *dind_definition
stage: prepare
only:
- schedules
before_script:
- . ./scripts/version.sh
script:
- ./scripts/create_docker_image.alpine.opam2.sh
- mkdir ~/.docker || true
- echo "$CI_DOCKER_AUTH" > ~/.docker/config.json ;
- docker push "tezos/opam2:alpine-${alpine_version}_ocaml-${ocaml_version}"
- docker tag "tezos/opam2:alpine-${alpine_version}_ocaml-${ocaml_version}"
"tezos/opam2:latest"
- docker push "tezos/opam2:latest"
2017-08-04 20:32:52 +04:00
## 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}"
"${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 (run on merge requests)
2017-08-04 20:32:52 +04:00
.test_template: &test_definition
stage: test
image: ${CI_REGISTRY_IMAGE}/build:${CI_BUILD_REF}
except:
- master@tezos/tezos
2017-08-04 20:32:52 +04:00
before_script:
- cd /home/opam/tezos
dependencies:
- build
2016-09-08 21:13:10 +04:00
test:ocp-indent:
<<: *test_definition
script:
- jbuilder build @runtest_indent
test:utils:
2017-08-04 20:32:52 +04:00
<<: *test_definition
2016-09-08 21:13:10 +04:00
script:
- jbuilder build @test/utils/runtest
2016-09-08 21:13:10 +04:00
test:shell:
2017-08-04 20:32:52 +04:00
<<: *test_definition
2016-09-08 21:13:10 +04:00
script:
- jbuilder build @test/shell/runtest
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:
- jbuilder build @test/p2p/runtest_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:
- jbuilder build @test/p2p/runtest_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:
- jbuilder build @test/p2p/runtest_p2p_connection_pool
2017-01-14 16:14:22 +04:00
test:proto_alpha:transaction:
2017-08-04 20:32:52 +04:00
<<: *test_definition
script:
- jbuilder build @test/proto_alpha/runtest_transaction
retry: 1
test:proto_alpha:origination:
2017-08-04 20:32:52 +04:00
<<: *test_definition
script:
- jbuilder build @test/proto_alpha/runtest_origination
retry: 1
test:proto_alpha:endorsement:
2017-08-04 20:32:52 +04:00
<<: *test_definition
script:
- jbuilder build @test/proto_alpha/runtest_endorsement
retry: 1
test:proto_alpha:vote:
2017-08-04 20:32:52 +04:00
<<: *test_definition
script:
- jbuilder build @test/proto_alpha/runtest_vote
retry: 1
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:
- jbuilder build @test/runtest_basic.sh
retry: 1
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:
- jbuilder build @test/runtest_contracts.sh
retry: 1
2017-07-24 21:06:40 +04:00
2017-08-09 18:09:41 +04:00
test:multinode.sh:
<<: *test_definition
script:
- jbuilder build @test/runtest_multinode.sh
retry: 1
2017-08-09 18:09:41 +04:00
2017-11-27 09:13:12 +04:00
test:proto:sandbox:
<<: *test_definition
script:
2017-11-27 09:13:12 +04:00
- jbuilder build @runtest_sandbox
## Basic tests through opam packaged (run on master only)
##
## We use opam2-beta because we want to run the testsuite,
## i.e. `opam install --with-test`, and it is buggy in opam.1.2.1. It
## insists on building the testsuite of all the dependencies... and many
## package in opam-repository have buggy testsuite packaging.
.opam_template: &opam_definition
image: tezos/opam2
stage: opam
only:
- master@tezos/tezos
script:
- ./scripts/opam-pin.sh
- opam depext --yes ${package}
- opam install --yes --deps-only ${package}
- opam install --yes --with-test ${package}
opam:01:ocplib-resto:
<<: *opam_definition
variables:
package: ocplib-resto
opam:02:ocplib-resto-directory:
<<: *opam_definition
variables:
package: ocplib-resto-directory
opam:03:ocplib-resto-cohttp:
<<: *opam_definition
variables:
package: ocplib-resto-cohttp
opam:04:ocplib-resto-json:
<<: *opam_definition
variables:
package: ocplib-resto-json
opam:05:ocplib-ezresto:
<<: *opam_definition
variables:
package: ocplib-ezresto
opam:06:ocplib-ezresto-directory:
<<: *opam_definition
variables:
package: ocplib-ezresto-directory
opam:07:tezos-stdlib:
<<: *opam_definition
variables:
package: tezos-stdlib
opam:08:tezos-data-encoding:
<<: *opam_definition
variables:
package: tezos-data-encoding
opam:09:tezos-error-monad:
<<: *opam_definition
variables:
package: tezos-error-monad
opam:10:tezos-stdlib-lwt:
<<: *opam_definition
variables:
package: tezos-stdlib-lwt
opam:11:tezos-crypto:
<<: *opam_definition
variables:
package: tezos-crypto
opam:12:tezos-base:
<<: *opam_definition
variables:
package: tezos-base
opam:13:tezos-node-p2p-base:
<<: *opam_definition
variables:
package: tezos-node-p2p-base
opam:14:tezos-node-services:
<<: *opam_definition
variables:
package: tezos-node-services
opam:15:tezos-protocol-environment-sigs:
<<: *opam_definition
variables:
package: tezos-protocol-environment-sigs
opam:16:irmin-leveldb:
<<: *opam_definition
variables:
package: irmin-leveldb
opam:17:tezos-micheline:
<<: *opam_definition
variables:
package: tezos-micheline
2017-12-12 17:39:53 +04:00
opam:18:tezos-rpc-http:
<<: *opam_definition
variables:
2017-12-12 17:39:53 +04:00
package: tezos-rpc-http
opam:19:tezos-protocol-compiler:
<<: *opam_definition
variables:
package: tezos-protocol-compiler
opam:20:tezos-storage:
<<: *opam_definition
variables:
package: tezos-storage
opam:21:tezos-node-p2p:
<<: *opam_definition
variables:
package: tezos-node-p2p
opam:22:tezos-node-updater:
<<: *opam_definition
variables:
package: tezos-node-updater
opam:23:tezos-node-shell:
<<: *opam_definition
variables:
package: tezos-node-shell
opam:24:tezos-embedded-protocol-alpha:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-alpha
opam:25:tezos-embedded-protocol-demo:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-demo
opam:26:tezos-embedded-protocol-genesis:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-genesis
opam:27:tezos-client-base:
<<: *opam_definition
variables:
package: tezos-client-base
opam:28:tezos-embedded-client-alpha:
<<: *opam_definition
variables:
package: tezos-embedded-client-alpha
opam:29:tezos-embedded-client-genesis:
<<: *opam_definition
variables:
package: tezos-embedded-client-genesis
opam:30:tezos-protocol-demo:
<<: *opam_definition
variables:
package: tezos-protocol-demo
opam:31:tezos-client:
<<: *opam_definition
variables:
package: tezos-client
opam:32:tezos-node:
<<: *opam_definition
variables:
package: tezos-node
opam:33:tezos-protocol-alpha:
<<: *opam_definition
variables:
package: tezos-protocol-alpha
opam:34:tezos-protocol-genesis:
<<: *opam_definition
variables:
package: tezos-protocol-genesis
opam:35:tezos-test:
<<: *opam_definition
variables:
package: tezos-test
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
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}"
- 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-08-17 21:26:13 +04:00
- mkdir ~/.docker || true
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
publish:github:
2017-08-10 12:05:44 +04:00
image: tezos/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
- 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
- git push git@github.com:tezos/tezos.git -f HEAD:${CI_BUILD_REF_NAME}
2016-09-08 21:13:10 +04:00
## Relaunching the bootstrap servers of the alphanet.zeronet
.bootstrap_template: &bootstrap_definition
2017-08-10 12:05:44 +04:00
image: tezos/opam
2017-03-09 17:43:59 +04:00
stage: deploy
only:
- alphanet@tezos/tezos
- zeronet@tezos/tezos
before_script:
2017-03-09 17:43:59 +04:00
- echo "${CI_KH}" > ~/.ssh/known_hosts
- 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
deploy:bootstrap1:
<<: *bootstrap_definition
2017-03-09 17:43:59 +04:00
script:
- 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
2017-08-16 16:18:34 +04:00
# cleanup:
# <<: *dind_definition
# stage: cleanup
# script:
# - apk add -U curl jq
# - ./scripts/delete_ci_image.sh gitlab-ci-token "${CI_BUILD_TOKEN}"
# "${CI_PROJECT_PATH}/build"
# "${CI_BUILD_REF}"