-
Notifications
You must be signed in to change notification settings - Fork 6
/
.drone.yml
178 lines (161 loc) · 5.99 KB
/
.drone.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
workspace:
base: /workdir
path: rchain-perf-harness
clone:
clone-rchain-perf-harness:
image: plugins/git
clone-rchain:
image: plugins/git
commands:
- git clone $${RCHAIN_REPO:-https://github.com/rchain/rchain.git} /workdir/rchain && cd /workdir/rchain
- git fetch
- git checkout dev
pipeline:
restore-cache:
image: drillster/drone-volume-cache
restore: true
mount:
- /workdir/.ivy2
volumes:
- /tmp/cache:/cache
setup-when-custom-commit:
image: lukaszgolebiewski/rchain-builder
pull: true
commands:
- echo $CONTRACT
- echo $RCHAIN_COMMIT_HASH
- cd /workdir/rchain
- git checkout $RCHAIN_COMMIT_HASH
- sbt -Dsbt.ivy.home=/workdir/.ivy2 ";rholang/bnfc:generate; compile; node/docker:publishLocal"
- cd -
- ci/patch-image-with-docker-package.sh coop.rchain/rnode:DRONE-${DRONE_BUILD_NUMBER} rchain/rnode:for_drone_${DRONE_BUILD_NUMBER}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
when:
event: deployment
environment: custom_commit
setup:
image: docker
commands:
- echo $CONTRACT
- echo $RNODE_IMAGE_VERSION
- docker pull rchain/rnode:dev
- ci/patch-image-with-docker-package.sh rchain/rnode:dev rchain/rnode:for_drone_${DRONE_BUILD_NUMBER}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
when:
event: push
setup-when-custom-contract:
image: docker
commands:
- echo $CONTRACT
- echo $RNODE_IMAGE_VERSION
- docker pull rchain/rnode:$RNODE_IMAGE_VERSION
- ci/patch-image-with-docker-package.sh rchain/rnode:$RNODE_IMAGE_VERSION rchain/rnode:for_drone_${DRONE_BUILD_NUMBER}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
when:
event: deployment
environment: custom_contract
bootstrap:
image: rchain/rnode:for_drone_${DRONE_BUILD_NUMBER}
detach: true
environment:
commands:
- /opt/docker/bin/rnode -c ./drone/config/bootstrap.conf run
wait-for-bootstrap:
image: rchain/rnode:for_drone_${DRONE_BUILD_NUMBER}
commands:
- until ci/is-container-log-line-present.sh _step_4 'Making a transition to Running state.'; do echo $?; sleep 5; done
volumes:
- /var/run/docker.sock:/var/run/docker.sock
validator1:
image: rchain/rnode:for_drone_${DRONE_BUILD_NUMBER}
detach: true
environment:
commands:
- /opt/docker/bin/rnode -c ./drone/config/validator1.conf run
validator2:
image: rchain/rnode:for_drone_${DRONE_BUILD_NUMBER}
detach: true
environment:
commands:
- /opt/docker/bin/rnode -c ./drone/config/validator2.conf run
validator3:
image: rchain/rnode:for_drone_${DRONE_BUILD_NUMBER}
detach: true
environment:
commands:
- /opt/docker/bin/rnode -c ./drone/config/validator3.conf run
validator4:
image: rchain/rnode:for_drone_${DRONE_BUILD_NUMBER}
detach: true
environment:
commands:
- /opt/docker/bin/rnode -c ./drone/config/validator4.conf run
wait-for-validators:
image: rchain/rnode:for_drone_${DRONE_BUILD_NUMBER}
commands:
- until ci/is-container-log-line-present.sh _step_6 'Making a transition to Running state.'; do echo $?; sleep 5; done
- until ci/is-container-log-line-present.sh _step_7 'Making a transition to Running state.'; do echo $?; sleep 5; done
- until ci/is-container-log-line-present.sh _step_8 'Making a transition to Running state.'; do echo $?; sleep 5; done
- until ci/is-container-log-line-present.sh _step_9 'Making a transition to Running state.'; do echo $?; sleep 5; done
volumes:
- /var/run/docker.sock:/var/run/docker.sock
gatling:
image: lukaszgolebiewski/rchain-builder
environment:
- RCHAIN_REPO_HASH=${RNODE_IMAGE_VERSION}
commands:
- pwd
- cd templater
- mkfifo pipe
- tee sbt.out < pipe &
- sbt -Dsbt.ivy.home=/workdir/.ivy2 -Drnodes.0=bootstrap:30015 -Drnodes.1=validator1:30015 -Drnodes.2=validator2:30015 -Drnodes.3=validator3:30015 -Drnodes.4=validator4:30015 runner/gatling:test > pipe
- /bin/bash ../etc/check-build-status.sh
when:
event: push
gatling-custom-contract:
image: hseeberger/scala-sbt:8u212_1.2.8_2.12.9
environment:
- RCHAIN_REPO_HASH=${RNODE_IMAGE_VERSION}
commands:
- pwd
- cd templater
- echo $CONTRACT
- mkfifo pipe
- tee sbt.out < pipe &
- sbt -Dsbt.ivy.home=/workdir/.ivy2 -Dcontract=$CONTRACT -Drnodes.0=bootstrap:30015 -Drnodes.1=validator1:30015 -Drnodes.2=validator2:30015 -Drnodes.3=validator3:30015 -Drnodes.4=validator4:30015 "runner/gatling:testOnly coop.rchain.perf.DeployProposeSimulation" > pipe
- /bin/bash ../etc/check-build-status.sh
when:
event: deployment
environment: custom_contract
gatling-custom-commit:
image: hseeberger/scala-sbt:8u212_1.2.8_2.12.9
environment:
- RCHAIN_REPO_HASH=${RCHAIN_COMMIT_HASH}
commands:
- pwd
- cd templater
- echo $CONTRACT
- mkfifo pipe
- tee sbt.out < pipe &
- sbt -Dsbt.ivy.home=/workdir/.ivy2 -Dcontract=$CONTRACT -Drnodes.0=bootstrap:30015 -Drnodes.1=validator1:30015 -Drnodes.2=validator2:30015 -Drnodes.3=validator3:30015 -Drnodes.4=validator4:30015 "runner/gatling:testOnly coop.rchain.perf.DeployProposeSimulation" > pipe
- /bin/bash ../etc/check-build-status.sh
when:
event: deployment
environment: custom_commit
rebuild-cache:
image: drillster/drone-volume-cache
rebuild: true
mount:
- /workdir/.ivy2
volumes:
- /tmp/cache:/cache
clean-up-docker-images:
image: docker
commands:
- docker images | awk "\$2 !~ /for_drone_$DRONE_BUILD_NUMBER/ { print }" | awk '$2 ~ /for_drone_[0-9]*/ { print $3 }' | xargs --no-run-if-empty docker rmi --force
- docker images | awk "\$2 !~ /DRONE-$DRONE_BUILD_NUMBER/ { print }" | awk '$2 ~ /DRONE-[0-9]*/ { print $3 }' | xargs --no-run-if-empty docker rmi --force
volumes:
- /var/run/docker.sock:/var/run/docker.sock