generator-reshow 0.17.70 → 0.17.72

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.
@@ -28,7 +28,7 @@ echo "###"
28
28
  echo ""
29
29
  echo $UPGRADE
30
30
 
31
- apk add --virtual .build-deps $BUILD_DEPS && apk add $INSTALL --upgrade $UPGRADE
31
+ apk add --virtual .build-deps $BUILD_DEPS && apk add $INSTALL --upgrade $UPGRADE || exit 2
32
32
 
33
33
  #/* put your install code here */#
34
34
 
@@ -18,6 +18,7 @@ describe("!! gitlab-docker !!", () => {
18
18
  isReady: true,
19
19
  description: "foo-desc",
20
20
  keyword: "foo-keyword",
21
+ tags: "",
21
22
  },
22
23
  });
23
24
  });
@@ -33,7 +34,7 @@ describe("!! gitlab-docker !!", () => {
33
34
  });
34
35
 
35
36
  it("should have file", () => {
36
- assert.file([".gitlab-ci.yml", ".gitlab-trigger.yml"]);
37
+ assert.file([".gitlab-ci.yml", ".gitlab/.gitlab-trigger.yml"]);
37
38
  });
38
39
 
39
40
  it("should have content", () => {
@@ -26,15 +26,17 @@ module.exports = class extends YoGenerator {
26
26
  * https://github.com/SBoudrias/Inquirer.js
27
27
  */
28
28
  async prompting() {
29
- const {
30
- handleAnswers,
31
- promptChainAll,
32
- } = YoHelper(this);
29
+ const { handleAnswers, promptChainAll } = YoHelper(this);
33
30
 
34
31
  const prompts = [
35
32
  ...commonPrompt.mainName(this),
36
33
  ...commonPrompt.desc(this),
37
34
  ...commonDockerPrompt(this),
35
+ {
36
+ type: "input",
37
+ name: "tags",
38
+ message: "Please input your gitlab tags and separate by comma",
39
+ },
38
40
  ];
39
41
 
40
42
  const answers = await promptChainAll(prompts);
@@ -51,15 +53,26 @@ module.exports = class extends YoGenerator {
51
53
  writing() {
52
54
  this.env.options.nodePackageManager = "yarn";
53
55
  this.options.skipInstall = true;
54
- const { cp, chMainName } = YoHelper(this);
56
+ const { cp, chMainName } = YoHelper(this);
55
57
 
56
58
  // handle change to new folder
57
59
  chMainName(this.mainName);
58
60
 
61
+ if (this.payload.tags) {
62
+ let tags = this.payload.tags;
63
+ if (tags.split) {
64
+ tags = this.payload.tags.split(",");
65
+ this.payload.tags = tags;
66
+ }
67
+ this.payload.tagJson = JSON.stringify(tags.map((item) => item.trim()));
68
+ } else {
69
+ this.payload.tagJson = "";
70
+ }
71
+
59
72
  // handle copy file
60
73
  cp("Dockerfile", null, this.payload);
61
74
  cp("README.md", null, this.payload);
62
75
  cp(".gitlab-ci.yml", null, this.payload);
63
- cp(".gitlab-trigger.yml", null, this.payload);
76
+ cp(".gitlab/.gitlab-trigger.yml", null, this.payload);
64
77
  }
65
78
  };
@@ -6,22 +6,20 @@ stages:
6
6
  - deploy
7
7
 
8
8
  variables:
9
- LATEST_TAG: <%= verPrefix %>0.0.0
9
+ LATEST_TAG: 0.0.0
10
10
  LAST_IMAGE_STORE: ./last-image
11
11
 
12
12
  .parallel:
13
13
  parallel:
14
14
  matrix:
15
- - dockerTag: [<%= verPrefix %>0.0.0]
15
+ - dockerTag: [0.0.0]
16
16
 
17
17
  default:
18
18
  before_script:
19
19
  - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
20
20
  after_script:
21
21
  - docker logout
22
- tags:
23
- - swarm-cluster
24
- - docker
22
+ tags: <%= tagJson %>
25
23
 
26
24
  # https://docs.gitlab.com/ee/ci/yaml/index.html
27
25
  info-section:
@@ -29,8 +27,8 @@ info-section:
29
27
  stage: info
30
28
  script:
31
29
  - echo "Display Information"
30
+ - export
32
31
  - date
33
- - echo "$CI_PIPELINE_ID"
34
32
 
35
33
  pre-test:
36
34
  stage: test
@@ -50,7 +48,8 @@ build-docker-image:
50
48
  - echo $IMAGE_NAME > $LAST_IMAGE_STORE
51
49
  - echo $IMAGE_NAME
52
50
  - echo 'Start build docker images:' $dockerTag
53
- - DOCKER_BUILDKIT=1 docker build -f Dockerfile --target $dockerTag -t $IMAGE_NAME .
51
+ # - DOCKER_BUILDKIT=1 docker build -f Dockerfile --target $dockerTag -t $IMAGE_NAME .
52
+ - DOCKER_BUILDKIT=1 docker build -f Dockerfile -t $IMAGE_NAME .
54
53
  - docker images | head -10 || trap '' PIPE
55
54
  - docker push $IMAGE_NAME
56
55
  artifacts:
@@ -62,7 +61,7 @@ e2e-test:
62
61
  needs: ["build-docker-image"]
63
62
  trigger:
64
63
  include:
65
- - local: .gitlab-trigger.yml
64
+ - local: .gitlab/.gitlab-trigger.yml
66
65
 
67
66
  put-to-stable:
68
67
  extends: .parallel
@@ -21,14 +21,16 @@
21
21
  "reshow-unit": "*"
22
22
  },
23
23
  "scripts": {
24
- "clean": "find ./build -name '*.*' | xargs rm -rf",
25
- "build:cjs": "BABEL_ENV=cjs babel src -d build/cjs/src --root-mode upward",
26
- "build:es": "BABEL_ENV=es babel src -d build/es/src --root-mode upward",
27
- "build": "npm run clean && npm run build:cjs && npm run build:es",
28
- "mochaFor": "mocha -r jsdom-global/register",
29
- "mocha": "npm run mochaFor -- 'build/cjs/**/__tests__/*.js'",
24
+ "build:cjs": "BABEL_ENV=cjs babel src -d build/cjs/src --ignore /**/__tests__ --root-mode upward",
25
+ "build:es": "BABEL_ENV=es babel src -d build/es/src --out-file-extension .mjs --root-mode upward",
26
+ "build:type": "npx -p typescript tsc src/*.js --declaration --allowJs --emitDeclarationOnly --skipLibCheck --declarationDir types",
27
+ "build": "npm run clean && npm run build:cjs && npm run build:es && npm run build:type",
28
+ "mochaFor": "mocha -r global-jsdom/register",
29
+ "mocha": "npm run mochaFor -- 'build/es/**/__tests__/*.mjs'",
30
+ "test:report": "npm run build && npm run mochaFor -- --reporter mocha-junit-reporter --reporter-options mochaFile=./test_output/mocha.xml 'build/es/**/__tests__/*.mjs'",
30
31
  "test": "npm run build && npm run mocha",
31
32
  "prepublishOnly": "npm run test"
32
33
  },
33
- "files": ["build", "package.json", "README.md"]
34
+ "types": "./types/index.d.ts",
35
+ "files": ["types", "build", "package.json", "README.md"]
34
36
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.17.70",
2
+ "version": "0.17.72",
3
3
  "name": "generator-reshow",
4
4
  "repository": {
5
5
  "type": "git",