From 779a939a0de2ee8e30c19e1cd1edef9339762bc5 Mon Sep 17 00:00:00 2001 From: logoutdhaval Date: Thu, 23 Nov 2023 13:22:26 +0530 Subject: [PATCH 1/2] PHEE-477 Create an orb that fetches the docker images and do helm upgrade --- .circleci/config.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b11d3db..d41351e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,6 +56,13 @@ jobs: command: | ./gradlew bootJar docker build -t openmf/ph-ee-notifications: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: @@ -65,7 +72,16 @@ jobs: # Push the Docker image to DockerHub - run: name: Push Docker image to DockerHub - command: docker push openmf/ph-ee-notifications:latest + command: | + if [ "$CIRCLE_BRANCH" = "master" ]; then + docker push openmf/ph-ee-notifications: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 From da4ae7807d32f227078122367fb281ece1efb71d Mon Sep 17 00:00:00 2001 From: logoutdhaval Date: Mon, 27 Nov 2023 16:12:33 +0530 Subject: [PATCH 2/2] change in github template --- .github/pull_request_template.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 98c407d..9110b69 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,13 +1,15 @@ ## Description +* PR title should have jira ticket enclosed in `[]`.
+ Format: ``` [jira_ticket] description```
+ ex: [phee-123] PR title. +* Add a link to the Jira ticket. * Describe the changes made and why they were made. -* Add a link to teh design document or include the design bullet points related to this PR here. - - _(Ignore if these details are present on the associated JIRA ticket)_ ## 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.