Skip to content

Commit

Permalink
Merge pull request #5966 from shaneknapp/add-hub-parsing-to-deploy
Browse files Browse the repository at this point in the history
[DH-301] testing hubploy
  • Loading branch information
shaneknapp authored Aug 19, 2024
2 parents 0ed3db6 + 7e9f239 commit 55aabc0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 16 deletions.
55 changes: 40 additions & 15 deletions .github/workflows/deploy-to-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,69 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Check out the image repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.

- name: print out labels just for testing
run: echo "${{ steps.pr-labels.outputs.labels }}"
- name: Pull out any hubs that need deploying from the labels on the merge commit to staging
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
echo "Hubs to deploy: $HUBS"
echo "DEPLOY_HUBS=${HUBS[@]}" >> $GITHUB_ENV
- name: Setup python
if: ${{ env.DEPLOY }}
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
if: ${{ env.DEPLOY }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install --force-reinstall git+https://github.com/shaneknapp/hubploy.git@major-refactor
hubploy --help
hubploy deploy --help
- name: Auth to gcloud
if: ${{ env.DEPLOY }}
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GKE_KEY }}
project_id: ${{ secrets.GCP_PROJECT_ID }}

- name: Install Google Cloud SDK
if: ${{ env.DEPLOY }}
uses: google-github-actions/setup-gcloud@v2

- name: gcloud info
run: gcloud info

- name: Install SOPS
if: ${{ env.DEPLOY }}
run: |
mkdir -p ${HOME}/repo/bin
curl -sSL https://github.com/mozilla/sops/releases/download/v3.7.0/sops-v3.7.0.linux -o ${HOME}/repo/bin/sops
chmod 755 ${HOME}/repo/bin/sops
echo "${HOME}/repo/bin" >> $GITHUB_PATH
- name: Install Helm
if: ${{ env.DEPLOY }}
run: |
curl -L https://get.helm.sh/helm-v3.13.3-linux-amd64.tar.gz | tar -xzf -
mv linux-amd64/helm /usr/local/bin
helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
helm repo update
- name: Deploy hubs to staging
if: ${{ env.DEPLOY }}
run: |
for hub in $DEPLOY_HUBS[@]; do
echo "Deploying $hub to staging"
hubploy --verbose deploy $hub hub staging
done
2 changes: 1 addition & 1 deletion deployments/logodev/hubploy.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
images:
images:
# temporary update
- name: us-central1-docker.pkg.dev/ucb-datahub-2018/user-images/logodev-user-image:829f9eaececd
- name: us-central1-docker.pkg.dev/ucb-datahub-2018/user-images/logodev-user-image:a9443779a3a9

cluster:
provider: gcloud
Expand Down

0 comments on commit 55aabc0

Please sign in to comment.