-
Notifications
You must be signed in to change notification settings - Fork 2
101 lines (94 loc) · 3.42 KB
/
_featurenet-update.yml
File metadata and controls
101 lines (94 loc) · 3.42 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
name: FE - Create
on:
workflow_call:
inputs:
featurenet-name:
description: 'Name of the featurenet'
required: true
type: string
aleph-node-image:
description: "FQDN of aleph-node image"
required: true
type: string
rolling-update-partition:
description: |
Number from 0 to N-1, where N is size of am existing featurenet.
All aleph-node-validator-N with an ordinal N that is great than or equal to the partition
will be updated. If not specified, all nodes will be updated.
required: false
default: '0'
type: string
outputs:
ws-hostname:
description: Hostname of the WS endpoint
value: ${{ jobs.create-featurenet.outputs.ws-hostname }}
jobs:
validate-inputs:
name: Validate inputs
runs-on: ubuntu-24.04
steps:
- name: Validate inputs
shell: bash
# yamllint disable rule:line-length
run: |
if [[ ! '${{ inputs.featurenet-name }}' =~ ^[a-z0-9][a-z0-9\-]{4,48}$ ]]
then
echo '!!! Invalid featurenet name'
exit 1
fi
if [[ ! '${{ inputs.aleph-node-image }}' =~ ^[a-z0-9][a-z0-9\._:/\-]{1,52}$ ]]; then
echo "!!! Invalid aleph-node image"
exit 1
fi
# yamllint enable rule:line-length
check-vars-and-secrets:
needs: [validate-inputs]
name: Check vars and secrets
uses: ./.github/workflows/_check-vars-and-secrets.yml
secrets: inherit
create-featurenet:
needs: [check-vars-and-secrets]
name: Create featurenet
runs-on: [self-hosted, Linux, X64, small]
outputs:
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
ws-hostname: ${{ steps.create-featurenet.outputs.ws-hostname }}
steps:
- name: Checkout repo
uses: actions/checkout@v5
- name: Start featurenet Deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{ secrets.CI_GH_TOKEN }}
env: ${{ inputs.featurenet-name }}
override: true
debug: true
- name: Update featurenet with image tag
uses: Cardinal-Cryptography/github-actions/update-featurenet@v7
id: create-featurenet
with:
gh-ci-user: ${{ secrets.CI_GH_USER }}
gh-ci-token: ${{ secrets.CI_GH_TOKEN }}
argo-sync-user-token: ${{ secrets.ARGO_SYNC_USER_TOKEN }}
repo-featurenet-template-name: ${{ secrets.REPO_FEATURENET_TEMPLATE_NAME }}
featurenet-name: ${{ inputs.featurenet-name }}
featurenet-aleph-node-image: ${{ inputs.aleph-node-image }}
rolling-update-partition: ${{ inputs.rolling-update-partition }}
git-commit-author: ${{ secrets.AUTOCOMMIT_AUTHOR }}
git-commit-email: ${{ secrets.AUTOCOMMIT_EMAIL }}
wait-for-finalized-heads: "true"
- name: Finish featurenet Deployment
uses: bobheadxi/deployments@v1
if: always()
with:
step: finish
token: ${{ secrets.CI_GH_TOKEN }}
status: ${{ job.status }}
env: ${{ inputs.featurenet-name }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
# yamllint disable-line rule:line-length
env_url: https://dev.azero.dev/?rpc=wss%3A%2F%2F${{ steps.create-featurenet.outputs.ws-hostname }}#/explorer
debug: true