Skip to content

Commit

Permalink
troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasKoehneckeAA committed Apr 10, 2024
1 parent abf42f5 commit 2b6f700
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/artifactory.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Blueprint for Github Actions Usage (Push to PyPi Repository)
name: Artifactory Deployment of PyPi and trace-viewer

on:
push: {}

env:
ARTIFACTORY_URL: https://alephalpha.jfrog.io
ARTIFACTORY_PYPI_REPOSITORY: "intelligence-layer"
ARTIFACTORY_DOCKER_REGISTRY: https://alephalpha.jfrog.io/intelligence-layer
ARTIFACTORY_DOCKER_REGISTRY: alephalpha.jfrog.io/intelligence-layer-images

jobs:
push-to:
Expand All @@ -24,14 +24,22 @@ jobs:
env:
ID_TOKEN: ${{ env.ID_TOKEN }}
run: |
echo $ID_TOKEN
JFROG_ACCESS_TOKEN=$(curl \
-X POST \
-H "Content-type: application/json" \
$ARTIFACTORY_URL/access/api/v1/oidc/token \
-d \
"{\"grant_type\": \"urn:ietf:params:oauth:grant-type:token-exchange\", \"subject_token_type\":\"urn:ietf:params:oauth:token-type:id_token\", \"subject_token\": \"$ID_TOKEN\", \"provider_name\": \"github\"}" \
| jq .access_token -r)
echo $(curl \
-X POST \
-H "Content-type: application/json" \
$ARTIFACTORY_URL/access/api/v1/oidc/token \
-d \
"{\"grant_type\": \"urn:ietf:params:oauth:grant-type:token-exchange\", \"subject_token_type\":\"urn:ietf:params:oauth:token-type:id_token\", \"subject_token\": \"$ID_TOKEN\", \"provider_name\": \"github\"}")
echo "JFROG_ACCESS_TOKEN=${JFROG_ACCESS_TOKEN}" >> $GITHUB_ENV
echo $JFROG_ACCESS_TOKEN
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-python@v5
Expand All @@ -50,7 +58,9 @@ jobs:
poetry build
poetry config repositories.artifactory $ARTIFACTORY_URL/artifactory/api/pypi/$ARTIFACTORY_PYPI_REPOSITORY
JFROG_ACCESS_TOKEN_SUBJECT=$(echo $JFROG_ACCESS_TOKEN | awk -F'.' '{print $2}' | sed 's/.\{1,3\}$/&==/' | base64 -d | jq '.sub' -r)
poetry config http-basic.blueprint-python "$JFROG_ACCESS_TOKEN_SUBJECT" "$JFROG_ACCESS_TOKEN"
echo $JFROG_ACCESS_TOKEN
echo $JFROG_ACCESS_TOKEN_SUBJECT
poetry config http-basic.artifactory "$JFROG_ACCESS_TOKEN_SUBJECT" "$JFROG_ACCESS_TOKEN"
poetry publish -r artifactory
build-and-push-image:
Expand Down

0 comments on commit 2b6f700

Please sign in to comment.