Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 20 additions & 29 deletions .github/workflows/deploy-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,42 +76,33 @@ jobs:
path: vsp-infra-application-manifests
ref: refs/heads/main

- name: Update vets-api image and version name in Manifest repo for vets-api-parent charts
- name: Update vets-api image and version name in Manifest repo
env:
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}
Comment thread
jweissman marked this conversation as resolved.
ECR_REPOSITORY: dsva/${{inputs.ecr_repository}}
Comment thread
RachalCassity marked this conversation as resolved.
run: |
cd vsp-infra-application-manifests/apps/${{inputs.manifests_directory}}
envs=(dev staging)
for env in ${envs[*]};
do
yq e -i '(."vets-api-parent".image.tag) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api-parent".web.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api-parent".web.dbMigrate.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api-parent".worker.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api-parent".web.envSecrets[] | select(.name=="DD_GIT_COMMIT_SHA").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api-parent".web.dbMigrate.envSecrets[] | select(.name=="DD_GIT_COMMIT_SHA").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api-parent".worker.envSecrets[] | select(.name=="DD_GIT_COMMIT_SHA").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
done
git diff

- name: Update vets-api image and version name in Manifest repo for parent helm
env:
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}
ECR_REPOSITORY: dsva/${{inputs.ecr_repository}}
run: |
cd vsp-infra-application-manifests/apps/${{inputs.manifests_directory}}
envs=(prod sandbox)
for env in ${envs[*]};
do
yq e -i '(."vets-api".image.tag) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api".web.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api".web.dbMigrate.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api".worker.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api".web.envSecrets[] | select(.name=="DD_GIT_COMMIT_SHA").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api".web.dbMigrate.envSecrets[] | select(.name=="DD_GIT_COMMIT_SHA").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."vets-api".worker.envSecrets[] | select(.name=="DD_GIT_COMMIT_SHA").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
for env in dev staging prod sandbox; do
if yq e 'has("vets-api-parent")' $env/values.yaml | grep -q 'true'; then
chart_key="vets-api-parent"
elif yq e 'has("vets-api")' $env/values.yaml | grep -q 'true'; then
chart_key="vets-api"
else
echo "No known chart key found in $env/values.yaml, skipping."
continue
Comment thread
RachalCassity marked this conversation as resolved.
Outdated
fi

echo "$env -> $chart_key"
yq e -i '(."'"$chart_key"'".image.tag) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."'"$chart_key"'".web.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."'"$chart_key"'".web.dbMigrate.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."'"$chart_key"'".worker.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."'"$chart_key"'".web.envSecrets[] | select(.name=="DD_GIT_COMMIT_SHA").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."'"$chart_key"'".web.dbMigrate.envSecrets[] | select(.name=="DD_GIT_COMMIT_SHA").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
yq e -i '(."'"$chart_key"'".worker.envSecrets[] | select(.name=="DD_GIT_COMMIT_SHA").value) |= "${{ inputs.commit_sha }}"' $env/values.yaml
done

git diff

- name: Add and Commit file
Expand Down
Loading