git.delta.rocks / unique-network / refs/commits / 267f556b0964

difftreelog

Added docker container state verification

Alexander Aksenov2022-08-14parent: #5b56475.patch.diff
in: master

1 file changed

modified.github/workflows/forkless-update-nodata.ymldiffbeforeafterboth
64 strategy:64 strategy:
65 matrix:65 matrix:
66 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}66 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
67# include:
68# - network: "Opal"
69# features: "opal-runtime"
70# runtime: "opal"
71# mainnet_branch: v924010
72# mainnet_tag: v924010
73# - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime
74# features: "quartz-runtime"
75# runtime: "quartz"
76# mainnet_branch: quartz-v924012-2
77# mainnet_tag: v924012
78# - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime
79# features: "unique-runtime"
80# runtime: "unique"
81# mainnet_branch: v924010
82# mainnet_tag: v924010
83
8467
8568
150133
151 - name: Check if docker logs consist logs related to Runtime Upgrade testing.134 - name: Check if docker logs consist logs related to Runtime Upgrade testing.
152 if: success()135 if: success()
153 run: |136 run: |
154 counter=160137 counter=180
155 function do_docker_logs {138 function check_container_status {
139 docker inspect -f {{.State.Running}} node-parachain
140 }
141 function do_docker_logs {
156 docker logs --details node-parachain 2>&1142 docker logs --details node-parachain 2>&1
157 }143 }
158 function is_started {144 function is_started {
159 echo "Check Docker logs"145 if [ "$(check_container_status)" == "true" ]; then
146 echo "Container: node-parachain RUNNING";
147 echo "Check Docker logs"
160 DOCKER_LOGS=$(do_docker_logs)148 DOCKER_LOGS=$(do_docker_logs)
161 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then149 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then
162 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"150 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"
163 return 0151 exit 0
164 exit 0152 fi
165 fi153 else
166 echo "Function is_started: Return 1"154 echo "Container node-parachain not RUNNING";
167 return 1155 exit 1
168 }156 fi
157 }
158
169 while ! is_started; do159 while ! is_started; do
170 echo "Waiting for special message in log files "160 echo "Waiting for special message in log files "
171 sleep 30s161 sleep 30s
172 counter=$(( $counter - 1 ))162 counter=$(( $counter - 1 ))
173 echo "Counter: $counter"163 echo "Counter: $counter"
174 if [ "$counter" -gt "0" ]; then164 if [ "$counter" -gt "0" ]; then
175 continue165 continue
176 else166 else
177 break167 break
178 fi168 fi
179 done169 done
180 exit 1170 exit 1
181 shell: bash171 shell: bash
182172
183 - name: Collect Docker Logs173 - name: Collect Docker Logs
198 name: forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz188 name: forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz
199 path: ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz189 path: ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz
200190
201# - name: Stop running containers191 - name: Stop running containers
202# if: always() # run this step always192 if: always() # run this step always
203# run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down193 run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down
204194