Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
EliMoshkovich committed Mar 19, 2024
1 parent 6886964 commit 42eea5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 29 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/pdp_cicd.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and Push PDP Docker Image
on: push
# release:
# types: [published]
on:
release:
types: [published]
jobs:
build-and-push-pdp-vanilla:
runs-on: ubuntu-latest
Expand All @@ -22,27 +22,24 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Pre build - for PDP-Vanilla
run: |
#echo "${{ github.event.release.tag_name }}" | cut -d '-' -f 1 > permit_pdp_version
echo "0.2.38" > permit_pdp_version
run: echo "${{ github.event.release.tag_name }}" | cut -d '-' -f 1 > permit_pdp_version

- name: Build and push PDP-Vanilla - (official release)
if: "!github.event.release.prerelease"
uses: docker/build-push-action@v5
with:
push: false
push: true
context: .
platforms: linux/amd64,linux/arm64
#tags: permitio/pdp-v2-vanilla:${{ github.event.release.tag_name }}, permitio/pdp-v2-vanilla:latest
tags: permitio/pdp-v2-vanilla:latest
tags: permitio/pdp-v2-vanilla:${{ github.event.release.tag_name }}, permitio/pdp-v2-vanilla:latest
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: false
push: true
context: .
platforms: linux/amd64,linux/arm64
tags: permitio/pdp-v2-vanilla:${{ github.event.release.tag_name }}
Expand Down Expand Up @@ -76,8 +73,7 @@ jobs:

- name: Pre build PDP
run: |
#echo "${{ github.event.release.tag_name }}" | cut -d '-' -f 1 > permit_pdp_version
echo "0.2.38" > permit_pdp_version
echo "${{ github.event.release.tag_name }}" | cut -d '-' -f 1 > permit_pdp_version
rm -rf custom
mkdir custom
find * -name '*go*' -print0 | xargs -0 tar -czf ./custom/custom_opa.tar.gz --exclude '.*'
Expand All @@ -87,7 +83,7 @@ jobs:
if: "github.event.release.prerelease"
uses: docker/build-push-action@v5
with:
push: false
push: true
context: .
platforms: linux/amd64,linux/arm64
tags: permitio/pdp-v2:${{ github.event.release.tag_name }}
Expand All @@ -98,11 +94,10 @@ jobs:
if: "!github.event.release.prerelease"
uses: docker/build-push-action@v5
with:
push: false
push: true
context: .
platforms: linux/amd64,linux/arm64
#tags: permitio/pdp-v2:${{ github.event.release.tag_name }},permitio/pdp-v2:latest
tags: permitio/pdp-v2:latest
tags: permitio/pdp-v2:${{ github.event.release.tag_name }},permitio/pdp-v2:latest
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down
13 changes: 0 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ WORKDIR /app/
COPY requirements.txt requirements.txt
RUN pip install --upgrade pip && pip install setuptools -U && pip install --user -r requirements.txt

# # Install a custom OPAL, if requested
# COPY ./permit-opa/custom /custom

# RUN if [ -f /custom/custom_opal.tar.gz ]; \
# then \
# cd /custom && \
# tar xzf custom_opal.tar.gz && \
# pip install --user packages/opal-common packages/opal-client && \
# cd / && \
# rm -rf /custom ; \
# fi

COPY horizon setup.py MANIFEST.in ./
RUN python setup.py install --user

Expand All @@ -35,7 +23,6 @@ RUN if [ -d ./permit-opa/custom ]; then \
else \
echo "Source directory does not exist. Skipping."; \
fi
#COPY ./permit-opa/custom /custom

RUN if [ -f /custom/custom_opa.tar.gz ]; \
then \
Expand Down

0 comments on commit 42eea5f

Please sign in to comment.