Skip to content

Commit 70d0c64

Browse files
authored
[PHEE-477] Create an orb that fetches the docker images and do helm upgrade (#77)
* PHEE-477 Create an orb that fetches the docker images and do helm upgrade * fix command * added github template
1 parent 429f583 commit 70d0c64

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.circleci/config.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ jobs:
5656
command: |
5757
./gradlew bootJar
5858
docker build -t openmf/message-gateway:latest .
59+
if [ "$CIRCLE_BRANCH" != "master" ]; then
60+
PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST)
61+
PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title')
62+
JIRA_STORY=$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]')
63+
if [ -z "$JIRA_STORY" ]; then echo "Invalid PR title" && exit 1; else echo "Ticket NO: $JIRA_STORY"; fi
64+
docker image tag openmf/$CIRCLE_PR_REPONAME:latest openmf/$CIRCLE_PR_REPONAME:$JIRA_STORY
65+
fi
5966
6067
# Log in to DockerHub using environment variables
6168
- run:
@@ -65,7 +72,16 @@ jobs:
6572
# Push the Docker image to DockerHub
6673
- run:
6774
name: Push Docker image to DockerHub
68-
command: docker push openmf/message-gateway:latest
75+
command: |
76+
if [ "$CIRCLE_BRANCH" = "master" ]; then
77+
docker push openmf/message-gateway:latest
78+
fi
79+
if [ "$CIRCLE_BRANCH" != "master" ]; then
80+
PR_NUMBER=$(basename $CIRCLE_PULL_REQUEST)
81+
PR_TITLE=$(curl -sSL "https://api.github.com/repos/openmf/$CIRCLE_PR_REPONAME/pulls/$PR_NUMBER" | jq -r '.title')
82+
JIRA_STORY=$(echo $PR_TITLE | cut -d "[" -f2 | cut -d "]" -f1 | tr '[A-Z]' '[a-z]')
83+
docker push openmf/$CIRCLE_PR_REPONAME:${JIRA_STORY}
84+
fi
6985
7086
workflows:
7187
version: 2

.github/pull_request_template.md

+22
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)