-
Notifications
You must be signed in to change notification settings - Fork 11
155 lines (125 loc) · 7.75 KB
/
testnet-deploy-to-vms.yaml
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
name: Testnet - Deploy three validators network
on:
repository_dispatch:
types: [trigger-testnet-image-release]
env:
refresh_containers_command: docker-compose stop && docker-compose rm -f && docker-compose pull && docker-compose up -d db validator
refresh_metrics_containers_command: docker-compose stop && docker-compose rm -f && docker-compose pull && docker-compose up -d
copy_logs_command: docker logs runner_validator_1 > logs-$(date +'%d-%m-%Y_%H:%M:%S').log
jobs:
deploy_testnet_alice:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
service_account_key: ${{ secrets.GCP_CE_KEY }}
- name: Export docker .env
shell: bash
run: |
echo 'TAG=${{ github.event.client_payload.tag }}' > .env && \
echo '${{ secrets.ENV_TESTNET }}' >> .env
- name: Export application config
shell: bash
run: |
echo '${{ secrets.APP_TESTNET_ALICE_CONFIG }}' > ./node.yml && \
echo '${{ secrets.APP_TESTNET_BRIDGE_CONFIG }}' > ./bridge.yml
- name: Copy files
run: |
gcloud compute scp --zone=${{ secrets.APP_TESTNET_ALICE_ZONE }} ./.env ./docker-compose.yml ./node.yml ./bridge.yml ${{ secrets.APP_TESTNET_ALICE_INSTANCE }}:~ && \
gcloud compute scp --zone=${{ secrets.APP_TESTNET_ALICE_ZONE }} ./monitoring/grafana/config-overrides.env ${{ secrets.APP_TESTNET_ALICE_INSTANCE }}:~/monitoring/grafana
- name: Copy logs
run: gcloud compute ssh ${{ secrets.APP_TESTNET_ALICE_INSTANCE }} --zone=${{ secrets.APP_TESTNET_ALICE_ZONE }} --command="${{ env.copy_logs_command }}"
- name: Refresh images and containers
run: gcloud compute ssh ${{ secrets.APP_TESTNET_ALICE_INSTANCE }} --zone=${{ secrets.APP_TESTNET_ALICE_ZONE }} --command="${{ env.refresh_containers_command }}"
deploy_testnet_bob:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
service_account_key: ${{ secrets.GCP_CE_KEY }}
- name: Export docker .env
shell: bash
run: |
echo 'TAG=${{ github.event.client_payload.tag }}' > .env && \
echo '${{ secrets.ENV_TESTNET }}' >> .env
- name: Export application config
shell: bash
run: |
echo '${{ secrets.APP_TESTNET_BOB_CONFIG }}' > ./node.yml && \
echo '${{ secrets.APP_TESTNET_BRIDGE_CONFIG }}' > ./bridge.yml
- name: Copy files
run: |
gcloud compute scp --zone=${{ secrets.APP_TESTNET_BOB_ZONE }} ./.env ./docker-compose.yml ./node.yml ./bridge.yml ${{ secrets.APP_TESTNET_BOB_INSTANCE }}:~ && \
gcloud compute scp --zone=${{ secrets.APP_TESTNET_BOB_ZONE }} ./monitoring/grafana/config-overrides.env ${{ secrets.APP_TESTNET_BOB_INSTANCE }}:~/monitoring/grafana
- name: Copy logs
run: gcloud compute ssh ${{ secrets.APP_TESTNET_BOB_INSTANCE }} --zone=${{ secrets.APP_TESTNET_BOB_ZONE }} --command="${{ env.copy_logs_command }}"
- name: Refresh images and containers
run: gcloud compute ssh ${{ secrets.APP_TESTNET_BOB_INSTANCE }} --zone=${{ secrets.APP_TESTNET_BOB_ZONE }} --command="${{ env.refresh_containers_command }}"
deploy_testnet_carol:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
service_account_key: ${{ secrets.GCP_CE_KEY }}
- name: Export docker .env
shell: bash
run: |
echo 'TAG=${{ github.event.client_payload.tag }}' > .env && \
echo '${{ secrets.ENV_TESTNET }}' >> .env
- name: Export application config
shell: bash
run: |
echo '${{ secrets.APP_TESTNET_CAROL_CONFIG }}' > ./node.yml && \
echo '${{ secrets.APP_TESTNET_BRIDGE_CONFIG }}' > ./bridge.yml
- name: Copy files
run: |
gcloud compute scp --zone=${{ secrets.APP_TESTNET_CAROL_ZONE }} ./.env ./docker-compose.yml ./node.yml ./bridge.yml ${{ secrets.APP_TESTNET_CAROL_INSTANCE }}:~ && \
gcloud compute scp --zone=${{ secrets.APP_TESTNET_CAROL_ZONE }} ./monitoring/grafana/config-overrides.env ${{ secrets.APP_TESTNET_CAROL_INSTANCE }}:~/monitoring/grafana
- name: Copy logs
run: gcloud compute ssh ${{ secrets.APP_TESTNET_CAROL_INSTANCE }} --zone=${{ secrets.APP_TESTNET_CAROL_ZONE }} --command="${{ env.copy_logs_command }}"
- name: Refresh images and containers
run: gcloud compute ssh ${{ secrets.APP_TESTNET_CAROL_INSTANCE }} --zone=${{ secrets.APP_TESTNET_CAROL_ZONE }} --command="${{ env.refresh_containers_command }}"
deploy_testnet_dave:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
service_account_key: ${{ secrets.GCP_CE_KEY }}
- name: Export docker .env
shell: bash
run: |
echo 'TAG=${{ github.event.client_payload.tag }}' > .env && \
echo '${{ secrets.ENV_TESTNET }}' >> .env
- name: Export application config
shell: bash
run: |
echo '${{ secrets.APP_TESTNET_DAVE_CONFIG }}' > ./node.yml && \
echo '${{ secrets.APP_TESTNET_BRIDGE_CONFIG }}' > ./bridge.yml && \
echo '${{ secrets.APP_TESTNET_ALERT_CONFIG }}' > ./monitoring/alertmanager/config.yml && \
echo '${{ secrets.APP_TESTNET_GRAFANA_CONFIG_ENV }}' > ./monitoring/grafana/config-overrides.env && \
echo '${{ secrets.APP_TESTNET_PROMETHEUS_CONFIG }}' > ./monitoring/prometheus/prometheus.yml && \
echo '${{ secrets.APP_TESTNET_PROMETHEUS_RULES_CONFIG }}' > ./monitoring/prometheus/rules.yml
- name: Copy files
run: |
gcloud compute scp --zone=${{ secrets.APP_TESTNET_DAVE_ZONE }} ./.env ./docker-compose.yml ./node.yml ./bridge.yml ${{ secrets.APP_TESTNET_DAVE_INSTANCE }}:~ && \
gcloud compute scp --zone=${{ secrets.APP_TESTNET_DAVE_ZONE }} ./monitoring/alertmanager/config.yml ./monitoring/alertmanager/email.html ${{ secrets.APP_TESTNET_DAVE_INSTANCE }}:~/monitoring/alertmanager && \
gcloud compute scp --zone=${{ secrets.APP_TESTNET_DAVE_ZONE }} ./monitoring/grafana/config-overrides.env ${{ secrets.APP_TESTNET_DAVE_INSTANCE }}:~/monitoring/grafana && \
gcloud compute scp --zone=${{ secrets.APP_TESTNET_DAVE_ZONE }} ./monitoring/grafana/provisioning/dashboards/dashboards_provider.yml ./monitoring/grafana/provisioning/dashboards/validator_transfers_dashboard.json ${{ secrets.APP_TESTNET_DAVE_INSTANCE }}:~/monitoring/grafana/provisioning/dashboards && \
gcloud compute scp --zone=${{ secrets.APP_TESTNET_DAVE_ZONE }} ./monitoring/grafana/provisioning/datasources/datasources.yml ${{ secrets.APP_TESTNET_DAVE_INSTANCE }}:~/monitoring/grafana/provisioning/datasources && \
gcloud compute scp --zone=${{ secrets.APP_TESTNET_DAVE_ZONE }} ./monitoring/prometheus/prometheus.yml ./monitoring/prometheus/rules.yml ${{ secrets.APP_TESTNET_DAVE_INSTANCE }}:~/monitoring/prometheus
- name: Copy logs
run: gcloud compute ssh ${{ secrets.APP_TESTNET_DAVE_INSTANCE }} --zone=${{ secrets.APP_TESTNET_DAVE_ZONE }} --command="${{ env.copy_logs_command }}"
- name: Refresh images and containers
run: gcloud compute ssh ${{ secrets.APP_TESTNET_DAVE_INSTANCE }} --zone=${{ secrets.APP_TESTNET_DAVE_ZONE }} --command="${{ env.refresh_metrics_containers_command }}"