@constructor-io/constructorio-connect-cli 1.14.0 → 1.15.0
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/README.md +9 -3
- package/boilerplate-repo/.github/workflows/deploy.yml +8 -3
- package/dist/commands/deploy.d.ts +3 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +23 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/oclif.manifest.json +13 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,18 +43,22 @@ With the new repository initialized, you can start developing your catalog integ
|
|
|
43
43
|
|
|
44
44
|
## `constructorio-connect-cli deploy ENV`
|
|
45
45
|
|
|
46
|
-
Deploys all templates defined on the `connectrc.js` file to the specified environment.
|
|
46
|
+
Deploys all templates defined on the `connectrc.js` file to the specified environment, after running tests ('--force' to skip).
|
|
47
47
|
|
|
48
48
|
```
|
|
49
49
|
USAGE
|
|
50
|
-
$ constructorio-connect-cli deploy ENV
|
|
50
|
+
$ constructorio-connect-cli deploy ENV [-f]
|
|
51
51
|
|
|
52
52
|
ARGUMENTS
|
|
53
53
|
ENV (development|qa|production|demo) The target Constructor environment to deploy to.
|
|
54
54
|
|
|
55
|
+
FLAGS
|
|
56
|
+
-f, --force Skip tests before deploying
|
|
57
|
+
|
|
55
58
|
DESCRIPTION
|
|
56
59
|
|
|
57
|
-
Deploys all templates defined on the `connectrc.js` file to the specified environment
|
|
60
|
+
Deploys all templates defined on the `connectrc.js` file to the specified environment, after running tests ('--force'
|
|
61
|
+
to skip).
|
|
58
62
|
|
|
59
63
|
The script will use the `CONNECT_AUTH_TOKEN` environment variable to authenticate with Constructor.
|
|
60
64
|
|
|
@@ -64,6 +68,8 @@ EXAMPLES
|
|
|
64
68
|
$ constructorio-connect-cli deploy qa
|
|
65
69
|
|
|
66
70
|
$ constructorio-connect-cli deploy production
|
|
71
|
+
|
|
72
|
+
$ constructorio-connect-cli deploy production --force
|
|
67
73
|
```
|
|
68
74
|
|
|
69
75
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
#
|
|
6
6
|
# This workflow can be triggered from the GitHub Actions tab. Just open the actions tab,
|
|
7
7
|
# select the workflow, and click the "Run workflow" button. Then, select your desired
|
|
8
|
-
# environment and confirm the deployment.
|
|
8
|
+
# environment, select if you want to skip tests and confirm the deployment.
|
|
9
9
|
#
|
|
10
10
|
# Only one deployment per environment can run at a time. If a deployment is already in
|
|
11
11
|
# progress, triggering a new deployment will cancel the previous one.
|
|
@@ -27,6 +27,11 @@ on:
|
|
|
27
27
|
- qa
|
|
28
28
|
- production
|
|
29
29
|
- demo
|
|
30
|
+
force:
|
|
31
|
+
description: Skip tests during deployment
|
|
32
|
+
required: false
|
|
33
|
+
type: boolean
|
|
34
|
+
default: false
|
|
30
35
|
|
|
31
36
|
concurrency:
|
|
32
37
|
group: deploy-${{ github.event.inputs.environment }}
|
|
@@ -48,12 +53,12 @@ jobs:
|
|
|
48
53
|
- name: Setup node
|
|
49
54
|
uses: actions/setup-node@v4
|
|
50
55
|
with:
|
|
51
|
-
node-version:
|
|
56
|
+
node-version: "18.18.0"
|
|
52
57
|
|
|
53
58
|
- name: Install dependencies
|
|
54
59
|
run: npm ci
|
|
55
60
|
|
|
56
61
|
- name: Deploy
|
|
57
|
-
run: IS_CI=true npm run deploy ${{ github.event.inputs.environment }}
|
|
62
|
+
run: IS_CI=true npm run deploy ${{ github.event.inputs.environment }} ${{ github.event.inputs.force && '--force' || '' }}
|
|
58
63
|
env:
|
|
59
64
|
CONNECT_AUTH_TOKEN: ${{ secrets.CONNECT_AUTH_TOKEN }}
|
|
@@ -3,6 +3,9 @@ export default class Deploy extends RefreshConnectionsCommand {
|
|
|
3
3
|
static args: {
|
|
4
4
|
env: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
|
+
static flags: {
|
|
7
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
6
9
|
static description: string;
|
|
7
10
|
static examples: string[];
|
|
8
11
|
runCommand(): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,yBAAyB;IAC3D,MAAM,CAAC,IAAI;;MAMT;IAEF,MAAM,CAAC,KAAK;;MAKV;IAEF,MAAM,CAAC,WAAW,SAGqF;IAEvG,MAAM,CAAC,QAAQ,WAKb;IAEI,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC;CA+DjC"}
|
package/dist/commands/deploy.js
CHANGED
|
@@ -13,6 +13,7 @@ const ux_action_1 = require("../helpers/ux-action");
|
|
|
13
13
|
const deploy_request_1 = require("../http/deploy-request");
|
|
14
14
|
const render_tip_1 = require("../rendering/render-tip");
|
|
15
15
|
const refresh_connections_command_1 = require("./refresh-connections-command");
|
|
16
|
+
const child_process_1 = require("child_process");
|
|
16
17
|
class Deploy extends refresh_connections_command_1.RefreshConnectionsCommand {
|
|
17
18
|
static args = {
|
|
18
19
|
env: core_1.Args.string({
|
|
@@ -21,17 +22,37 @@ class Deploy extends refresh_connections_command_1.RefreshConnectionsCommand {
|
|
|
21
22
|
required: true,
|
|
22
23
|
}),
|
|
23
24
|
};
|
|
25
|
+
static flags = {
|
|
26
|
+
force: core_1.Flags.boolean({
|
|
27
|
+
char: "f",
|
|
28
|
+
description: "Skip tests before deploying",
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
24
31
|
static description = `
|
|
25
|
-
Deploys all templates defined on the \`connectrc.js\` file to the specified environment.
|
|
32
|
+
Deploys all templates defined on the \`connectrc.js\` file to the specified environment, after running tests ('--force' to skip).
|
|
26
33
|
|
|
27
34
|
The script will use the \`CONNECT_AUTH_TOKEN\` environment variable to authenticate with Constructor.`;
|
|
28
35
|
static examples = [
|
|
29
36
|
"$ <%= config.bin %> deploy development",
|
|
30
37
|
"$ <%= config.bin %> deploy qa",
|
|
31
38
|
"$ <%= config.bin %> deploy production",
|
|
39
|
+
"$ <%= config.bin %> deploy production --force",
|
|
32
40
|
];
|
|
33
41
|
async runCommand() {
|
|
34
|
-
const { args } = await this.parse(Deploy);
|
|
42
|
+
const { flags, args } = await this.parse(Deploy);
|
|
43
|
+
if (!flags.force) {
|
|
44
|
+
try {
|
|
45
|
+
(0, child_process_1.execSync)("npm run test", {
|
|
46
|
+
stdio: "inherit",
|
|
47
|
+
cwd: process.cwd(),
|
|
48
|
+
});
|
|
49
|
+
this.log(`\n`);
|
|
50
|
+
}
|
|
51
|
+
catch (_) {
|
|
52
|
+
this.log(`\n${kleur_1.default.red("❌ Tests failed!")}\n`);
|
|
53
|
+
throw new errors_1.CLIError(`Tests failed. Fix the tests or use --force to deploy anyway.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
35
56
|
const config = await (0, ux_action_1.uxAction)("📡 Reading your config", async () => {
|
|
36
57
|
return await (0, config_1.getRepositoryConfigFile)();
|
|
37
58
|
})();
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/oclif.manifest.json
CHANGED
|
@@ -15,13 +15,22 @@
|
|
|
15
15
|
"required": true
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"description": "\n Deploys all templates defined on the `connectrc.js` file to the specified environment.\n\n The script will use the `CONNECT_AUTH_TOKEN` environment variable to authenticate with Constructor.",
|
|
18
|
+
"description": "\n Deploys all templates defined on the `connectrc.js` file to the specified environment, after running tests ('--force' to skip).\n\n The script will use the `CONNECT_AUTH_TOKEN` environment variable to authenticate with Constructor.",
|
|
19
19
|
"examples": [
|
|
20
20
|
"$ <%= config.bin %> deploy development",
|
|
21
21
|
"$ <%= config.bin %> deploy qa",
|
|
22
|
-
"$ <%= config.bin %> deploy production"
|
|
22
|
+
"$ <%= config.bin %> deploy production",
|
|
23
|
+
"$ <%= config.bin %> deploy production --force"
|
|
23
24
|
],
|
|
24
|
-
"flags": {
|
|
25
|
+
"flags": {
|
|
26
|
+
"force": {
|
|
27
|
+
"char": "f",
|
|
28
|
+
"description": "Skip tests before deploying",
|
|
29
|
+
"name": "force",
|
|
30
|
+
"allowNo": false,
|
|
31
|
+
"type": "boolean"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
25
34
|
"hasDynamicHelp": false,
|
|
26
35
|
"hiddenAliases": [],
|
|
27
36
|
"id": "deploy",
|
|
@@ -190,5 +199,5 @@
|
|
|
190
199
|
]
|
|
191
200
|
}
|
|
192
201
|
},
|
|
193
|
-
"version": "1.
|
|
202
|
+
"version": "1.15.0"
|
|
194
203
|
}
|
package/package.json
CHANGED