74
74
- name : Push Enterprise Image to Harbor
75
75
run : |
76
76
docker tag processmaker/enterprise:${{env.IMAGE_TAG}} ${{ secrets.REGISTRY_HOST }}/processmaker/enterprise:${{env.IMAGE_TAG}}
77
- docker push ${{ secrets.REGISTRY_HOST }}/processmaker/enterprise:${{env.IMAGE_TAG}}
78
- prepareDB :
79
- needs : imageEKS
80
- runs-on : self-hosted
81
- steps :
82
- - name : Clone private repository
83
- run : |
84
- git clone --depth 1 -b eng "https://$GITHUB_TOKEN@github.com/ProcessMaker/argocd.git" argocd
85
- - name : CreateDB
86
- run : |
87
- cd argocd
88
- deploy=$(echo -n ${{env.IMAGE_TAG}} | md5sum | head -c 10)
89
- sed -i "s/{{instance}}/ci-$deploy/" template-db.yaml
90
- kubectl get namespace ci-processmaker-ns-pm4
91
- namespace=$(kubectl get namespace $deploy-ns-pm4|grep $deploy|awk '{print $1}')
92
- kubectl apply -f template-db.yaml
77
+ docker push ${{ secrets.REGISTRY_HOST }}/processmaker/enterprise:${{env.IMAGE_TAG}}
93
78
deployEKS :
94
79
name : build-deploy-EKS
95
80
if : contains(github.event.pull_request.body, 'ci:deploy')
@@ -126,11 +111,15 @@ jobs:
126
111
echo "NAMESPACE : ci-$deploy-ns-pm4"
127
112
helm repo add processmaker ${{ secrets.HELM_REPO }} --username ${{ secrets.HELM_USERNAME }} --password ${{ secrets.HELM_PASSWORD }} && helm repo update
128
113
if ! kubectl get namespace/ci-$deploy-ns-pm4 ; then
114
+ echo "Creating DB"
115
+ sed -i "s/{{instance}}/ci-$deploy/" template-db.yaml
116
+ kubectl apply -f template-db.yaml
129
117
echo "Creating Deploy :: $deploy"
130
118
sed -i "s/{{instance}}/ci-$deploy/" template-instance.yaml
131
119
sed -i "s/{{image}}/${{env.IMAGE_TAG}}/" template-instance.yaml
132
120
cat template-instance.yaml
133
121
helm install --timeout 40m -f template-instance.yaml ci-$deploy processmaker/enterprise
122
+ #Add cert
134
123
sed -i "s/{{instance}}/ci-$deploy/" template-cert.yaml
135
124
sed -i "s/{{tls-crt}}/${{ secrets.TLS_CRT }}/" template-cert.yaml
136
125
sed -i "s/{{tls-key}}/${{ secrets.TLS_KEY }}/" template-cert.yaml
@@ -157,9 +146,13 @@ jobs:
157
146
- name : Delete instance EKS
158
147
run : |
159
148
deploy=$(echo -n $IMAGE_TAG | md5sum | head -c 10)
160
- echo "Deleting Instace :: ci-$deploy"
161
- helm delete ci-$deploy
162
- kubectl delete namespace ci-$deploy-ns-pm4
149
+ if kubectl get namespace/ci-$deploy-ns-pm4 ; then
150
+ echo "Deleting Instace :: ci-$deploy"
151
+ helm delete ci-$deploy
152
+ kubectl delete namespace ci-$deploy-ns-pm4
153
+ else
154
+ echo "The pull request does not have an instance on K8s [https://ci-$deploy.engk8s.processmaker.net] not found!!"
155
+ fi
163
156
runPhpUnit :
164
157
name : run-phpunit
165
158
if : github.event.action != 'closed'
0 commit comments