Skip to content

Commit

Permalink
Moving K8s Staging Rollout To Manifests (#1775)
Browse files Browse the repository at this point in the history
* Moving k8s rollout to manifests

* removing unused variable
  • Loading branch information
ben851 authored Mar 14, 2024
1 parent 247b4ee commit b6de8bf
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ env:
AWS_REGION: ca-central-1
DOCKER_ORG: public.ecr.aws/v6b8u5o6
DOCKER_SLUG: public.ecr.aws/v6b8u5o6/notify-admin
KUBECTL_VERSION: '1.18.0'

permissions:
id-token: write # This is required for requesting the OIDC JWT
Expand All @@ -27,13 +26,6 @@ jobs:
unzip -q awscliv2.zip
sudo ./aws/install --update
aws --version
- name: Install kubectl
run: |
curl -LO https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version --client
mkdir -p $HOME/.kube
- name: Configure credentials to CDS public ECR using OIDC
uses: aws-actions/configure-aws-credentials@master
Expand All @@ -60,19 +52,14 @@ jobs:
run: |
docker push $DOCKER_SLUG:latest && docker push $DOCKER_SLUG:${GITHUB_SHA::7}
- name: Configure credentials to Notify account using OIDC
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: arn:aws:iam::239043911459:role/notification-admin-apply
role-session-name: NotifyAdminGitHubActions
aws-region: "ca-central-1"

- name: Get Kubernetes configuration
run: |
aws eks --region $AWS_REGION update-kubeconfig --name notification-canada-ca-staging-eks-cluster --kubeconfig $HOME/.kube/config
- name: Update image in staging
- name: Rollout in Kubernetes
run: |
kubectl set image deployment.apps/admin admin=$DOCKER_SLUG:${GITHUB_SHA::7} -n=notification-canada-ca --kubeconfig=$HOME/.kube/config
PAYLOAD={\"ref\":\"main\",\"inputs\":{\"docker_sha\":\"${GITHUB_SHA::7}\"}}
curl -L -X POST -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $WORKFLOW_PAT" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/cds-snc/notification-manifests/actions/workflows/admin-rollout-k8s-staging.yaml/dispatches \
-d $PAYLOAD
- name: my-app-install token
id: notify-pr-bot
Expand Down

0 comments on commit b6de8bf

Please sign in to comment.