@constructor-io/constructorio-connect-cli 1.0.3 → 1.0.4

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.
@@ -0,0 +1,53 @@
1
+ # === Deploy workflow ===
2
+ #
3
+ # This workflow allows you to deploy your templates to a desired environment.
4
+ # The outcome should be similar to running `npm run deploy` with the correct credentials.
5
+ #
6
+ # This workflow can be triggered from the GitHub Actions tab. Just open the actions tab,
7
+ # select the workflow, and click the "Run workflow" button. Then, select your desired
8
+ # environment and confirm the deployment.
9
+ #
10
+ # Only one deployment per environment can run at a time. If a deployment is already in
11
+ # progress, triggering a new deployment will cancel the previous one.
12
+ #
13
+ # ❗️ To use this, ensure you have the `CONNECT_AUTH_TOKEN` GitHub secret configured
14
+ # with the correct auth token you used during the CLI initialization.
15
+
16
+ name: Deploy
17
+
18
+ on:
19
+ workflow_dispatch:
20
+ inputs:
21
+ environment:
22
+ description: Environment to deploy to
23
+ required: true
24
+ type: choice
25
+ options:
26
+ - development
27
+ - qa
28
+ - production
29
+ - demo
30
+
31
+ concurrency:
32
+ group: deploy-${{ github.event.inputs.environment }}
33
+ cancel-in-progress: true
34
+
35
+ jobs:
36
+ deploy:
37
+ name: Deploy to ${{ github.event.inputs.environment }}
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+
42
+ - name: Setup node
43
+ uses: actions/setup-node@v4
44
+ with:
45
+ node-version: 18
46
+
47
+ - name: Install dependencies
48
+ run: npm ci
49
+
50
+ - name: Deploy
51
+ run: npm run deploy ${{ github.event.inputs.environment }}
52
+ env:
53
+ CONNECT_AUTH_TOKEN: ${{ secrets.CONNECT_AUTH_TOKEN }}
@@ -13,6 +13,7 @@ This repository was created using the [constructorio-connect-cli CLI](https://ww
13
13
  - [`npm run execute [FLAGS]`](#npm-run-execute-flags)
14
14
  - [Testing templates](#testing-templates)
15
15
  - [Deploying Templates](#deploying-templates)
16
+ - [Deploying via GitHub Actions](#deploying-via-github-actions)
16
17
  - [`npm run deploy ENV`](#npm-run-deploy-env)
17
18
  - [Developing Templates](#developing-templates)
18
19
  - [➡️ Expected Transformer Implementation](#️-expected-transformer-implementation)
@@ -94,6 +95,14 @@ _This section is under active development and will be updated soon. Keep an eye
94
95
 
95
96
  Once you have developed and tested your templates, you can deploy them to the Constructor Connect platform. To do this, you can use the `deploy` command.
96
97
 
98
+ ## Deploying via GitHub Actions
99
+
100
+ This repository is pre-configured to deploy templates to Constructor Connect using GitHub Actions. To do this, you will need to set up the following secrets in your GitHub repository:
101
+
102
+ - `CONNECT_AUTH_TOKEN`: Your Constructor Connect Auth token. It's the same used to initialize this repo.
103
+
104
+ After setting up the secrets, you can run the `Deploy` workflow from the Actions tab in your repository.
105
+
97
106
  ## `npm run deploy ENV`
98
107
 
99
108
  ```
@@ -2,6 +2,14 @@
2
2
 
3
3
  const connections = "{{REPLACE_CONNECTIONS}}";
4
4
 
5
+ /**
6
+ * Defines your CLI configuration.
7
+ *
8
+ * This object maps your Constructor indexes to your templates, effectively enabling you to have
9
+ * multiple environments, multiple templates per environment and per index.
10
+ *
11
+ * @type {import("@constructor-io/constructorio-connect-cli/dist/types").Config}
12
+ */
5
13
  const config = "{{REPLACE_CONFIG}}";
6
14
 
7
15
  module.exports = config;
@@ -19,7 +19,6 @@
19
19
  "author": "",
20
20
  "license": "ISC",
21
21
  "dependencies": {
22
- "@constructor-io/constructorio-connect-cli": "latest",
23
- "dotenv": "^16.4.5"
22
+ "@constructor-io/constructorio-connect-cli": "latest"
24
23
  }
25
24
  }
@@ -125,5 +125,5 @@
125
125
  ]
126
126
  }
127
127
  },
128
- "version": "1.0.3"
128
+ "version": "1.0.4"
129
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-connect-cli",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "CLI tool to enable users to interface with the Constructor Connect Ecosystem",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -65,6 +65,7 @@
65
65
  "@oclif/plugin-help": "^6.0.21",
66
66
  "axios": "^1.6.8",
67
67
  "cli-highlight": "^2.1.11",
68
+ "dotenv": "^16.4.5",
68
69
  "fs-extra": "^11.2.0",
69
70
  "json-stringify-pretty-compact": "^3.0.0",
70
71
  "kleur": "^4.1.5",
@@ -75,7 +76,6 @@
75
76
  "@types/fs-extra": "^11.0.4",
76
77
  "@types/jest": "^29.5.12",
77
78
  "@types/mock-fs": "^4.13.4",
78
- "dotenv": "^16.4.5",
79
79
  "eslint": "^8.57.0",
80
80
  "eslint-config-prettier": "^9.1.0",
81
81
  "eslint-config-standard-with-typescript": "^43.0.1",