88 KOSLI_ORG : kosli-public
99 KOSLI_API_TOKEN : " ${{ secrets.KOSLI_PUBLIC_API_TOKEN }}"
1010 KOSLI_CLI_VERSION : " 2.11.8"
11+ KOSLI_ENV_STAGING : " jira-integration-example-staging"
12+ KOSLI_ENV_PROD : " jira-integration-example-prod"
13+ KOSLI_FLOW_FRONTEND : " jira-example-frontend"
14+ KOSLI_FLOW_BACKEND : " jira-example-backend"
1115 # KOSLI_DRY_RUN: true
1216 JIRA_BASE_URL : " https://kosli-team.atlassian.net"
1317 JIRA_USERNAME : ${{ secrets.KOSLI_JIRA_USERNAME }}
@@ -26,15 +30,26 @@ jobs:
2630
2731 - name :
2832 run : |
29- set -x
3033 source scripts/lib-jira.sh
31- current_release_json=$(get_current_release_candidate ${{ env.JIRA_PROJECT_ID }})
32- echo "${current_release_json}" | jq .
33- current_release=$(echo "${current_release_json}" | jq .values)
34- echo cr=$current_release
35- if [ "${current_release}" != "[]" ]; then
36- echo "Release candidate already exist: ${current_release}"
37- exit 1
38- fi
39- TIMESTAMP=$(date -u "+%Y-%m-%d-%H-%M-%S")
40- create_release ${{ env.JIRA_PROJECT_ID }} ${TIMESTAMP}
34+ source scripts/lib-kosli.sh
35+
36+ # Check if a release already exists, if so we fail
37+ # CURRENT_REL_JSON=$(get_CURRENT_REL_candidate ${{ env.JIRA_PROJECT_ID }})
38+ # CURRENT_REL=$(echo "${CURRENT_REL_JSON}" | jq .values)
39+ # if [ "${CURRENT_REL}" != "[]" ]; then
40+ # echo "Release candidate already exist: ${CURRENT_REL}"
41+ # exit 1
42+ # fi
43+
44+ # Create the release and get the release ID
45+ # TIMESTAMP=$(date -u "+%Y-%m-%d-%H-%M-%S")
46+ # CREATE_RESULT_JSON=$(create_release ${{ env.JIRA_PROJECT_ID }} ${TIMESTAMP})
47+ # RELEASE_ID=$(echo "${CREATE_RESULT_JSON}" | jq .id)
48+ RELEASE_ID=10099
49+
50+ # Add jira tickets to release
51+ JIRA_KEYS=$(get_issue_keys_between_staging_and_prod)
52+ echo "Found issues : ${JIRA_KEYS}"
53+ for JIRA_KEY in ${JIRA_KEYS}; do
54+ add_issue_to_release ${JIRA_KEY} ${RELEASE_ID}
55+ done
0 commit comments