Skip to content

Commit

Permalink
check2
Browse files Browse the repository at this point in the history
  • Loading branch information
EliMoshkovich committed Mar 28, 2024
1 parent fb6e445 commit c8b0cea
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
47 changes: 32 additions & 15 deletions .github/workflows/pdp_cicd.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -30,21 +30,25 @@ 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

- name: Build and push PDP-Vanilla 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-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

Expand Down Expand Up @@ -79,26 +83,39 @@ 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

- name: Build and push PDP image - (official 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 }},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
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c8b0cea

Please sign in to comment.