-
Notifications
You must be signed in to change notification settings - Fork 0
247 lines (235 loc) · 9.71 KB
/
artifacts.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
on:
push:
branches:
- main
pull_request:
release:
types: [ created ]
name: Build artifacts
env:
BABYLON_NODECLI_VERSION: 2.1.2
permissions:
id-token: write
pull-requests: write
packages: write
contents: write
jobs:
upload-release:
if: ${{ github.event_name == 'release' }}
name: Upload nginx configuration artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: RDXWorks-actions/checkout@main
- name: Generate artifacts
run: |
bash generate_artifact.sh
- name: Upload Full Node Release Asset
uses: RDXWorks-actions/action-gh-release@master
with:
files: |
babylon-nginx-fullnode-conf.zip
build-push-container-private:
if: github.event_name == 'pull_request'
name: Private
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
# image information
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "private-babylon-nginx"
tags: |
${{ github.head_ref }}
development-latest
# build information
restore_artifact: "false"
context: "."
dockerfile: "./Dockerfile.alpine"
platforms: "linux/amd64,linux/arm64"
# optimizations
cache_tag_suffix: "pr"
scan_image: true
snyk_target_ref: ${{ github.ref_name }}
build-push-container-docker:
name: Dockerhub
if: github.event_name == 'release'
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
# image information
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-nginx"
tags: |
${{ github.event.release.tag_name }}
development-latest
# build information
restore_artifact: "false"
context: "."
dockerfile: "./Dockerfile.alpine"
platforms: "linux/amd64,linux/arm64"
# optimizations
cache_tag_suffix: "release"
enable_dockerhub: "true"
scan_image: true
snyk_target_ref: ${{ github.ref_name }}
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}
test-userflow-docker-core-gateway-same-host:
needs:
- build-push-container-private
runs-on: gh-ephemeral-nodecli-docker-runner
steps:
- name: Checkout
uses: RDXWorks-actions/checkout@main
with:
fetch-depth: 0
- name: "Configure AWS credentials (Private)"
uses: RDXWorks-actions/configure-aws-credentials@main
with:
role-to-assume: arn:aws:iam::${{secrets.SECRETS_ACCOUNT_ID}}:role/gh-common-secrets-read-access
aws-region: eu-west-2
- name: Read secrets from AWS Secrets Manager into environment variables (Private)
uses: RDXWorks-actions/aws-secretsmanager-get-secrets@main
with:
secret-ids: |
DOCKERHUB_PRIVATE, github-actions/common/dockerhub-credentials-read-only
parse-json-secrets: true
- name: Login to Docker Hub (Private)
uses: RDXWorks-actions/login-action@master
with:
username: ${{env.DOCKERHUB_PRIVATE_USERNAME}}
password: ${{env.DOCKERHUB_PRIVATE_TOKEN}}
- name: Download packaged cli
run: |
wget -O babylonnode https://github.com/radixdlt/babylon-nodecli/releases/download/${{env.BABYLON_NODECLI_VERSION}}/babylonnode-ubuntu-22.04
chmod +x babylonnode
- name: Get dependencies
run: |
chmod +x ./babylonnode
sudo apt-get update
sudo apt-get install -y postgresql-client jq docker-compose
./babylonnode docker dependencies
- name: "Execute User Flow: Install Core, Gateway and Monitoring on the same host"
run: |
wget https://raw.githubusercontent.com/radixdlt/babylon-nodecli/main/node-runner-cli/tests/userflows/install-docker-all-same-host.sh -O install-docker-all-same-host.sh
chmod +x ./install-docker-all-same-host.sh
./install-docker-all-same-host.sh
env:
NGINX_ADMIN_PASSWORD: ${{ secrets.RANDOM_TEST_PASSWORD }}
NGINX_METRICS_PASSWORD: ${{ secrets.RANDOM_TEST_PASSWORD }}
NGINX_GATEWAY_PASSWORD: ${{ secrets.RANDOM_TEST_PASSWORD }}
POSTGRES_PASSWORD: ${{ secrets.RANDOM_TEST_PASSWORD }}
KEYSTORE_PASSWORD: ${{ secrets.RANDOM_TEST_PASSWORD }}
SEED_NODE: ${{ vars.SEED_NODE }}
NETWORK_ID: ${{ vars.NETWORK_ID }}
NETWORK_NAME: ${{ vars.NETWORK_NAME }}
NGINX_DOCKER_REPO_OVERRIDE: radixdlt/private-babylon-nginx
RADIXDLT_NGINX_VERSION_OVERRIDE: ${{ github.head_ref }}
NGINX_BINARY_OVERIDE: "https://github.com/radixdlt/babylon-nginx/releases/download/${{ github.event.release.tag_name }}/babylon-nginx-fullnode-conf.zip"
test-userflow-systemd-simple:
runs-on: gh-ephemeral-nodecli-systemd-runner
steps:
- name: Checkout
uses: RDXWorks-actions/checkout@main
with:
fetch-depth: 0
- name: Download packaged cli
run: |
wget -O babylonnode https://github.com/radixdlt/babylon-nodecli/releases/download/${{env.BABYLON_NODECLI_VERSION}}/babylonnode-ubuntu-22.04
chmod +x babylonnode
- name: Get dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq zip
chmod +x ./babylonnode
- name: Serve Files
uses: RDXWorks-actions/http-server-action@master
with:
directory: ${{ github.workspace }}
port: 9999
- name: "Generate artifact"
run: |
echo "generating artifact"
bash generate_artifact.sh
- name: "Execute User Flow: Install Core, Gateway and Monitoring on the same host"
run: |
export DOCKER_COMPOSE_LOCATION="/usr/local/bin/docker-compose"
wget https://raw.githubusercontent.com/radixdlt/babylon-nodecli/main/node-runner-cli/tests/userflows/install-systemd-simple.sh -O install-systemd-simple.sh
chmod +x ./install-systemd-simple.sh
./install-systemd-simple.sh
env:
NGINX_ADMIN_PASSWORD: ${{ secrets.RANDOM_TEST_PASSWORD }}
NGINX_METRICS_PASSWORD: ${{ secrets.RANDOM_TEST_PASSWORD }}
NGINX_GATEWAY_PASSWORD: ${{ secrets.RANDOM_TEST_PASSWORD }}
POSTGRES_PASSWORD: ${{ secrets.RANDOM_TEST_PASSWORD }}
KEYSTORE_PASSWORD: ${{ secrets.RANDOM_TEST_PASSWORD }}
SEED_NODE: ${{ vars.SEED_NODE }}
NETWORK_ID: ${{ vars.NETWORK_ID }}
NETWORK_NAME: ${{ vars.NETWORK_NAME }}
RADIXDLT_NGINX_VERSION_OVERRIDE: ${{ github.head_ref }}
NGINX_BINARY_OVERIDE: http://127.0.0.1:9999/babylon-nginx-fullnode-conf.zip
# NGINX_BINARY_OVERIDE: "https://github.com/radixdlt/babylon-nginx/releases/download/${{ github.event.release.tag_name }}/babylon-nginx-fullnode-conf.zip"
snyk-monitor-devops:
if: always()
runs-on: ubuntu-latest
needs:
- build-push-container-docker
- build-push-container-private
permissions:
id-token: write
pull-requests: read
contents: read
deployments: write
steps:
- if: github.event_name == 'pull_request'
uses: radixdlt/public-iac-resuable-artifacts/snyk-container-monitor@main
with:
role_name: ${{ secrets.AWS_ROLE_NAME_SNYK_SECRET }}
app_name: 'babylon-nginx'
dockerhub_secret_name: ${{ secrets.AWS_SECRET_NAME_DOCKERHUB }}
snyk_secret_name: ${{ secrets.AWS_SECRET_NAME_SNYK }}
snyk_org_id: ${{ secrets.SNYK_DEVOPS_ORG_ID }}
image: docker.io/radixdlt/private-babylon-nginx:${{ needs.build-push-container-private.outputs.default_tag }}
target_ref: ${{ github.ref_name }}
- if: github.event_name == 'release'
uses: radixdlt/public-iac-resuable-artifacts/snyk-container-monitor@main
with:
role_name: ${{ secrets.AWS_ROLE_NAME_SNYK_SECRET }}
app_name: 'babylon-nginx'
dockerhub_secret_name: ${{ secrets.AWS_SECRET_NAME_DOCKERHUB }}
snyk_secret_name: ${{ secrets.AWS_SECRET_NAME_SNYK }}
snyk_org_id: ${{ secrets.SNYK_DEVOPS_ORG_ID }}
image: docker.io/radixdlt/babylon-nginx:${{ needs.build-push-container-docker.outputs.default_tag }}
target_ref: ${{ github.ref_name }}
snyk-monitor-network:
if: always()
runs-on: ubuntu-latest
needs:
- build-push-container-docker
- build-push-container-private
permissions:
id-token: write
pull-requests: read
contents: read
deployments: write
steps:
- if: github.event_name == 'pull_request'
uses: radixdlt/public-iac-resuable-artifacts/snyk-container-monitor@main
with:
role_name: ${{ secrets.AWS_ROLE_NAME_SNYK_SECRET }}
app_name: 'babylon-nginx'
dockerhub_secret_name: ${{ secrets.AWS_SECRET_NAME_DOCKERHUB }}
snyk_secret_name: ${{ secrets.AWS_SECRET_NAME_SNYK }}
snyk_org_id: ${{ secrets.SNYK_NETWORK_ORG_ID }}
image: docker.io/radixdlt/private-babylon-nginx:${{ needs.build-push-container-private.outputs.default_tag }}
target_ref: ${{ github.ref_name }}
- if: github.event_name == 'release'
uses: radixdlt/public-iac-resuable-artifacts/snyk-container-monitor@main
with:
role_name: ${{ secrets.AWS_ROLE_NAME_SNYK_SECRET }}
app_name: 'babylon-nginx'
dockerhub_secret_name: ${{ secrets.AWS_SECRET_NAME_DOCKERHUB }}
snyk_secret_name: ${{ secrets.AWS_SECRET_NAME_SNYK }}
snyk_org_id: ${{ secrets.SNYK_NETWORK_ORG_ID }}
image: docker.io/radixdlt/babylon-nginx:${{ needs.build-push-container-docker.outputs.default_tag }}
target_ref: ${{ github.ref_name }}