From 15dd86b00a62fe492f48658f5f839be2fa738a83 Mon Sep 17 00:00:00 2001 From: shane knapp Date: Fri, 23 Aug 2024 09:48:53 -0700 Subject: [PATCH 1/2] use bash instead of kubectl to get deployments from said directory --- ...abled => deploy-jupyterhub-base-images.yaml} | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) rename .github/workflows/{deploy-jupyterhub-base-images.yaml.disabled => deploy-jupyterhub-base-images.yaml} (87%) diff --git a/.github/workflows/deploy-jupyterhub-base-images.yaml.disabled b/.github/workflows/deploy-jupyterhub-base-images.yaml similarity index 87% rename from .github/workflows/deploy-jupyterhub-base-images.yaml.disabled rename to .github/workflows/deploy-jupyterhub-base-images.yaml index c7650dae7..d40283e11 100644 --- a/.github/workflows/deploy-jupyterhub-base-images.yaml.disabled +++ b/.github/workflows/deploy-jupyterhub-base-images.yaml @@ -58,14 +58,7 @@ jobs: if: ${{ env.DEPLOY }} uses: google-github-actions/setup-gcloud@v2 with: - install_components: 'gke-gcloud-auth-plugin,kubectl' - - - name: Get GKE credentials for the cluster - if: ${{ env.DEPLOY }} - uses: 'google-github-actions/get-gke-credentials@v2' - with: - cluster_name: ${{ secrets.GKE_CLUSTER_NAME }} - location: ${{ secrets.GKE_CLUSTER_LOCATION }} + install_components: 'gke-gcloud-auth-plugin' - name: Install SOPS if: ${{ env.DEPLOY }} @@ -94,7 +87,13 @@ jobs: - name: Deploy base hub images to staging if: ${{ env.DEPLOY }} run: | + ignored_directories=("template") while read deployment; do + for ignored in "${ignored_directories[@]}"; do + if [[ "${deployment}" == "${ignored}" ]]; then + continue 2 # skip to the next "read deployment" + fi + done echo "Pretending to deploy base hub image to ${deployment} :P" echo "hubploy deploy --debug ${deployment} hub staging" - done < <(kubectl get namespaces -A | grep -e staging | awk -F"-" '{print$1}') + done < <(find deployments/ -maxdepth 1 -type d -printf '%f\n' | grep -v template) From 848c3a7e14cb7558c93d19387f21759eb30afa2a Mon Sep 17 00:00:00 2001 From: shane knapp Date: Fri, 23 Aug 2024 09:50:31 -0700 Subject: [PATCH 2/2] make comment more explainy --- .github/workflows/deploy-jupyterhub-base-images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-jupyterhub-base-images.yaml b/.github/workflows/deploy-jupyterhub-base-images.yaml index d40283e11..97bc73f97 100644 --- a/.github/workflows/deploy-jupyterhub-base-images.yaml +++ b/.github/workflows/deploy-jupyterhub-base-images.yaml @@ -91,7 +91,7 @@ jobs: while read deployment; do for ignored in "${ignored_directories[@]}"; do if [[ "${deployment}" == "${ignored}" ]]; then - continue 2 # skip to the next "read deployment" + continue 2 # skip to the next "while read deployment" fi done echo "Pretending to deploy base hub image to ${deployment} :P"