Skip to content

Commit

Permalink
Send new instance K8s
Browse files Browse the repository at this point in the history
  • Loading branch information
mavalosn committed Jan 3, 2024
1 parent 9f2b78c commit 492f2c4
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions .github/workflows/deploy-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,45 +31,45 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
imageEKS:
name: build-docker-image-EKS
if: github.event.action != 'closed'
runs-on: ${{ vars.RUNNER }}
steps:
- name: Set image name
run: |
RESOLVED_IMAGE_TAG=${{ env.IMAGE_TAG }}
echo "IMAGE=${{ secrets.REGISTRY_HOST }}/processmaker/enterprise:$RESOLVED_IMAGE_TAG" >> $GITHUB_ENV
- name: Clone repo K8S
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
- 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: 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 }}
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}}
#imageEKS:
# name: build-docker-image-EKS
# if: github.event.action != 'closed'
# runs-on: ${{ vars.RUNNER }}
# steps:
# - name: Set image name
# run: |
# RESOLVED_IMAGE_TAG=${{ env.IMAGE_TAG }}
# echo "IMAGE=${{ secrets.REGISTRY_HOST }}/processmaker/enterprise:$RESOLVED_IMAGE_TAG" >> $GITHUB_ENV
# - name: Clone repo K8S
# 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
# - 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: 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 }}
# 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')
needs: imageEKS
#needs: imageEKS
runs-on: self-hosted
steps:
- name: Clone private repository
Expand All @@ -94,7 +94,7 @@ 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 repo add processmaker ${{ secrets.HELM_REPO }} --username ${{ secrets.HELM_USERNAME }} --password ${{ secrets.HELM_PASSWORD }} && helm install --timeout 40m -f template-instance.yaml ci-$deploy processmaker/enterprise --version 2.1.0
helm repo add processmaker ${{ secrets.HELM_REPO }} --username ${{ secrets.HELM_USERNAME }} --password ${{ secrets.HELM_PASSWORD }} && helm repo update && helm install --timeout 40m -f template-instance.yaml ci-$deploy processmaker/enterprise --version 2.1.0
else
echo "Bouncing Instance ";
sed -i "s/{{instance}}/ci-$deploy/g" template-bounce.yaml
Expand Down

0 comments on commit 492f2c4

Please sign in to comment.