git.delta.rocks / unique-network / refs/commits / c5d75d752f0d

difftreelog

Changed script exit code

Alexander Aksenov2022-08-16parent: #75794b8.patch.diff
in: master

1 file changed

modified.github/workflows/forkless-update-nodata.ymldiffbeforeafterboth
133133
134 - 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.
135 if: success()135 if: success()
136 run: |136 run: |
137 counter=160137 counter=160
138 function check_container_status {138 function check_container_status {
139 docker inspect -f {{.State.Running}} node-parachain139 docker inspect -f {{.State.Running}} node-parachain
140 }140 }
141 function do_docker_logs {141 function do_docker_logs {
142 docker logs --details node-parachain 2>&1142 docker logs --details node-parachain 2>&1
143 }143 }
144 function is_started {144 function is_started {
145 if [ "$(check_container_status)" == "true" ]; then145 if [ "$(check_container_status)" == "true" ]; then
146 echo "Container: node-parachain RUNNING";146 echo "Container: node-parachain RUNNING";
147 echo "Check Docker logs"147 echo "Check Docker logs"
148 DOCKER_LOGS=$(do_docker_logs)148 DOCKER_LOGS=$(do_docker_logs)
149 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then149 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then
150 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"150 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"
151 return 0151 return 0
152 exit 1152 exit 1
153 else 153 else
154 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸 - Not found in logs output."154 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸 - Not found in logs output."
155 return 1155 return 1
156 exit 1156 exit 1
157 fi157 fi
158 else158 else
159 echo "Container node-parachain not RUNNING"159 echo "Container node-parachain not RUNNING"
160 echo "Halting all future checks"160 echo "Halting all future checks"
161 exit 1161 exit 1
162 fi162 fi
163 exit 0163 exit 0
164 }164 }
165 while ! is_started; do165 while ! is_started; do
166 echo "Waiting for special message in log files "166 echo "Waiting for special message in log files "
167 sleep 30s167 sleep 30s
168 counter=$(( $counter - 1 ))168 counter=$(( $counter - 1 ))
169 echo "Counter: $counter"169 echo "Counter: $counter"
170 if [ "$counter" -gt "0" ]; then170 if [ "$counter" -gt "0" ]; then
171 continue171 continue
172 else172 else
173 break173 break
174 fi174 fi
175 done175 done
176 echo "Halting script"176 echo "Halting script"
177 exit 1177 exit 0
178 shell: bash178 shell: bash
179179
180 - name: Collect Docker Logs180 - name: Collect Docker Logs