Skip to content

Commit b4248a2

Browse files
authored
[PHEE-477] Create an orb that fetches the docker images and do helm upg… (#130)
* PHEE-477 Create an orb that fetches the docker images and do helm upgrade * added github template
1 parent 64eec86 commit b4248a2

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

.circleci/config.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ jobs:
6060
./gradlew checkstyleMain
6161
./gradlew bootJar
6262
docker build -t openmf/ph-ee-bulk-processor:latest .
63+
if [ "$CIRCLE_BRANCH" != "master" ]; then
64+
PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST)
65+
PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title')
66+
JIRA_STORY=$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]')
67+
if [ -z "$JIRA_STORY" ]; then echo "Invalid PR title" && exit 1; else echo "Ticket NO: $JIRA_STORY"; fi
68+
docker image tag openmf/$CIRCLE_PR_REPONAME:latest openmf/$CIRCLE_PR_REPONAME:$JIRA_STORY
69+
fi
6370
6471
# Log in to DockerHub using environment variables
6572
- run:
@@ -69,7 +76,16 @@ jobs:
6976
# Push the Docker image to DockerHub
7077
- run:
7178
name: Push Docker image to DockerHub
72-
command: docker push openmf/ph-ee-bulk-processor:latest
79+
command: |
80+
if [ "$CIRCLE_BRANCH" = "master" ]; then
81+
docker push openmf/ph-ee-bulk-processor:latest
82+
fi
83+
if [ "$CIRCLE_BRANCH" != "master" ]; then
84+
PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST)
85+
PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title')
86+
JIRA_STORY=$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]')
87+
docker push openmf/$CIRCLE_PR_REPONAME:${JIRA_STORY}
88+
fi
7389
7490
workflows:
7591
version: 2

.github/pull_request_template.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Description
2+
3+
* PR title should have jira ticket enclosed in `[]`.<br>
4+
Format: ``` [jira_ticket] description```<br>
5+
ex: [phee-123] PR title.
6+
* Add a link to the Jira ticket.
7+
* Describe the changes made and why they were made.
8+
9+
## Checklist
10+
11+
Please make sure these boxes are checked before submitting your pull request - thanks!
12+
- [ ] Followed the PR title naming convention mentioned above.
13+
14+
- [ ] Design related bullet points or design document link related to this PR added in the description above.
15+
16+
- [ ] Updated corresponding Postman Collection or Api documentation for the changes in this PR.
17+
18+
- [ ] Created/updated unit or integration tests for verifying the changes made.
19+
20+
- [ ] Added required Swagger annotation and update API documentation with details of any API changes if applicable
21+
22+
- [ ] Followed the naming conventions as given in https://docs.google.com/document/d/1Q4vaMSzrTxxh9TS0RILuNkSkYCxotuYk1Xe0CMIkkCU/edit?usp=sharing

0 commit comments

Comments
 (0)