Skip to content

Commit

Permalink
fix: allow a dynamic IP_FLAG
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavovalverde committed Oct 16, 2024
1 parent b812f61 commit e10bdb2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/cd-deploy-nodes-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,14 @@ jobs:
- name: Create instance template for ${{ matrix.network }}
run: |
if [ -n "${{ env.IP_ADDRESS }}" ]; then
IP_FLAG="--address=${{ env.IP_ADDRESS }} \"
IP_FLAG="--address=${{ env.IP_ADDRESS }}"
else
IP_FLAG=""
fi
DISK_NAME="zebrad-cache-${{ env.GITHUB_HEAD_REF_SLUG_URL || env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }}-${NETWORK}"
DISK_PARAMS="name=${DISK_NAME},device-name=${DISK_NAME},size=400GB,type=pd-ssd"
if [ -n "${{ env.CACHED_DISK_NAME }}" ]; then
DISK_PARAMS+=",image=${{ env.CACHED_DISK_NAME }}"
elif [ ${{ inputs.no_cached_disk && github.event_name == 'workflow_dispatch' }} ]; then
Expand All @@ -313,14 +317,15 @@ jobs:
echo "No cached disk found for ${{ matrix.network }} in main branch"
exit 1
fi
gcloud compute instance-templates create-with-container zebrad-${{ needs.versioning.outputs.major_version || env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }}-${NETWORK} \
--machine-type ${{ vars.GCP_SMALL_MACHINE }} \
--boot-disk-size 50GB \
--boot-disk-type=pd-ssd \
--image-project=cos-cloud \
--image-family=cos-stable \
--network-interface=subnet=${{ vars.GCP_SUBNETWORK }} \
${IP_FLAG}
${IP_FLAG} \
--create-disk="${DISK_PARAMS}" \
--container-mount-disk=mount-path='/var/cache/zebrad-cache',name=${DISK_NAME},mode=rw \
--container-stdin \
Expand Down

0 comments on commit e10bdb2

Please sign in to comment.