-
Notifications
You must be signed in to change notification settings - Fork 129
81 lines (77 loc) · 2.78 KB
/
Copy pathdocker.yml
File metadata and controls
81 lines (77 loc) · 2.78 KB
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
---
# yamllint disable rule:line-length
name: publish calamari parachain container
# yamllint disable-line rule:truthy
on:
release:
types:
- published
jobs:
docker-hub-deploy:
runs-on: ubuntu-20.04
strategy:
matrix:
runtime:
-
name: calamari
-
name: manta
steps:
-
uses: docker/setup-buildx-action@v1
-
uses: docker/login-action@v1
with:
username: ${{ secrets.MANTABOT_DOCKER_USERNAME }}
password: ${{ secrets.MANTABOT_DOCKER_TOKEN }}
-
uses: docker/build-push-action@v2
with:
push: true
file: docker/${{ matrix.runtime.name }}.Dockerfile
tags: |
mantanetwork/${{ matrix.runtime.name }}:latest
mantanetwork/${{ matrix.runtime.name }}:${{ github.event.release.tag_name }}
build-args: |
PARA_BINARY_REF=${{ github.event.release.tag_name }}
check-docker-hub-deploy:
needs: docker-hub-deploy
runs-on: ubuntu-20.04
strategy:
matrix:
runtime:
-
name: calamari
# -
# name: manta
steps:
-
name: run docker image
run: |
sudo docker run -d mantanetwork/${{ matrix.runtime.name }}:latest > docker_id.log
sleep 30
-
name: check syncing
run: |
echo "Get the docker container ID:"
image_id=`cat docker_id.log`
echo $image_id
echo "Adjusting permissions so we can access docker logs..."
sudo chmod -R +x /var/lib/docker/
sudo cat /var/lib/docker/containers/${image_id}/${image_id}-json.log > docker_output.log
cat docker_output.log
echo "Parsing the first best blocks emitted from the relaychain and parachain..."
grep 'best: #.*' docker_output.log | head -n 2 | while read -r line; do words=($line); echo ${words[9]:1} >> relay_output.txt; done
echo "Fail if there is no result..."
if [ ! -f relay_output.txt ]; then echo "No sync output detected"; exit 1; fi
cat relay_output.txt
echo "Fail if any one of the blocks is equal to zero or is not a number..."
nums=( $(cat relay_output.txt) )
if [ ${nums[0]} == 0 ]; then echo "Relay sync not detected. Best block is #0"; exit 1; fi
re1='^[0-9]+$'
if ! [[ ${nums[0]} =~ $re1 ]] ; then echo "Relay sync not detected. Best block is not a number."; exit 1; fi
if [ ${nums[1]} == 0 ]; then echo "Para sync not detected. Best block is #0."; exit 1; fi
re2='^[0-9]+$'
if ! [[ ${nums[1]} =~ $re2 ]] ; then echo "Para sync not detected. Best block is not a number."; exit 1; fi
echo "All good!"
# yamllint enable rule:line-length