Skip to content

Commit

Permalink
Fix comment and vulneravility images
Browse files Browse the repository at this point in the history
  • Loading branch information
mavalosn committed Jan 4, 2024
1 parent d750268 commit 051135b
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/deploy-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
BUILD_BASE: ${{ (contains(github.event.pull_request.body, 'ci:build-base') || github.event_name == 'schedule') && '1' || '0' }}
BASE_IMAGE: ${{ secrets.REGISTRY_HOST }}/processmaker/processmaker:base
K8S_BRANCH: bugfix/FOUR-12410
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand All @@ -44,31 +45,39 @@ jobs:
run: |
# TODO: Change branch when pm4 k8s distribution is released
echo "IMAGE: ${{ env.IMAGE }}"
git clone --depth 1 -b bugfix/FOUR-12410 "https://[email protected]/ProcessMaker/pm4-k8s-distribution.git" pm4-k8s-distribution
git clone --depth 1 -b "$K8S_BRANCH" "https://[email protected]/ProcessMaker/pm4-k8s-distribution.git" pm4-k8s-distribution
- name: Generate image EKS
run: |
cd pm4-k8s-distribution/images
branch=$CI_PACKAGE_BRANCH tag=${{env.IMAGE_TAG}} bash build.k8s-cicd.sh
- name: List Images
run: |
docker images
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: processmaker/enterprise:${{env.IMAGE_TAG}}
format: 'table'
exit-code: '0'
ignore-unfixed: false
vuln-type: 'os,library'
scanners: 'vuln,secret'
severity: 'MEDIUM,HIGH,CRITICAL'
env:
TRIVY_TIMEOUT: 30m
- name: Login to Harbor
uses: docker/login-action@v2
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Push Enterprise Image to Harbor
run: |
#if [[ "$BUILD_BASE" == "1" ]]; then
# docker push ${{ env.BASE_IMAGE }}
#fi
#docker push ${{ env.IMAGE }}
run: |
docker tag processmaker/enterprise:${{env.IMAGE_TAG}} ${{ secrets.REGISTRY_HOST }}/processmaker/enterprise:${{env.IMAGE_TAG}}
docker push ${{ secrets.REGISTRY_HOST }}/processmaker/enterprise:${{env.IMAGE_TAG}}
deployEKS:
name: build-deploy-EKS
#if: contains(github.event.pull_request.body, 'ci:deploy')
if: contains(github.event.pull_request.body, 'ci:deploy')
needs: imageEKS
runs-on: self-hosted
steps:
Expand All @@ -83,6 +92,12 @@ jobs:
kubectl get namespace ci-processmaker-ns-pm4
namespace=$(kubectl get namespace $deploy-ns-pm4|grep $deploy|awk '{print $1}')
kubectl apply -f template-db.yaml
- name: Install pm4-tools
run: |
git clone --depth 1 -b "$K8S_BRANCH" "https://[email protected]/ProcessMaker/pm4-k8s-distribution.git" pm4-k8s-distribution
cd pm4-k8s-distribution/images/pm4-tools
composer install --no-interaction
cd ..
- name: Deploy instance EKS
run: |
cd argocd
Expand All @@ -103,6 +118,7 @@ jobs:
fi
export INSTANCE_URL=https://ci-$deploy$DOM_EKS
echo "INSTANCE_URL=${INSTANCE_URL}" >> "$GITHUB_ENV"
../pm4-k8s-distribution/images/pm4-tools/pm wait-for-instance-ready
- name: Comment Instance
run: |
echo "Instance URL: '${INSTANCE_URL}'"
Expand Down

0 comments on commit 051135b

Please sign in to comment.