@apps-in-toss/cli 2.8.0 → 2.9.1
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/dist/index.cjs +107 -7
- package/dist/index.js +107 -7
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1539,15 +1539,56 @@ async function handleFetchResponse(response) {
|
|
|
1539
1539
|
// src/utils/withRetry.ts
|
|
1540
1540
|
init_cjs_shims();
|
|
1541
1541
|
var import_promises6 = require("timers/promises");
|
|
1542
|
+
var WindowRetryStrategy = class {
|
|
1543
|
+
constructor(delayMs = 1e4) {
|
|
1544
|
+
this.delayMs = delayMs;
|
|
1545
|
+
}
|
|
1546
|
+
getDelayMs(attempt) {
|
|
1547
|
+
return this.delayMs;
|
|
1548
|
+
}
|
|
1549
|
+
};
|
|
1550
|
+
var ExponentialBackOffRetryStrategy = class {
|
|
1551
|
+
constructor(options) {
|
|
1552
|
+
this.options = options;
|
|
1553
|
+
this.factor = options.factor ?? 2;
|
|
1554
|
+
}
|
|
1555
|
+
factor;
|
|
1556
|
+
getDelayMs(attempt) {
|
|
1557
|
+
return Math.min(this.options.initialDelayMs * this.factor ** attempt, this.options.maxDelayMs);
|
|
1558
|
+
}
|
|
1559
|
+
};
|
|
1542
1560
|
async function withRetry(fn, options = {}) {
|
|
1543
|
-
const {
|
|
1561
|
+
const {
|
|
1562
|
+
maxRetries = 60,
|
|
1563
|
+
initialDelayMs = 0,
|
|
1564
|
+
retryStrategy = new WindowRetryStrategy(),
|
|
1565
|
+
maxElapsedMs,
|
|
1566
|
+
shouldRetryOnResult,
|
|
1567
|
+
shouldRetryOnError,
|
|
1568
|
+
onRetry
|
|
1569
|
+
} = options;
|
|
1544
1570
|
let attempt = 0;
|
|
1571
|
+
const startedAt = Date.now();
|
|
1572
|
+
const initialDelay = getBoundedDelayMs({ delay: initialDelayMs, maxElapsedMs, startedAt });
|
|
1573
|
+
if (initialDelay < 0) {
|
|
1574
|
+
throw new Error("\uCD5C\uB300 \uB300\uAE30\uC2DC\uAC04\uC744 \uCD08\uACFC\uD588\uC5B4\uC694.");
|
|
1575
|
+
}
|
|
1576
|
+
if (initialDelay > 0) {
|
|
1577
|
+
await (0, import_promises6.setTimeout)(initialDelay);
|
|
1578
|
+
}
|
|
1545
1579
|
while (attempt < maxRetries) {
|
|
1580
|
+
if (maxElapsedMs != null && Date.now() - startedAt >= maxElapsedMs) {
|
|
1581
|
+
break;
|
|
1582
|
+
}
|
|
1546
1583
|
try {
|
|
1547
1584
|
const result = await fn();
|
|
1548
1585
|
if (shouldRetryOnResult && shouldRetryOnResult(result)) {
|
|
1586
|
+
const delay = getRetryDelayMs({ attempt, retryStrategy, maxElapsedMs, startedAt });
|
|
1587
|
+
if (delay < 0) {
|
|
1588
|
+
break;
|
|
1589
|
+
}
|
|
1549
1590
|
onRetry?.(attempt + 1, { result });
|
|
1550
|
-
await (0, import_promises6.setTimeout)(
|
|
1591
|
+
await (0, import_promises6.setTimeout)(delay);
|
|
1551
1592
|
attempt++;
|
|
1552
1593
|
continue;
|
|
1553
1594
|
}
|
|
@@ -1557,16 +1598,40 @@ async function withRetry(fn, options = {}) {
|
|
|
1557
1598
|
if (!retryable) {
|
|
1558
1599
|
throw error;
|
|
1559
1600
|
}
|
|
1601
|
+
const delay = getRetryDelayMs({ attempt, retryStrategy, maxElapsedMs, startedAt });
|
|
1602
|
+
if (delay < 0) {
|
|
1603
|
+
break;
|
|
1604
|
+
}
|
|
1560
1605
|
onRetry?.(attempt + 1, { error });
|
|
1561
|
-
await (0, import_promises6.setTimeout)(
|
|
1606
|
+
await (0, import_promises6.setTimeout)(delay);
|
|
1562
1607
|
attempt++;
|
|
1563
1608
|
}
|
|
1564
1609
|
}
|
|
1565
1610
|
throw new Error("\uCD5C\uB300 \uB300\uAE30\uC2DC\uAC04\uC744 \uCD08\uACFC\uD588\uC5B4\uC694.");
|
|
1566
1611
|
}
|
|
1612
|
+
function getRetryDelayMs(params) {
|
|
1613
|
+
const delay = params.retryStrategy.getDelayMs(params.attempt);
|
|
1614
|
+
return getBoundedDelayMs({ delay, maxElapsedMs: params.maxElapsedMs, startedAt: params.startedAt });
|
|
1615
|
+
}
|
|
1616
|
+
function getBoundedDelayMs(params) {
|
|
1617
|
+
if (params.maxElapsedMs == null) {
|
|
1618
|
+
return params.delay;
|
|
1619
|
+
}
|
|
1620
|
+
const remainingMs = params.maxElapsedMs - (Date.now() - params.startedAt);
|
|
1621
|
+
if (remainingMs <= 0) {
|
|
1622
|
+
return -1;
|
|
1623
|
+
}
|
|
1624
|
+
return Math.min(params.delay, remainingMs);
|
|
1625
|
+
}
|
|
1567
1626
|
|
|
1568
1627
|
// src/utils/upload.ts
|
|
1569
1628
|
var debug2 = (0, import_debug2.default)("cli:deploy");
|
|
1629
|
+
var DEFAULT_DEPLOY_TIMEOUT_SECONDS = 100;
|
|
1630
|
+
var MIN_DEPLOY_TIMEOUT_SECONDS = 10;
|
|
1631
|
+
var MAX_DEPLOY_TIMEOUT_SECONDS = 300;
|
|
1632
|
+
var DEPLOY_STATUS_INITIAL_POLLING_DELAY_MS = 5e3;
|
|
1633
|
+
var DEPLOY_STATUS_INITIAL_RETRY_INTERVAL_MS = 1e4;
|
|
1634
|
+
var DEPLOY_STATUS_MAX_POLLING_INTERVAL_MS = 3e4;
|
|
1570
1635
|
async function uploadArtifact(config) {
|
|
1571
1636
|
debug2("uploadArtifact", config);
|
|
1572
1637
|
return flowAsync(uploadStart(), uploadArtifactToRemote(), uploadComplete(), checkBundleStatus())(config);
|
|
@@ -1631,9 +1696,19 @@ function uploadComplete() {
|
|
|
1631
1696
|
return config;
|
|
1632
1697
|
};
|
|
1633
1698
|
}
|
|
1634
|
-
function checkBundleStatus(
|
|
1699
|
+
function checkBundleStatus(option = {}) {
|
|
1700
|
+
const {
|
|
1701
|
+
initialDelayMs = DEPLOY_STATUS_INITIAL_POLLING_DELAY_MS,
|
|
1702
|
+
maxRetries = Number.POSITIVE_INFINITY,
|
|
1703
|
+
retryStrategy = new ExponentialBackOffRetryStrategy({
|
|
1704
|
+
initialDelayMs: DEPLOY_STATUS_INITIAL_RETRY_INTERVAL_MS,
|
|
1705
|
+
maxDelayMs: DEPLOY_STATUS_MAX_POLLING_INTERVAL_MS
|
|
1706
|
+
})
|
|
1707
|
+
} = option;
|
|
1635
1708
|
return async (config) => {
|
|
1636
1709
|
const baseUrl = config.baseUrl ?? DEFAULT_API_BASE_URL;
|
|
1710
|
+
const timeoutSeconds = config.timeoutSeconds ?? DEFAULT_DEPLOY_TIMEOUT_SECONDS;
|
|
1711
|
+
const timeoutMs = timeoutSeconds * 1e3;
|
|
1637
1712
|
function assertBuildNotFailed(config2, reviewStatus2) {
|
|
1638
1713
|
if (reviewStatus2 === "BUILD_FAILED") {
|
|
1639
1714
|
throw new Error(
|
|
@@ -1657,7 +1732,9 @@ function checkBundleStatus(delayMs = 1e4, maxRetries = 10) {
|
|
|
1657
1732
|
}
|
|
1658
1733
|
const reviewStatus = await withRetry(pollBundleStatus, {
|
|
1659
1734
|
maxRetries,
|
|
1660
|
-
|
|
1735
|
+
initialDelayMs,
|
|
1736
|
+
maxElapsedMs: timeoutMs,
|
|
1737
|
+
retryStrategy,
|
|
1661
1738
|
shouldRetryOnResult: (reviewStatus2) => reviewStatus2 === "BUILDING" || reviewStatus2 === "PREPARE",
|
|
1662
1739
|
shouldRetryOnError: () => false,
|
|
1663
1740
|
onRetry: (attempt, info) => debug2("checkBundleStatus: retry", { attempt, ...info })
|
|
@@ -1667,6 +1744,21 @@ function checkBundleStatus(delayMs = 1e4, maxRetries = 10) {
|
|
|
1667
1744
|
}
|
|
1668
1745
|
|
|
1669
1746
|
// src/DeployCommand.ts
|
|
1747
|
+
function parseDeployTimeoutSeconds(timeout) {
|
|
1748
|
+
if (timeout == null) {
|
|
1749
|
+
return DEFAULT_DEPLOY_TIMEOUT_SECONDS;
|
|
1750
|
+
}
|
|
1751
|
+
const timeoutSeconds = Number(timeout);
|
|
1752
|
+
if (!Number.isInteger(timeoutSeconds)) {
|
|
1753
|
+
throw new Error("--timeout\uC740 \uC815\uC218(\uCD08)\uB85C \uC785\uB825\uD574\uC8FC\uC138\uC694.");
|
|
1754
|
+
}
|
|
1755
|
+
if (timeoutSeconds < MIN_DEPLOY_TIMEOUT_SECONDS || timeoutSeconds > MAX_DEPLOY_TIMEOUT_SECONDS) {
|
|
1756
|
+
throw new Error(
|
|
1757
|
+
`--timeout\uC740 ${MIN_DEPLOY_TIMEOUT_SECONDS}\uCD08 \uC774\uC0C1 ${MAX_DEPLOY_TIMEOUT_SECONDS}\uCD08 \uC774\uD558\uB85C \uC785\uB825\uD574\uC8FC\uC138\uC694.`
|
|
1758
|
+
);
|
|
1759
|
+
}
|
|
1760
|
+
return timeoutSeconds;
|
|
1761
|
+
}
|
|
1670
1762
|
var DeployCommand = class extends import_clipanion2.Command {
|
|
1671
1763
|
static paths = [["deploy"]];
|
|
1672
1764
|
static usage = import_clipanion2.Command.Usage({
|
|
@@ -1677,6 +1769,7 @@ var DeployCommand = class extends import_clipanion2.Command {
|
|
|
1677
1769
|
["\uD2B9\uC815 .ait \uD30C\uC77C \uBC30\uD3EC", "ait deploy --location ./dist/my-app.ait"],
|
|
1678
1770
|
["\uD504\uB85C\uD544\uC5D0 \uC800\uC7A5\uB41C \uD1A0\uD070\uC73C\uB85C \uBC30\uD3EC", "ait deploy --profile dev"],
|
|
1679
1771
|
["\uCD9C\uC2DC \uBA54\uBAA8\uC640 \uD568\uAED8 \uBC30\uD3EC", 'ait deploy -m "\uCD9C\uC2DC \uBA54\uBAA8(\uCD5C\uB300 1000\uC790)"'],
|
|
1772
|
+
["\uBC30\uD3EC \uC0C1\uD0DC \uD655\uC778 \uCD5C\uB300 \uB300\uAE30\uC2DC\uAC04 \uC9C0\uC815", "ait deploy --timeout 100"],
|
|
1680
1773
|
["\uBC30\uD3EC \uACB0\uACFC scheme\uB9CC \uCD9C\uB825", "ait deploy --scheme-only"]
|
|
1681
1774
|
]
|
|
1682
1775
|
});
|
|
@@ -1708,6 +1801,10 @@ var DeployCommand = class extends import_clipanion2.Command {
|
|
|
1708
1801
|
required: false,
|
|
1709
1802
|
description: "\uCD9C\uC2DC \uBA54\uBAA8\uB97C \uC785\uB825\uD574\uC694. \uCD5C\uB300 1000\uC790\uAE4C\uC9C0 \uC785\uB825\uD560 \uC218 \uC788\uC5B4\uC694."
|
|
1710
1803
|
});
|
|
1804
|
+
timeout = import_clipanion2.Option.String("--timeout", {
|
|
1805
|
+
required: false,
|
|
1806
|
+
description: `\uBC30\uD3EC \uC0C1\uD0DC \uD655\uC778\uC744 \uAE30\uB2E4\uB9B4 \uCD5C\uB300 \uC2DC\uAC04(\uCD08)\uC744 \uC785\uB825\uD574\uC694. \uAE30\uBCF8\uAC12\uC740 ${DEFAULT_DEPLOY_TIMEOUT_SECONDS}\uCD08, \uCD5C\uB300\uAC12\uC740 ${MAX_DEPLOY_TIMEOUT_SECONDS}\uCD08\uC608\uC694.`
|
|
1807
|
+
});
|
|
1711
1808
|
async execute() {
|
|
1712
1809
|
const baseUrl = this.baseUrl;
|
|
1713
1810
|
const profile = this.profile || this.workspace || "default";
|
|
@@ -1722,6 +1819,7 @@ var DeployCommand = class extends import_clipanion2.Command {
|
|
|
1722
1819
|
if (this.memo != null && this.memo.length > 1e3) {
|
|
1723
1820
|
throw new Error("memo\uB294 \uCD5C\uB300 1000\uC790\uAE4C\uC9C0 \uC785\uB825\uD560 \uC218 \uC788\uC5B4\uC694.");
|
|
1724
1821
|
}
|
|
1822
|
+
const timeoutSeconds = parseDeployTimeoutSeconds(this.timeout);
|
|
1725
1823
|
const resolvedArtifactPath = this.getArtifactPath(this.location);
|
|
1726
1824
|
const buffer = import_fs3.default.readFileSync(resolvedArtifactPath);
|
|
1727
1825
|
const format = import_ait_format.AppsInTossBundle.detect(buffer);
|
|
@@ -1763,7 +1861,8 @@ var DeployCommand = class extends import_clipanion2.Command {
|
|
|
1763
1861
|
deploymentId,
|
|
1764
1862
|
apiKey,
|
|
1765
1863
|
memo: this.memo,
|
|
1766
|
-
baseUrl
|
|
1864
|
+
baseUrl,
|
|
1865
|
+
timeoutSeconds
|
|
1767
1866
|
});
|
|
1768
1867
|
} else {
|
|
1769
1868
|
await p4.tasks([
|
|
@@ -1776,7 +1875,8 @@ var DeployCommand = class extends import_clipanion2.Command {
|
|
|
1776
1875
|
deploymentId,
|
|
1777
1876
|
apiKey,
|
|
1778
1877
|
memo: this.memo,
|
|
1779
|
-
baseUrl
|
|
1878
|
+
baseUrl,
|
|
1879
|
+
timeoutSeconds
|
|
1780
1880
|
});
|
|
1781
1881
|
return `${colorAppName} \uBC30\uD3EC\uAC00 \uC644\uB8CC\uB418\uC5C8\uC5B4\uC694`;
|
|
1782
1882
|
}
|
package/dist/index.js
CHANGED
|
@@ -1531,15 +1531,56 @@ async function handleFetchResponse(response) {
|
|
|
1531
1531
|
// src/utils/withRetry.ts
|
|
1532
1532
|
init_esm_shims();
|
|
1533
1533
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
1534
|
+
var WindowRetryStrategy = class {
|
|
1535
|
+
constructor(delayMs = 1e4) {
|
|
1536
|
+
this.delayMs = delayMs;
|
|
1537
|
+
}
|
|
1538
|
+
getDelayMs(attempt) {
|
|
1539
|
+
return this.delayMs;
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
var ExponentialBackOffRetryStrategy = class {
|
|
1543
|
+
constructor(options) {
|
|
1544
|
+
this.options = options;
|
|
1545
|
+
this.factor = options.factor ?? 2;
|
|
1546
|
+
}
|
|
1547
|
+
factor;
|
|
1548
|
+
getDelayMs(attempt) {
|
|
1549
|
+
return Math.min(this.options.initialDelayMs * this.factor ** attempt, this.options.maxDelayMs);
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1534
1552
|
async function withRetry(fn, options = {}) {
|
|
1535
|
-
const {
|
|
1553
|
+
const {
|
|
1554
|
+
maxRetries = 60,
|
|
1555
|
+
initialDelayMs = 0,
|
|
1556
|
+
retryStrategy = new WindowRetryStrategy(),
|
|
1557
|
+
maxElapsedMs,
|
|
1558
|
+
shouldRetryOnResult,
|
|
1559
|
+
shouldRetryOnError,
|
|
1560
|
+
onRetry
|
|
1561
|
+
} = options;
|
|
1536
1562
|
let attempt = 0;
|
|
1563
|
+
const startedAt = Date.now();
|
|
1564
|
+
const initialDelay = getBoundedDelayMs({ delay: initialDelayMs, maxElapsedMs, startedAt });
|
|
1565
|
+
if (initialDelay < 0) {
|
|
1566
|
+
throw new Error("\uCD5C\uB300 \uB300\uAE30\uC2DC\uAC04\uC744 \uCD08\uACFC\uD588\uC5B4\uC694.");
|
|
1567
|
+
}
|
|
1568
|
+
if (initialDelay > 0) {
|
|
1569
|
+
await sleep(initialDelay);
|
|
1570
|
+
}
|
|
1537
1571
|
while (attempt < maxRetries) {
|
|
1572
|
+
if (maxElapsedMs != null && Date.now() - startedAt >= maxElapsedMs) {
|
|
1573
|
+
break;
|
|
1574
|
+
}
|
|
1538
1575
|
try {
|
|
1539
1576
|
const result = await fn();
|
|
1540
1577
|
if (shouldRetryOnResult && shouldRetryOnResult(result)) {
|
|
1578
|
+
const delay = getRetryDelayMs({ attempt, retryStrategy, maxElapsedMs, startedAt });
|
|
1579
|
+
if (delay < 0) {
|
|
1580
|
+
break;
|
|
1581
|
+
}
|
|
1541
1582
|
onRetry?.(attempt + 1, { result });
|
|
1542
|
-
await sleep(
|
|
1583
|
+
await sleep(delay);
|
|
1543
1584
|
attempt++;
|
|
1544
1585
|
continue;
|
|
1545
1586
|
}
|
|
@@ -1549,16 +1590,40 @@ async function withRetry(fn, options = {}) {
|
|
|
1549
1590
|
if (!retryable) {
|
|
1550
1591
|
throw error;
|
|
1551
1592
|
}
|
|
1593
|
+
const delay = getRetryDelayMs({ attempt, retryStrategy, maxElapsedMs, startedAt });
|
|
1594
|
+
if (delay < 0) {
|
|
1595
|
+
break;
|
|
1596
|
+
}
|
|
1552
1597
|
onRetry?.(attempt + 1, { error });
|
|
1553
|
-
await sleep(
|
|
1598
|
+
await sleep(delay);
|
|
1554
1599
|
attempt++;
|
|
1555
1600
|
}
|
|
1556
1601
|
}
|
|
1557
1602
|
throw new Error("\uCD5C\uB300 \uB300\uAE30\uC2DC\uAC04\uC744 \uCD08\uACFC\uD588\uC5B4\uC694.");
|
|
1558
1603
|
}
|
|
1604
|
+
function getRetryDelayMs(params) {
|
|
1605
|
+
const delay = params.retryStrategy.getDelayMs(params.attempt);
|
|
1606
|
+
return getBoundedDelayMs({ delay, maxElapsedMs: params.maxElapsedMs, startedAt: params.startedAt });
|
|
1607
|
+
}
|
|
1608
|
+
function getBoundedDelayMs(params) {
|
|
1609
|
+
if (params.maxElapsedMs == null) {
|
|
1610
|
+
return params.delay;
|
|
1611
|
+
}
|
|
1612
|
+
const remainingMs = params.maxElapsedMs - (Date.now() - params.startedAt);
|
|
1613
|
+
if (remainingMs <= 0) {
|
|
1614
|
+
return -1;
|
|
1615
|
+
}
|
|
1616
|
+
return Math.min(params.delay, remainingMs);
|
|
1617
|
+
}
|
|
1559
1618
|
|
|
1560
1619
|
// src/utils/upload.ts
|
|
1561
1620
|
var debug2 = (0, import_debug2.default)("cli:deploy");
|
|
1621
|
+
var DEFAULT_DEPLOY_TIMEOUT_SECONDS = 100;
|
|
1622
|
+
var MIN_DEPLOY_TIMEOUT_SECONDS = 10;
|
|
1623
|
+
var MAX_DEPLOY_TIMEOUT_SECONDS = 300;
|
|
1624
|
+
var DEPLOY_STATUS_INITIAL_POLLING_DELAY_MS = 5e3;
|
|
1625
|
+
var DEPLOY_STATUS_INITIAL_RETRY_INTERVAL_MS = 1e4;
|
|
1626
|
+
var DEPLOY_STATUS_MAX_POLLING_INTERVAL_MS = 3e4;
|
|
1562
1627
|
async function uploadArtifact(config) {
|
|
1563
1628
|
debug2("uploadArtifact", config);
|
|
1564
1629
|
return flowAsync(uploadStart(), uploadArtifactToRemote(), uploadComplete(), checkBundleStatus())(config);
|
|
@@ -1623,9 +1688,19 @@ function uploadComplete() {
|
|
|
1623
1688
|
return config;
|
|
1624
1689
|
};
|
|
1625
1690
|
}
|
|
1626
|
-
function checkBundleStatus(
|
|
1691
|
+
function checkBundleStatus(option = {}) {
|
|
1692
|
+
const {
|
|
1693
|
+
initialDelayMs = DEPLOY_STATUS_INITIAL_POLLING_DELAY_MS,
|
|
1694
|
+
maxRetries = Number.POSITIVE_INFINITY,
|
|
1695
|
+
retryStrategy = new ExponentialBackOffRetryStrategy({
|
|
1696
|
+
initialDelayMs: DEPLOY_STATUS_INITIAL_RETRY_INTERVAL_MS,
|
|
1697
|
+
maxDelayMs: DEPLOY_STATUS_MAX_POLLING_INTERVAL_MS
|
|
1698
|
+
})
|
|
1699
|
+
} = option;
|
|
1627
1700
|
return async (config) => {
|
|
1628
1701
|
const baseUrl = config.baseUrl ?? DEFAULT_API_BASE_URL;
|
|
1702
|
+
const timeoutSeconds = config.timeoutSeconds ?? DEFAULT_DEPLOY_TIMEOUT_SECONDS;
|
|
1703
|
+
const timeoutMs = timeoutSeconds * 1e3;
|
|
1629
1704
|
function assertBuildNotFailed(config2, reviewStatus2) {
|
|
1630
1705
|
if (reviewStatus2 === "BUILD_FAILED") {
|
|
1631
1706
|
throw new Error(
|
|
@@ -1649,7 +1724,9 @@ function checkBundleStatus(delayMs = 1e4, maxRetries = 10) {
|
|
|
1649
1724
|
}
|
|
1650
1725
|
const reviewStatus = await withRetry(pollBundleStatus, {
|
|
1651
1726
|
maxRetries,
|
|
1652
|
-
|
|
1727
|
+
initialDelayMs,
|
|
1728
|
+
maxElapsedMs: timeoutMs,
|
|
1729
|
+
retryStrategy,
|
|
1653
1730
|
shouldRetryOnResult: (reviewStatus2) => reviewStatus2 === "BUILDING" || reviewStatus2 === "PREPARE",
|
|
1654
1731
|
shouldRetryOnError: () => false,
|
|
1655
1732
|
onRetry: (attempt, info) => debug2("checkBundleStatus: retry", { attempt, ...info })
|
|
@@ -1659,6 +1736,21 @@ function checkBundleStatus(delayMs = 1e4, maxRetries = 10) {
|
|
|
1659
1736
|
}
|
|
1660
1737
|
|
|
1661
1738
|
// src/DeployCommand.ts
|
|
1739
|
+
function parseDeployTimeoutSeconds(timeout) {
|
|
1740
|
+
if (timeout == null) {
|
|
1741
|
+
return DEFAULT_DEPLOY_TIMEOUT_SECONDS;
|
|
1742
|
+
}
|
|
1743
|
+
const timeoutSeconds = Number(timeout);
|
|
1744
|
+
if (!Number.isInteger(timeoutSeconds)) {
|
|
1745
|
+
throw new Error("--timeout\uC740 \uC815\uC218(\uCD08)\uB85C \uC785\uB825\uD574\uC8FC\uC138\uC694.");
|
|
1746
|
+
}
|
|
1747
|
+
if (timeoutSeconds < MIN_DEPLOY_TIMEOUT_SECONDS || timeoutSeconds > MAX_DEPLOY_TIMEOUT_SECONDS) {
|
|
1748
|
+
throw new Error(
|
|
1749
|
+
`--timeout\uC740 ${MIN_DEPLOY_TIMEOUT_SECONDS}\uCD08 \uC774\uC0C1 ${MAX_DEPLOY_TIMEOUT_SECONDS}\uCD08 \uC774\uD558\uB85C \uC785\uB825\uD574\uC8FC\uC138\uC694.`
|
|
1750
|
+
);
|
|
1751
|
+
}
|
|
1752
|
+
return timeoutSeconds;
|
|
1753
|
+
}
|
|
1662
1754
|
var DeployCommand = class extends Command2 {
|
|
1663
1755
|
static paths = [["deploy"]];
|
|
1664
1756
|
static usage = Command2.Usage({
|
|
@@ -1669,6 +1761,7 @@ var DeployCommand = class extends Command2 {
|
|
|
1669
1761
|
["\uD2B9\uC815 .ait \uD30C\uC77C \uBC30\uD3EC", "ait deploy --location ./dist/my-app.ait"],
|
|
1670
1762
|
["\uD504\uB85C\uD544\uC5D0 \uC800\uC7A5\uB41C \uD1A0\uD070\uC73C\uB85C \uBC30\uD3EC", "ait deploy --profile dev"],
|
|
1671
1763
|
["\uCD9C\uC2DC \uBA54\uBAA8\uC640 \uD568\uAED8 \uBC30\uD3EC", 'ait deploy -m "\uCD9C\uC2DC \uBA54\uBAA8(\uCD5C\uB300 1000\uC790)"'],
|
|
1764
|
+
["\uBC30\uD3EC \uC0C1\uD0DC \uD655\uC778 \uCD5C\uB300 \uB300\uAE30\uC2DC\uAC04 \uC9C0\uC815", "ait deploy --timeout 100"],
|
|
1672
1765
|
["\uBC30\uD3EC \uACB0\uACFC scheme\uB9CC \uCD9C\uB825", "ait deploy --scheme-only"]
|
|
1673
1766
|
]
|
|
1674
1767
|
});
|
|
@@ -1700,6 +1793,10 @@ var DeployCommand = class extends Command2 {
|
|
|
1700
1793
|
required: false,
|
|
1701
1794
|
description: "\uCD9C\uC2DC \uBA54\uBAA8\uB97C \uC785\uB825\uD574\uC694. \uCD5C\uB300 1000\uC790\uAE4C\uC9C0 \uC785\uB825\uD560 \uC218 \uC788\uC5B4\uC694."
|
|
1702
1795
|
});
|
|
1796
|
+
timeout = Option.String("--timeout", {
|
|
1797
|
+
required: false,
|
|
1798
|
+
description: `\uBC30\uD3EC \uC0C1\uD0DC \uD655\uC778\uC744 \uAE30\uB2E4\uB9B4 \uCD5C\uB300 \uC2DC\uAC04(\uCD08)\uC744 \uC785\uB825\uD574\uC694. \uAE30\uBCF8\uAC12\uC740 ${DEFAULT_DEPLOY_TIMEOUT_SECONDS}\uCD08, \uCD5C\uB300\uAC12\uC740 ${MAX_DEPLOY_TIMEOUT_SECONDS}\uCD08\uC608\uC694.`
|
|
1799
|
+
});
|
|
1703
1800
|
async execute() {
|
|
1704
1801
|
const baseUrl = this.baseUrl;
|
|
1705
1802
|
const profile = this.profile || this.workspace || "default";
|
|
@@ -1714,6 +1811,7 @@ var DeployCommand = class extends Command2 {
|
|
|
1714
1811
|
if (this.memo != null && this.memo.length > 1e3) {
|
|
1715
1812
|
throw new Error("memo\uB294 \uCD5C\uB300 1000\uC790\uAE4C\uC9C0 \uC785\uB825\uD560 \uC218 \uC788\uC5B4\uC694.");
|
|
1716
1813
|
}
|
|
1814
|
+
const timeoutSeconds = parseDeployTimeoutSeconds(this.timeout);
|
|
1717
1815
|
const resolvedArtifactPath = this.getArtifactPath(this.location);
|
|
1718
1816
|
const buffer = fs8.readFileSync(resolvedArtifactPath);
|
|
1719
1817
|
const format = AppsInTossBundle.detect(buffer);
|
|
@@ -1755,7 +1853,8 @@ var DeployCommand = class extends Command2 {
|
|
|
1755
1853
|
deploymentId,
|
|
1756
1854
|
apiKey,
|
|
1757
1855
|
memo: this.memo,
|
|
1758
|
-
baseUrl
|
|
1856
|
+
baseUrl,
|
|
1857
|
+
timeoutSeconds
|
|
1759
1858
|
});
|
|
1760
1859
|
} else {
|
|
1761
1860
|
await p4.tasks([
|
|
@@ -1768,7 +1867,8 @@ var DeployCommand = class extends Command2 {
|
|
|
1768
1867
|
deploymentId,
|
|
1769
1868
|
apiKey,
|
|
1770
1869
|
memo: this.memo,
|
|
1771
|
-
baseUrl
|
|
1870
|
+
baseUrl,
|
|
1871
|
+
timeoutSeconds
|
|
1772
1872
|
});
|
|
1773
1873
|
return `${colorAppName} \uBC30\uD3EC\uAC00 \uC644\uB8CC\uB418\uC5C8\uC5B4\uC694`;
|
|
1774
1874
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.9.1",
|
|
5
5
|
"description": "CLI for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"typecheck": "tsc --noEmit",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@apps-in-toss/ait-format": "1.0.0",
|
|
46
|
-
"@apps-in-toss/plugins": "2.
|
|
47
|
-
"@apps-in-toss/web-config": "2.
|
|
46
|
+
"@apps-in-toss/plugins": "2.9.1",
|
|
47
|
+
"@apps-in-toss/web-config": "2.9.1",
|
|
48
48
|
"@clack/prompts": "^0.10.0",
|
|
49
49
|
"@granite-js/utils": "1.0.20",
|
|
50
50
|
"@sentry/cli": "^2.46.0",
|