22# See: https://circleci.com/docs/2.0/configuration-reference
33version : 2.1
44
5+ # MARK: Orbs
6+ orbs :
7+ 8+
9+ executors :
10+ node-executor :
11+ docker :
12+ - image : cimg/node:16.19.1
13+
14+ # MARK: Worflow parameters
15+ parameters :
16+ run_workflow_create_ticket :
17+ type : boolean
18+ default : false
19+
520commands :
621 command-lint :
722 steps :
@@ -17,13 +32,22 @@ commands:
1732 name : UIKit for React test
1833 command : yarn run test
1934 no_output_timeout : 15m
35+ clone_deployment_script :
36+ steps :
37+ - run :
38+ name : Git - Clone deployment scripts
39+ when : always
40+ environment :
41+ SDK_DEPLOYMENT_BOT_EMAIL : ${{ secrets.SDK_DEPLOYMENT_BOT_EMAIL }}
42+ command : |
43+ git config --global user.email $SDK_DEPLOYMENT_BOT_EMAIL
44+ git clone --depth 1 --branch 1.0.1 [email protected] :sendbird/sdk-deployment.git ~/sdk-deployment 2045
2146# Define a job to be invoked later in a workflow.
2247# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
2348jobs :
2449 job-lint_and_test :
25- docker :
26- - image : cimg/node:16.19.1
50+ executor : node-executor
2751 parallelism : 4
2852 resource_class : large
2953 steps :
@@ -43,10 +67,67 @@ jobs:
4367 key : uikit-yarn-dependencies-{{ checksum "yarn.lock" }}
4468 paths :
4569 - ./.yarn/cache
70+ create-ticket :
71+ executor : node-executor
72+ steps :
73+ - checkout
74+ - clone_deployment_script
75+ - run :
76+ name : Extract release version
77+ command : |
78+ release_version=$(python3 ~/sdk-deployment/scripts/v1.2/extract_version.py --branch_name $CIRCLE_BRANCH)
79+ echo "export RELEASE_VERSION=$release_version" >> $BASH_ENV
80+ source $BASH_ENV
81+ - run :
82+ name : Jira - Create release version
83+ command : |
84+ python3 ~/sdk-deployment/scripts/v1.2/create_version.py\
85+ --jira_auth_user $JIRA_AUTH_USER\
86+ --jira_auth_api_token $JIRA_AUTH_API_TOKEN\
87+ --project SDKRLSD\
88+ --name js_uikit@$RELEASE_VERSION\
89+ --description 'Created by automation @ $CIRCLE_PROJECT_REPONAME'
90+ - run :
91+ name : Jira - Create release ticket
92+ command : |
93+ release_ticket_key=$(python3 ~/sdk-deployment/scripts/v1.2/create_ticket.py\
94+ --jira_auth_user $JIRA_AUTH_USER\
95+ --jira_auth_api_token $JIRA_AUTH_API_TOKEN\
96+ --project SDKRLSD\
97+ --version js_uikit@$RELEASE_VERSION\
98+ --title "[UIKit] js_uikit@$RELEASE_VERSION"\
99+ --description 'Created by automation @ $CIRCLE_PROJECT_REPONAME'\
100+ --source_repo $CIRCLE_PROJECT_REPONAME\
101+ --source_branch $CIRCLE_BRANCH\
102+ --source_jira_project CORE\
103+ --source_jira_version js_uikit@$RELEASE_VERSION)
104+ echo "export RELEASE_TICKET_KEY=$release_ticket_key" >> $BASH_ENV
105+ source $BASH_ENV
106+ - slack/notify :
107+ channel : $SLACK_RELEASE_APPOVER_CHANNEL_ID # sdk-release-approver
108+ event : pass
109+ custom : |
110+ {
111+ "blocks": [
112+ {
113+ "type": "section",
114+ "text": {
115+ "type": "mrkdwn",
116+ "text": "@chat-approver <https://sendbird.atlassian.net/browse/$RELEASE_TICKET_KEY|🔖 UIKit JS $RELEASE_VERSION release ticket> has been created!"
117+ }
118+ }
119+ ]
120+ }
121+
46122
47123# Invoke jobs via workflows
48124# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
49125workflows :
50126 built-and-test :
51127 jobs :
52128 - job-lint_and_test
129+ create-release-ticket-workflow :
130+ when : << pipeline.parameters.run_workflow_create_ticket >>
131+ jobs :
132+ - create-ticket :
133+ context : sdk-release-bot
0 commit comments