Skip to content

Commit d6a3e61

Browse files
committed
script to deploy 2.1 with redisk disk on staging
1 parent 0cdff2f commit d6a3e61

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

.github/workflows/deploy_staging.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,32 @@ jobs:
3737
id: refvar
3838
env:
3939
GH_REF: ${{ github.event.client_payload.gh_ref }}
40-
run: echo "::set-output name=gitRefName::${GH_REF#refs/*/}"
40+
run: echo "gitRefName=${GH_REF#refs/*/}" >> $GITHUB_OUTPUT
4141

4242
- name: Compute API version
4343
id: apiVersionVar
44-
# if git ref contains '-rc': deploy to latest, otherwise deploy to the major version
45-
# to avoid deploying a mistyped pre-release tag as stable, every version with '-' will go to latest
44+
shell: bash
4645
run: |
4746
export gitRefName="${{ steps.refvar.outputs.gitRefName }}"
48-
if [[ "$gitRefName" == *"-rc"* ]]; then \
49-
echo "::set-output name=apiVersion::latest" ; \
50-
else \
47+
if [[ "$gitRefName" == "main" ]]; then
48+
export apiVersion=latest
49+
else
5150
export tagFirstPart=$(echo "${{ steps.refvar.outputs.gitRefName }}" | cut -d '.' -f1)
52-
if [[ $tagFirstPart == "v*" ]]; then \
53-
echo "::set-output name=apiVersion::${tagFirstPart}" ; \
54-
else \
55-
echo "::set-output name=apiVersion::v${tagFirstPart}" ; \
56-
fi ; \
51+
if [[ $tagFirstPart == "v*" ]]; then
52+
export apiVersion=${tagFirstPart}
53+
else
54+
export apiVersion=v${tagFirstPart}
55+
fi
5756
fi
57+
echo "apiVersion=${apiVersion}" >> $GITHUB_OUTPUT
58+
59+
echo "Hack to get last v2.1 install script if needed"
60+
if [[ "${apiVersion}" == "v2" ]]; then
61+
export apiScriptVersion=v2.1
62+
else
63+
export apiScriptVersion=${apiVersion}
64+
fi
65+
echo "apiScriptVersion=${apiScriptVersion}" >> $GITHUB_OUTPUT
5866
5967
- name: Prepare values.yaml
6068
env:
@@ -117,8 +125,10 @@ jobs:
117125
TLS_CERTIFICATE_TYPE: let_s_encrypt
118126
COSMOTECH_API_DNS_NAME: ${{ secrets.STAGING_ENV_COSMOTECH_API_DNS_NAME }}
119127
TLS_CERTIFICATE_LET_S_ENCRYPT_CONTACT_EMAIL: ${{ secrets.STAGING_ENV_TLS_CERTIFICATE_LET_S_ENCRYPT_CONTACT_EMAIL }}
128+
REDIS_DISK_SIZE: 128
129+
REDIS_DISK_RESOURCE: "/subscriptions/a24b131f-bd0b-42e8-872a-bded9b91ab74/resourceGroups/phoenixstaging/providers/Microsoft.Compute/disks/cosmotech-database-disk"
120130
run: |
121-
curl -o- -sSL https://raw.githubusercontent.com/Cosmo-Tech/azure-platform-deployment-tools/main/deployment_scripts/${{ steps.apiVersionVar.outputs.apiVersion }}/deploy_via_helm.sh | bash -s -- \
131+
curl -o- -sSL https://raw.githubusercontent.com/Cosmo-Tech/azure-platform-deployment-tools/main/deployment_scripts/${{ steps.apiVersionVar.outputs.apiScriptVersion }}/deploy_via_helm.sh | bash -s -- \
122132
"${GH_SHA}" \
123133
"${NAMESPACE}" \
124134
"${ARGO_POSTGRESQL_PASSSORD}" \

0 commit comments

Comments
 (0)