diff --git a/.github/workflows/pdp_cicd.yml b/.github/workflows/pdp_cicd.yml index f064047b..a2a9f047 100644 --- a/.github/workflows/pdp_cicd.yml +++ b/.github/workflows/pdp_cicd.yml @@ -1,8 +1,8 @@ name: Build and Push PDP Docker Image -on: - release: - types: [published] +on: push + # release: + # types: [published] jobs: build-and-push-pdp-vanilla: @@ -30,10 +30,12 @@ jobs: if: "!github.event.release.prerelease" uses: docker/build-push-action@v5 with: - push: true + push: false context: . - platforms: linux/amd64,linux/arm64 - tags: permitio/pdp-v2-vanilla:${{ github.event.release.tag_name }}, permitio/pdp-v2-vanilla:latest + #platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 + #tags: permitio/pdp-v2-vanilla:${{ github.event.release.tag_name }}, permitio/pdp-v2-vanilla:latest + tags: permitio/pdp-v2:0.3.0-rc.1 cache-from: type=gha cache-to: type=gha,mode=max @@ -41,10 +43,12 @@ jobs: if: "github.event.release.prerelease" uses: docker/build-push-action@v5 with: - push: true + push: false context: . - platforms: linux/amd64,linux/arm64 - tags: permitio/pdp-v2-vanilla:${{ github.event.release.tag_name }} + #platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 + #tags: permitio/pdp-v2-vanilla:${{ github.event.release.tag_name }} + tags: permitio/pdp-v2:0.3.0-rc.1 cache-from: type=gha cache-to: type=gha,mode=max @@ -79,16 +83,20 @@ jobs: rm -rf custom mkdir custom find * -name '*go*' -print0 | xargs -0 tar -czf ./custom/custom_opa.tar.gz --exclude '.*' + cp ./custom/custom_opa.tar.gz ../sidecar/custom/custom_opa.tar.gz working-directory: ./permit-opa - name: Build and push PDP image - (pre-release) if: "github.event.release.prerelease" uses: docker/build-push-action@v5 with: - push: true + push: false context: . - platforms: linux/amd64,linux/arm64 - tags: permitio/pdp-v2:${{ github.event.release.tag_name }} + #platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 + #tags: permitio/pdp-v2:${{ github.event.release.tag_name }} + tags: permitio/pdp-v2:0.3.0-rc.1 + load: true cache-from: type=gha cache-to: type=gha,mode=max @@ -96,9 +104,18 @@ jobs: if: "!github.event.release.prerelease" uses: docker/build-push-action@v5 with: - push: true + push: false context: . - platforms: linux/amd64,linux/arm64 - tags: permitio/pdp-v2:${{ github.event.release.tag_name }},permitio/pdp-v2:latest + #platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 + #tags: permitio/pdp-v2:${{ github.event.release.tag_name }},permitio/pdp-v2:latest + tags: permitio/pdp-v2:0.3.0-rc.1 + load: true cache-from: type=gha cache-to: type=gha,mode=max + + - name: Install Docker + uses: docker-practice/actions-setup-docker@master + + - name: local PDP runnning + run: docker run -p 7766:7000 --env PDP_API_KEY=PDP_API_KEY=permit_key_kzioMJ5tstHRvlX4jmTHoqdv19oVucZRBnKcMueBX3uLagoOGnw0JIVdFeblId1ZOwgeKdxWzCsIzwOo6xxucL --env PDP_DEBUG=true permitio/pdp-v2:0.3.0-rc.1 diff --git a/Dockerfile b/Dockerfile index c6b886ea..c733636b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,12 +17,7 @@ RUN python setup.py install --user FROM golang:bullseye as OPABuildStage -# Check if the source directory exists before copying -RUN if [ -d ../permit-opa/custom ]; then \ - cp -r ../permit-opa/custom /custom; \ - else \ - echo "Source directory does not exist. Skipping."; \ - fi +COPY custom /custom RUN if [ -f /custom/custom_opa.tar.gz ]; \ then \ diff --git a/requirements.txt b/requirements.txt index 18fc5451..f6061d8f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,5 @@ uvicorn[standard]>=0.17.6,<1 logzio-python-handler ddtrace protobuf>=3.20.2 # not directly required, pinned by Snyk to avoid a vulnerability +opal-common @ git+https://github.com/permitio/opal.git@master#subdirectory=packages/opal-common opal-client @ git+https://github.com/permitio/opal.git@master#subdirectory=packages/opal-client