Skip to content

Commit

Permalink
[PHEE-477] Create an orb that fetches the docker images and do helm u…
Browse files Browse the repository at this point in the history
…pg… (openMF#130)

* PHEE-477 Create an orb that fetches the docker images and do helm upgrade

* added github template
  • Loading branch information
logoutdhaval authored Nov 27, 2023
1 parent 64eec86 commit b4248a2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ jobs:
./gradlew checkstyleMain
./gradlew bootJar
docker build -t openmf/ph-ee-bulk-processor: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:
Expand All @@ -69,7 +76,16 @@ jobs:
# Push the Docker image to DockerHub
- run:
name: Push Docker image to DockerHub
command: docker push openmf/ph-ee-bulk-processor:latest
command: |
if [ "$CIRCLE_BRANCH" = "master" ]; then
docker push openmf/ph-ee-bulk-processor: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
workflows:
version: 2
Expand Down
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Description

* PR title should have jira ticket enclosed in `[]`.<br>
Format: ``` [jira_ticket] description```<br>
ex: [phee-123] PR title.
* Add a link to the Jira ticket.
* Describe the changes made and why they were made.

## Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!
- [ ] Followed the PR title naming convention mentioned above.

- [ ] Design related bullet points or design document link related to this PR added in the description above.

- [ ] Updated corresponding Postman Collection or Api documentation for the changes in this PR.

- [ ] Created/updated unit or integration tests for verifying the changes made.

- [ ] Added required Swagger annotation and update API documentation with details of any API changes if applicable

- [ ] Followed the naming conventions as given in https://docs.google.com/document/d/1Q4vaMSzrTxxh9TS0RILuNkSkYCxotuYk1Xe0CMIkkCU/edit?usp=sharing

0 comments on commit b4248a2

Please sign in to comment.