@saltcorn/cli 1.4.0 → 1.4.1-beta.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.
@@ -2091,6 +2091,10 @@
2091
2091
  "all",
2092
2092
  "none"
2093
2093
  ]
2094
+ },
2095
+ "tag": {
2096
+ "description": "Docker tag to give this release",
2097
+ "name": "tag"
2094
2098
  }
2095
2099
  },
2096
2100
  "description": "Post-release tasks: docker and vagrant builds",
@@ -2154,19 +2158,15 @@
2154
2158
  "description": "New version number",
2155
2159
  "name": "version",
2156
2160
  "required": true
2157
- }
2158
- },
2159
- "description": "Release a new saltcorn version",
2160
- "flags": {
2161
+ },
2161
2162
  "tag": {
2162
- "char": "t",
2163
- "description": "NPM tag",
2163
+ "description": "NPM tag to give this release",
2164
2164
  "name": "tag",
2165
- "hasDynamicHelp": false,
2166
- "multiple": false,
2167
- "type": "option"
2165
+ "required": true
2168
2166
  }
2169
2167
  },
2168
+ "description": "Release a new saltcorn version",
2169
+ "flags": {},
2170
2170
  "hasDynamicHelp": false,
2171
2171
  "hiddenAliases": [],
2172
2172
  "id": "dev:release",
@@ -2247,5 +2247,5 @@
2247
2247
  ]
2248
2248
  }
2249
2249
  },
2250
- "version": "1.4.0"
2250
+ "version": "1.4.1-beta.1"
2251
2251
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@saltcorn/cli",
3
3
  "description": "Command-line interface for Saltcorn, open-source no-code platform",
4
4
  "homepage": "https://saltcorn.com",
5
- "version": "1.4.0",
5
+ "version": "1.4.1-beta.1",
6
6
  "author": "Tom Nielsen @glutamate",
7
7
  "bin": {
8
8
  "saltcorn": "./bin/saltcorn"
@@ -11,13 +11,13 @@
11
11
  "dependencies": {
12
12
  "@oclif/core": "4.4.0",
13
13
  "@oclif/plugin-plugins": "^5.4.26",
14
- "@saltcorn/admin-models": "1.4.0",
15
- "@saltcorn/common-code": "1.4.0",
16
- "@saltcorn/data": "1.4.0",
17
- "@saltcorn/mobile-app": "1.4.0",
18
- "@saltcorn/mobile-builder": "1.4.0",
19
- "@saltcorn/plugins-loader": "1.4.0",
20
- "@saltcorn/server": "1.4.0",
14
+ "@saltcorn/admin-models": "1.4.1-beta.1",
15
+ "@saltcorn/common-code": "1.4.1-beta.1",
16
+ "@saltcorn/data": "1.4.1-beta.1",
17
+ "@saltcorn/mobile-app": "1.4.1-beta.1",
18
+ "@saltcorn/mobile-builder": "1.4.1-beta.1",
19
+ "@saltcorn/plugins-loader": "1.4.1-beta.1",
20
+ "@saltcorn/server": "1.4.1-beta.1",
21
21
  "contractis": "^0.1.0",
22
22
  "dateformat": "^4.6.3",
23
23
  "inquirer": "^12.3.3",
@@ -42,10 +42,17 @@ class PostReleaseCommand extends Command {
42
42
  get baseRepoDir() {
43
43
  return path.join(__dirname, "..", "..", "..", "..", "..");
44
44
  }
45
- async docker() {
45
+ async docker(tag) {
46
+ if (!tag) {
47
+ console.error("Need tag for docker post-release");
48
+ this.exit(1);
49
+ }
50
+ const env = { ...process.env, TAG: tag };
51
+
46
52
  spawnSync("bash", ["deploy/docker_build_push.sh"], {
47
53
  stdio: "inherit",
48
54
  cwd: this.baseRepoDir,
55
+ env,
49
56
  });
50
57
  }
51
58
  async vagrant() {
@@ -123,18 +130,14 @@ class PostReleaseCommand extends Command {
123
130
  */
124
131
  async run() {
125
132
  const {
126
- args: { task },
133
+ args: { task, tag },
127
134
  } = await this.parse(PostReleaseCommand);
128
- this.version = require(path.join(
129
- __dirname,
130
- "..",
131
- "..",
132
- "..",
133
- "package.json"
134
- )).version;
135
+ this.version = require(
136
+ path.join(__dirname, "..", "..", "..", "package.json")
137
+ ).version;
135
138
  console.log("Version", this.version);
136
139
  if (!this.version) this.exit(1);
137
- if (!task || task === "docker" || task === "all") await this.docker();
140
+ if (!task || task === "docker" || task === "all") await this.docker(tag);
138
141
 
139
142
  if (!task || task === "vagrant" || task === "all") await this.vagrant();
140
143
  this.exit(0);
@@ -154,6 +157,9 @@ PostReleaseCommand.args = {
154
157
  options: ["docker", "vagrant", "all", "none"],
155
158
  description: "What to do",
156
159
  }),
160
+ tag: Args.string({
161
+ description: "Docker tag to give this release",
162
+ }),
157
163
  };
158
164
 
159
165
  module.exports = PostReleaseCommand;
@@ -31,8 +31,7 @@ class ReleaseCommand extends Command {
31
31
  */
32
32
  async run() {
33
33
  const {
34
- args: { version },
35
- flags,
34
+ args: { version, tag },
36
35
  } = await this.parse(ReleaseCommand);
37
36
  runCmd("git", ["pull"], {
38
37
  stdio: "inherit",
@@ -124,8 +123,7 @@ class ReleaseCommand extends Command {
124
123
  });
125
124
  };
126
125
  const publish = async (dir, tags0) => {
127
- const tags = !tags0 ? [] : Array.isArray(tags0) ? tags0 : [tags0];
128
- if (flags.tag) tags.push(flags.tag);
126
+ const tags = !tags0 ? [] : Array.isArray(tags0) ? tags0 : [tags0];
129
127
  const firstTag = tags[0];
130
128
  runCmd(
131
129
  "npm",
@@ -217,7 +215,7 @@ class ReleaseCommand extends Command {
217
215
  stdio: "inherit",
218
216
  cwd: `packages/saltcorn-cli/`,
219
217
  });*/
220
- await publish("saltcorn-cli");
218
+ await publish("saltcorn-cli", tag);
221
219
  fs.writeFileSync(`package.json`, JSON.stringify(rootPackageJson, null, 2));
222
220
  // update Dockerfile
223
221
  const dockerfile = fs.readFileSync(`Dockerfile.release`, "utf8");
@@ -268,12 +266,10 @@ ReleaseCommand.args = {
268
266
  required: true,
269
267
  description: "New version number",
270
268
  }),
271
- };
272
-
273
- ReleaseCommand.flags = {
274
- tag: Flags.string({
275
- char: "t",
276
- description: "NPM tag",
269
+ tag: Args.string({
270
+ required: true,
271
+ description: "NPM tag to give this release",
277
272
  }),
278
273
  };
274
+
279
275
  module.exports = ReleaseCommand;