Skip to content

Commit

Permalink
Testing kubectl in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerldixon committed Nov 22, 2024
1 parent 8c87ab0 commit f74d462
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/actions/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ runs:
tf_vars_file=terraform/aks/config/${{ inputs.environment }}.tfvars.json
terraform_version=$(awk '/{/{f=/^terraform/;next}f' terraform/aks/terraform.tf | grep -o [0-9\.]*)
cluster=$(jq -r '.cluster' ${tf_vars_file})
namespace=$(jq -r '.namespace' ${tf_vars_file})
appenv=$(jq -r '.environment' ${tf_vars_file})
cluster_domain=".${cluster}"
echo "TERRAFORM_VERSION=$terraform_version" >> $GITHUB_ENV
echo "NAMESPACE=$namespace" >> $GITHUB_ENV
case ${{ inputs.environment }} in
review)
Expand Down Expand Up @@ -94,8 +96,24 @@ runs:
HTTPAUTH_PASSWORD: ${{ steps.fetch-secrets.outputs.HTTP_PASSWORD }}
HTTPAUTH_USERNAME: ${{ steps.fetch-secrets.outputs.HTTP_USERNAME }}

- name: Track Page Modifications
- name: Print Deployed Pods
shell: bash
run: |
POD_NAME=$(kubectl get pods -n git-${{ inputs.environment }} -l app=get-into-teaching-${{ inputs.environment }} -o jsonpath='{.items[0].metadata.name}')
kubectl exec -n git-${{ inputs.environment }} $POD_NAME -- bundle exec rails runner "TrackPageModificationsJob.perform_later(host: '${{steps.variables.outputs.healthcheck}}')"
case ${{ inputs.environment }} in
review)
CLUSTER_NAME="s189t01-tsc-test-aks"
RESOURCE_GROUP="s189t01-tsc-ts-rg"
;;
production)
CLUSTER_NAME="s189p01-tsc-production-aks"
RESOURCE_GROUP="s189p01-tsc-pd-rg"
;;
*)
CLUSTER_NAME="s189t01-tsc-test-aks"
RESOURCE_GROUP="s189t01-tsc-ts-rg"
;;
esac
az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --overwrite-existing
kubelogin convert-kubeconfig -l spn
kubectl get pods -n ${{ env.NAMESPACE }}

0 comments on commit f74d462

Please sign in to comment.