forked from rchain/rchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
80 lines (76 loc) · 2.74 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
stages:
- test
- deploy
test:integration-test-for-p2p-network:
stage: test
tags:
- preloaded-ubuntu1804
before_script:
- export PRETTY_PRINTER_OUTPUT_TRIM_AFTER=150
script:
- ./scripts/install_bnfc.sh
- sudo sbt -Dsbt.log.noformat=true clean rholang/bnfc:generate casper/test:compile node/docker:publishLocal
- sudo python3.6 -m pip install argparse docker pexpect requests
- sudo ./scripts/p2p-test-tool.py -b -t -p 2 -m 2048m
except:
- testing
test:integration-test-for-artifact-creation:
stage: test
tags:
- preloaded-ubuntu1804
script:
- ./scripts/install_bnfc.sh
- sudo sbt -Dsbt.log.noformat=true clean rholang/bnfc:generate casper/test:compile node/rpm:packageBin node/debian:packageBin node/universal:packageZipTarball
except:
- testing
deploy:deploy-rnode-to-dockerhub:
stage: deploy
tags:
- preloaded-ubuntu1804
script:
- ./scripts/install_bnfc.sh
- sudo sbt -Dsbt.log.noformat=true clean rholang/bnfc:generate casper/test:compile node/docker:publishLocal
- echo $DOCKER_PASSWORD | sudo docker login -u $DOCKER_USERNAME --password-stdin
- sudo docker tag coop.rchain/rnode:latest rchain/rnode:${CI_COMMIT_REF_NAME}
- sudo docker push rchain/rnode:${CI_COMMIT_REF_NAME}
- |
if [[ $CI_COMMIT_TAG == v* ]]; then
echo "Is a release tag starting with v and master branch. Tag and push to dockerhub latest.";
sudo docker tag coop.rchain/rnode:latest rchain/rnode:latest
sudo docker push rchain/rnode:latest
fi
only:
- master
- dev
- testing
- /^release-.*$/
- tags
deploy:deploy-rnode-artifacts:
stage: deploy
tags:
- preloaded-ubuntu1804
script:
- ./scripts/install_bnfc.sh
# build rosette
- cd rosette
- ./build.sh
- cd ..
# build deb/rpm packages and compressed archive
- sudo sbt -Dsbt.log.noformat=true clean rholang/bnfc:generate casper/test:compile node/rpm:packageBin node/debian:packageBin node/universal:packageZipTarball
- set -eo pipefail
- artifacts_dir=$(mktemp -d /tmp/artifacts_out.XXXXXXXX)
- cp node/target/rnode_*_all.deb ${artifacts_dir}/
- cp node/target/rpm/RPMS/noarch/rnode-*.noarch.rpm ${artifacts_dir}/
- cp rosette/build.out/rosette-*.deb ${artifacts_dir}/
- cp node/target/universal/*.tgz ${artifacts_dir}/
# deploy artifacts to dispatcher
- mkdir -p ~/.ssh
- echo "${SSH_PRIVATE_KEY}" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- rsync -avrz --delete -e "ssh -p 22 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" ${artifacts_dir}/* [email protected]:/home/inbound/cd/artifacts/${CI_COMMIT_REF_NAME}/
only:
- master
- dev
- testing
- /^release-.*$/
- tags