Skip to content

Commit

Permalink
Merge branch 'next' into feature/FOUR-13174
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanpro committed Jan 18, 2024
2 parents 33036ae + f848511 commit c784aa1
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions .github/workflows/deploy-pm4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,7 @@ jobs:
- name: Push Enterprise Image to Harbor
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}}
prepareDB:
needs: imageEKS
runs-on: self-hosted
steps:
- name: Clone private repository
run: |
git clone --depth 1 -b eng "https://[email protected]/ProcessMaker/argocd.git" argocd
- name: CreateDB
run: |
cd argocd
deploy=$(echo -n ${{env.IMAGE_TAG}} | md5sum | head -c 10)
sed -i "s/{{instance}}/ci-$deploy/" template-db.yaml
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
docker push ${{ secrets.REGISTRY_HOST }}/processmaker/enterprise:${{env.IMAGE_TAG}}
deployEKS:
name: build-deploy-EKS
if: contains(github.event.pull_request.body, 'ci:deploy')
Expand Down Expand Up @@ -126,11 +111,15 @@ jobs:
echo "NAMESPACE : ci-$deploy-ns-pm4"
helm repo add processmaker ${{ secrets.HELM_REPO }} --username ${{ secrets.HELM_USERNAME }} --password ${{ secrets.HELM_PASSWORD }} && helm repo update
if ! kubectl get namespace/ci-$deploy-ns-pm4 ; then
echo "Creating DB"
sed -i "s/{{instance}}/ci-$deploy/" template-db.yaml
kubectl apply -f template-db.yaml
echo "Creating Deploy :: $deploy"
sed -i "s/{{instance}}/ci-$deploy/" template-instance.yaml
sed -i "s/{{image}}/${{env.IMAGE_TAG}}/" template-instance.yaml
cat template-instance.yaml
helm install --timeout 40m -f template-instance.yaml ci-$deploy processmaker/enterprise
#Add cert
sed -i "s/{{instance}}/ci-$deploy/" template-cert.yaml
sed -i "s/{{tls-crt}}/${{ secrets.TLS_CRT }}/" template-cert.yaml
sed -i "s/{{tls-key}}/${{ secrets.TLS_KEY }}/" template-cert.yaml
Expand All @@ -157,9 +146,13 @@ jobs:
- name: Delete instance EKS
run: |
deploy=$(echo -n $IMAGE_TAG | md5sum | head -c 10)
echo "Deleting Instace :: ci-$deploy"
helm delete ci-$deploy
kubectl delete namespace ci-$deploy-ns-pm4
if kubectl get namespace/ci-$deploy-ns-pm4 ; then
echo "Deleting Instace :: ci-$deploy"
helm delete ci-$deploy
kubectl delete namespace ci-$deploy-ns-pm4
else
echo "The pull request does not have an instance on K8s [https://ci-$deploy.engk8s.processmaker.net] not found!!"
fi
runPhpUnit:
name: run-phpunit
if: github.event.action != 'closed'
Expand Down

0 comments on commit c784aa1

Please sign in to comment.