@jira-deploy/core 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constants/config.js +10 -1
- package/package.json +2 -2
- package/tools/grayrelease.js +7 -4
package/constants/config.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'fs';
|
|
2
|
+
import { homedir } from 'os';
|
|
3
|
+
import { join } from 'path';
|
|
2
4
|
|
|
3
5
|
const EMPTY_OBJECT = Object.freeze({});
|
|
4
6
|
|
|
@@ -148,10 +150,17 @@ function deepMerge(base, override) {
|
|
|
148
150
|
return merged;
|
|
149
151
|
}
|
|
150
152
|
|
|
153
|
+
function expandHomePath(filePath) {
|
|
154
|
+
if (filePath === '~') return homedir();
|
|
155
|
+
if (filePath.startsWith('~/')) return join(homedir(), filePath.slice(2));
|
|
156
|
+
return filePath;
|
|
157
|
+
}
|
|
158
|
+
|
|
151
159
|
function loadExternalConfig() {
|
|
152
160
|
if (process.env.JIRA_DEPLOY_CONFIG_PATH) {
|
|
161
|
+
const configPath = expandHomePath(process.env.JIRA_DEPLOY_CONFIG_PATH);
|
|
153
162
|
return parseJsonConfig(
|
|
154
|
-
readFileSync(
|
|
163
|
+
readFileSync(configPath, 'utf8'),
|
|
155
164
|
`JIRA_DEPLOY_CONFIG_PATH (${process.env.JIRA_DEPLOY_CONFIG_PATH})`,
|
|
156
165
|
);
|
|
157
166
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jira-deploy/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"repository": {
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"dotenv": "^16.3.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
|
-
"test": "node --import ./test-env.js --test tools.test.js tools/jabber.test.js"
|
|
45
|
+
"test": "node --import ./test-env.js --test tools.test.js tools/jabber.test.js config.test.js"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/tools/grayrelease.js
CHANGED
|
@@ -756,10 +756,10 @@ async function executeGrayReleaseDeployFlow(issueKey, ctx) {
|
|
|
756
756
|
}
|
|
757
757
|
|
|
758
758
|
log.push(`🚀 開始執行 GrayRelease Deploy - 環境: ${environment.toUpperCase()}`);
|
|
759
|
-
log.push('
|
|
759
|
+
log.push(' 先執行 Planning,確保部署流程從可簽核狀態重新開始');
|
|
760
760
|
await jira.transitionByName(issueKey, 'Planning');
|
|
761
|
-
await notifier.notify(issueKey, '
|
|
762
|
-
|
|
761
|
+
await notifier.notify(issueKey, '開始執行 GrayRelease deploy 流程,先回到 Planning');
|
|
762
|
+
|
|
763
763
|
while (true) {
|
|
764
764
|
const issue = await jira.getIssue(issueKey);
|
|
765
765
|
const currentStatus = issue.fields.status.name;
|
|
@@ -867,6 +867,9 @@ async function executeAutoGrayReleaseFlow(issueKey, options, ctx) {
|
|
|
867
867
|
}
|
|
868
868
|
|
|
869
869
|
log.push(`🚀 開始執行 GrayRelease 流程 - 環境: ${environment.toUpperCase()}`);
|
|
870
|
+
log.push(' 先執行 PLANNING,確保流程從頭開始');
|
|
871
|
+
await jira.transitionByName(issueKey, 'Planning');
|
|
872
|
+
await notifier.notify(issueKey, '開始自動執行 GrayRelease 流程,從 PLANNING 開始');
|
|
870
873
|
|
|
871
874
|
while (true) {
|
|
872
875
|
const issue = await jira.getIssue(issueKey);
|
|
@@ -1154,7 +1157,7 @@ async function handleGrayReleaseApproval(issueKey, environment, systemCode, ctx)
|
|
|
1154
1157
|
|
|
1155
1158
|
// UAT: assign first reviewer → 等待留言 → 轉 final approver → 等待 approve
|
|
1156
1159
|
if (env === 'uat') {
|
|
1157
|
-
const {commentReviewerAlias, finalApproverAlias} = getGrayReleaseUatApprovers();
|
|
1160
|
+
const { commentReviewerAlias, finalApproverAlias } = getGrayReleaseUatApprovers();
|
|
1158
1161
|
const commentReviewerAccountId = resolveAccountId(commentReviewerAlias);
|
|
1159
1162
|
if (!commentReviewerAccountId) {
|
|
1160
1163
|
throw new Error(`找不到 UAT 第一階段簽核人 accountId,請設定 GRAYRELEASE_UAT_COMMENT_REVIEWER_ALIAS 或 release.grayReleaseUatApprovers.commentReviewerAlias`);
|