Skip to content

Four 13153 FIX CICD #6043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 32 additions & 9 deletions .github/workflows/deploy-pm4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,10 @@ jobs:
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')
prepareDB:
needs: imageEKS
runs-on: self-hosted
steps:
steps:
- name: Clone private repository
run: |
git clone --depth 1 -b eng "https://$GITHUB_TOKEN@github.com/ProcessMaker/argocd.git" argocd
Expand All @@ -91,13 +89,35 @@ jobs:
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
kubectl apply -f template-db.yaml
deployEKS:
name: build-deploy-EKS
if: contains(github.event.pull_request.body, 'ci:deploy')
needs: imageEKS
runs-on: ${{ vars.RUNNER }}
steps:
- name: Clone private repository
run: |
git clone --depth 1 -b eng "https://$GITHUB_TOKEN@github.com/ProcessMaker/argocd.git" argocd
- name: Install pm4-tools
run: |
git clone --depth 1 -b "$K8S_BRANCH" "https://$GITHUB_TOKEN@github.com/ProcessMaker/pm4-k8s-distribution.git" pm4-k8s-distribution
cd pm4-k8s-distribution/images/pm4-tools
composer install --no-interaction
cd ..
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID1 }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY1 }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Set up kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
- name: Authenticate with Amazon EKS
run: aws eks update-kubeconfig --region us-east-1 --name pm4-eng
- name: Deploy instance EKS
run: |
cd argocd
Expand All @@ -110,7 +130,11 @@ jobs:
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 --version 2.1.0
helm install --timeout 40m -f template-instance.yaml ci-$deploy processmaker/enterprise
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
kubectl apply -f template-cert.yaml
else
echo "Bouncing Instance ";
sed -i "s/{{instance}}/ci-$deploy/g" template-bounce.yaml
Expand All @@ -135,8 +159,7 @@ jobs:
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

kubectl delete namespace ci-$deploy-ns-pm4
runPhpUnit:
name: run-phpunit
if: github.event.action != 'closed'
Expand All @@ -162,4 +185,4 @@ jobs:
docker pull $IMAGE
docker-compose down -v
docker-compose build phpunit
docker-compose run phpunit
docker-compose run phpunit