Skip to content

Commit

Permalink
Merge pull request #6019 from shaneknapp/fix-hub-deploy-script
Browse files Browse the repository at this point in the history
[DH-301] more tweaking and better logic flow + file rename to something sane
  • Loading branch information
shaneknapp authored Aug 26, 2024
2 parents 522bb9e + ec0286b commit 2e8b390
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
File renamed without changes.
40 changes: 22 additions & 18 deletions .github/workflows/deploy-hubs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,23 @@ jobs:
run: |
echo "PR labels: ${{ steps.pr-labels.outputs.labels }}"
HUBS=()
for label in $(echo -e "${{ steps.pr-labels.outputs.labels }}"); do
if [[ "$label" == hub-* ]]; then
label=$(echo $label | awk -F'-' '{print $2}')
HUBS+="$label"
echo "DEPLOY=1" >> $GITHUB_ENV
fi
done
# If the PR labels "hub-images" or "jupyterhub-deployment" are present, this
# means the base hub image has changed, and all hubs (staging or prod) need to
# be redeployed. This workflow will not run in that case.
# be redeployed. The rest of this job will not run in that case.
if [ -n $GITHUB_PR_LABEL_HUB_IMAGES ] || [ -n $GITHUB_PR_LABEL_JUPYTERHUB_DEPLOYMENT ]; then
echo "Base hub image has changed, not deploying individual hubs to staging"
echo "DEPLOY=0" >> $GITHUB_ENV
else
# deploy any hubs that have been labeled for deployment
for label in $(echo -e "${{ steps.pr-labels.outputs.labels }}"); do
if [[ "$label" == hub-* ]]; then
label=$(echo $label | awk -F'-' '{print $2}')
HUBS+="$label"
echo "DEPLOY=1" >> $GITHUB_ENV
fi
done
echo "DEPLOY_HUBS=${HUBS[@]}" >> $GITHUB_ENV
fi
echo "DEPLOY_HUBS=${HUBS[@]}" >> $GITHUB_ENV
- name: Check out the image repo
if: ${{ env.DEPLOY }}
Expand Down Expand Up @@ -127,21 +129,23 @@ jobs:
run: |
echo "PR labels: ${{ steps.pr-labels.outputs.labels }}"
HUBS=()
for label in $(echo -e "${{ steps.pr-labels.outputs.labels }}"); do
if [[ "$label" == hub-* ]]; then
label=$(echo $label | awk -F'-' '{print $2}')
HUBS+="$label"
echo "DEPLOY=1" >> $GITHUB_ENV
fi
done
# If the PR labels "hub-images" or "jupyterhub-deployment" are present, this
# means the base hub image has changed, and all hubs (staging or prod) need to
# be redeployed. This workflow will not run in that case.
# be redeployed. The rest of this job will not run in that case.
if [ -n $GITHUB_PR_LABEL_HUB_IMAGES ] || [ -n $GITHUB_PR_LABEL_JUPYTERHUB_DEPLOYMENT ]; then
echo "Base hub image has changed, not deploying individual hubs to prod"
echo "DEPLOY=0" >> $GITHUB_ENV
else
# deploy any hubs that have been labeled for deployment
for label in $(echo -e "${{ steps.pr-labels.outputs.labels }}"); do
if [[ "$label" == hub-* ]]; then
label=$(echo $label | awk -F'-' '{print $2}')
HUBS+="$label"
echo "DEPLOY=1" >> $GITHUB_ENV
fi
done
echo "DEPLOY_HUBS=${HUBS[@]}" >> $GITHUB_ENV
fi
echo "DEPLOY_HUBS=${HUBS[@]}" >> $GITHUB_ENV
- name: Setup python
if: ${{ env.DEPLOY }}
Expand Down

0 comments on commit 2e8b390

Please sign in to comment.