Skip to content

Commit

Permalink
Get conda-store token from login
Browse files Browse the repository at this point in the history
  • Loading branch information
soapy1 committed Jan 27, 2025
1 parent 0102e7c commit d5f3827
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/test_local_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,17 @@ jobs:
# install conda-store-server
python -m pip install conda-store/conda-store-server
- name: Get conda-store token from terraform state
- name: Get conda-store token
id: conda-store-token
env:
KEYCLOAK_USERNAME: ${{ env.TEST_USERNAME }}
KEYCLOAK_PASSWORD: ${{ env.TEST_PASSWORD }}
CONDA_STORE_BASE_URL: https://${{ steps.init.outputs.domain }}
working-directory: ${{ steps.init.outputs.directory }}
run: |
kubectl get secret -n default tfstate-default-${{ steps.init.outputs.project }}-dev-07-kubernetes-services --template={{.data}} | cut -d ":" -f2 | cut -d "]" -f1 | base64 --decode | gzip -d --to-stdout > terraform_state
echo "CONDA_STORE_TOKEN=$(cat terraform_state | jq | grep conda-store-service-account | sed -n '2 p' | tr -s ' ' | sed "s/\"config.json\": \"//" | sed -e 's/\\\"/\"/g' -e 's/^.//g' -e 's/.$//g' | jq --raw-output '."service-tokens-mapping"."conda-store-service-account"')" | tee --append "${GITHUB_OUTPUT}"
LOGIN_URL=$(curl -c /tmp/nebari-session --insecure -Ls ${CONDA_STORE_BASE_URL}/conda-store/login/\?next= | grep auth/realms/nebari/login-actions/authenticate | grep -oP 'action="([^"]+)"')
curl -X POST --insecure -b /tmp/nebari-session -H "Content-Type: application/x-www-form-urlencoded" -vv --data '{"credentialId":"", "username": "${KEYCLOAK_USERNAME}", "password": "${KEYCLOAK_PASSWORD}"}' $LOGIN_URL
echo "CONDA_STORE_TOKEN=$(curl --insecure -L -X POST -b /tmp/conda-store-cookie ${CONDA_STORE_BASE_URL}/conda-store/api/v1/token | jq --raw-output .data.token)" >> "$GITHUB_OUTPUT"
- name: Run conda-store-server user_journey tests
env:
Expand Down

0 comments on commit d5f3827

Please sign in to comment.