From af3e36cc3669751de3724b508631e20042551cd0 Mon Sep 17 00:00:00 2001 From: Enol Fernandez Date: Tue, 27 Feb 2024 14:01:37 +0000 Subject: [PATCH] Improve tests --- .github/workflows/deploy.yml | 18 ++++++++++++++++++ .github/workflows/validate.yaml | 10 ---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 729633f8..e6f6a9ec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -130,6 +130,24 @@ jobs: run: | cd deploy terraform output -raw instance-id + - name: Re-configure providers access + env: + MYTOKEN: ${{ secrets.MYTOKEN }} + REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} + run: | + OIDC_TOKEN=$(curl -X POST "https://aai.egi.eu/auth/realms/egi/protocol/openid-connect/token" \ + -d "grant_type=refresh_token&refresh_token=$REFRESH_TOKEN&client_id=token-portal&scope=openid%20email%20profile%20voperson_id%20eduperson_entitlement" \ + | jq -r ".access_token") + echo "::add-mask::$OIDC_TOKEN" + cd deploy + BACKEND_SITE="$(yq -r .clouds.backend.site clouds.yaml)" + BACKEND_VO="$(yq -r .clouds.backend.vo clouds.yaml)" + BACKEND_OS_TOKEN="$(fedcloud openstack token issue --oidc-access-token "$OIDC_TOKEN" \ + --site "$BACKEND_SITE" --vo "$BACKEND_VO" -j | jq -r '.[0].Result.id')" + echo "::add-mask::$BACKEND_OS_TOKEN" + sed -i -e "s/backend_secret/$BACKEND_OS_TOKEN/" clouds.yaml + mkdir -p ~/.config/openstack + touch ~/.config/openstack/secure.yaml - name: Get the status file from swift if: github.ref == 'refs/heads/main' && github.event_name == 'push' uses: nick-fields/retry@v3 diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 76afdbf9..6b6894e0 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -27,13 +27,3 @@ jobs: - name: Validate GOC and VOs run: | ./validate.sh - - name: Check all VOs are in the deployment dir - run: | - for f in sites/*.yaml; do - for vo in $(yq -r ".vos[].name" < "$f"); do - # remove FQAN stuff - # shellcheck disable=SC2001 - vo=$(echo "$vo" | sed 's#/\([^/]*\)/.*#\1#') - grep "$vo" deploy/vos.yaml > /dev/null || (echo "VO $vo not configured" ; exit 1) - done - done