generated from openMF/payment-hub-ee
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PHEE-477] Create an orb that fetches the docker images and do helm u…
…pgrade (#145) * jira story image push * image push * test * PHEE-477 Create an orb that fetches the docker images and do helm upgrade * imported orb * fixed the issue * fixed image push issue * if check for master * test * use orb as job * change in github template
- Loading branch information
1 parent
848b174
commit 608ebd3
Showing
2 changed files
with
44 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ orbs: | |
helm: circleci/[email protected] | ||
aws-eks: circleci/[email protected] | ||
kubernetes: circleci/[email protected] | ||
mifos-orb: mifos/docker-image-availability-check-and-upgrade@dev:first | ||
executors: | ||
docker-executor: | ||
docker: | ||
|
@@ -67,10 +68,17 @@ jobs: | |
- run: | ||
name: Build Docker image | ||
command: | | ||
#Check for PR title Validity | ||
./gradlew checkstyleMain | ||
./gradlew clean bootJar | ||
docker build -t openmf/ph-ee-connector-channel:latest . | ||
docker build -t openmf/$CIRCLE_PR_REPONAME:latest . | ||
if [ "$CIRCLE_BRANCH" != "master" ]; then | ||
PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST) | ||
PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') | ||
JIRA_STORY=$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]') | ||
if [ -z "$JIRA_STORY" ]; then echo "Invalid PR title" && exit 1; else echo "Ticket NO: $JIRA_STORY"; fi | ||
docker image tag openmf/$CIRCLE_PR_REPONAME:latest openmf/$CIRCLE_PR_REPONAME:$JIRA_STORY | ||
fi | ||
# Log in to DockerHub using environment variables | ||
- run: | ||
name: Login to DockerHub | ||
|
@@ -79,9 +87,28 @@ jobs: | |
# Push the Docker image to DockerHub | ||
- run: | ||
name: Push Docker image to DockerHub | ||
command: docker push openmf/ph-ee-connector-channel:latest | ||
|
||
|
||
command: | | ||
if [ "$CIRCLE_BRANCH" = "master" ]; then | ||
docker push openmf/ph-ee-connector-channel:latest | ||
fi | ||
if [ "$CIRCLE_BRANCH" != "master" ]; then | ||
PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST) | ||
PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title') | ||
JIRA_STORY=$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]') | ||
docker push openmf/$CIRCLE_PR_REPONAME:${JIRA_STORY} | ||
fi | ||
docker-image-availability-check-and-upgrade: | ||
docker: | ||
- image: cimg/python:3.10 | ||
steps: | ||
- mifos-orb/docker-image-availability-check-and-upgrade: | ||
namespace: paymenthub | ||
chart: "https://fynarfin.io/images/ph-ee-g2psandbox-fynarfin/ph-ee-g2psandbox-fynarfin-0.2.0.tgz" | ||
release-name: g2p-sandbox | ||
add-repo: "https://fynarfin.io/images/ph-ee-g2psandbox-fynarfin" | ||
cluster-name: "sit" | ||
aws-region: "$REGION" | ||
service-file-path: https://raw.githubusercontent.com/openMF/ph-ee-env-labs/master/.circleci/services.txt | ||
build-and-host-engine: | ||
docker: | ||
- image: cimg/python:3.10 | ||
|
@@ -147,25 +174,6 @@ jobs: | |
- run: scp -o StrictHostKeyChecking=No -i b64encoded.pem index.yaml ph-ee-g2psandbox-fynarfin-0.2.0.tgz [email protected]:~/ | ||
- run: ssh -i b64encoded.pem -o StrictHostKeyChecking=No [email protected] sudo mv -t /apps/apache-tomcat-7.0.82/webapps/ROOT/images/ph-ee-g2psandbox-fynarfin index.yaml ph-ee-g2psandbox-fynarfin-0.2.0.tgz | ||
|
||
upgrade-helm-chart: | ||
docker: | ||
- image: cimg/python:3.10 | ||
parameters: | ||
cluster-name: | ||
description: "sit" | ||
type: string | ||
steps: | ||
- aws-eks/update-kubeconfig-with-authenticator: | ||
cluster-name: "sit" | ||
aws-region: "$REGION" | ||
- helm/upgrade-helm-chart: | ||
chart: "https://fynarfin.io/images/ph-ee-g2psandbox-fynarfin/ph-ee-g2psandbox-fynarfin-0.2.0.tgz" | ||
release-name: g2p-sandbox | ||
namespace: paymenthub | ||
recreate-pods: true | ||
add-repo: "https://fynarfin.io/images/ph-ee-g2psandbox-fynarfin" | ||
wait: true | ||
timeout: "300s" | ||
|
||
test-chart-gov: | ||
docker: | ||
|
@@ -273,23 +281,24 @@ workflows: | |
context: | ||
- AWS | ||
- Helm | ||
- upgrade-helm-chart: | ||
cluster-name: sit | ||
requires: | ||
- build-host-g2p-fyn-chart | ||
- docker-image-availability-check-and-upgrade: | ||
context: | ||
- AWS | ||
- Helm | ||
- slack | ||
requires: | ||
- build-host-g2p-fyn-chart | ||
- test-chart-gov: | ||
requires: | ||
- upgrade-helm-chart | ||
- docker-image-availability-check-and-upgrade | ||
context: | ||
- AWS | ||
- Helm | ||
- slack | ||
- Ngrok | ||
- test-chart-ams: | ||
requires: | ||
- upgrade-helm-chart | ||
- docker-image-availability-check-and-upgrade | ||
context: | ||
- AWS | ||
- Helm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters