generator-reshow 0.17.71 → 0.17.73
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/generators/gitlab-docker/__tests__/Test.js +2 -1
- package/generators/gitlab-docker/index.js +19 -6
- package/generators/gitlab-docker/templates/.gitlab-ci.yml +7 -8
- package/generators/library/templates/package.json +10 -7
- package/package.json +1 -1
- /package/generators/gitlab-docker/templates/{.gitlab-trigger.yml → .gitlab/.gitlab-trigger.yml} +0 -0
|
@@ -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,
|
|
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:
|
|
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: [
|
|
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,17 @@
|
|
|
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": "
|
|
28
|
-
"
|
|
29
|
-
"
|
|
24
|
+
"clean": "find ./build ./types -name '*.*' | xargs rm -rf",
|
|
25
|
+
"build:cjs": "BABEL_ENV=cjs babel src -d build/cjs/src --ignore /**/__tests__ --root-mode upward",
|
|
26
|
+
"build:es": "BABEL_ENV=es babel src -d build/es/src --out-file-extension .mjs --root-mode upward",
|
|
27
|
+
"build:type": "npx -p typescript tsc src/*.js --declaration --allowJs --emitDeclarationOnly --skipLibCheck --declarationDir types",
|
|
28
|
+
"build": "npm run clean && npm run build:cjs && npm run build:es && npm run build:type",
|
|
29
|
+
"mochaFor": "mocha -r global-jsdom/register",
|
|
30
|
+
"mocha": "npm run mochaFor -- 'build/es/**/__tests__/*.mjs'",
|
|
31
|
+
"test:report": "npm run build && npm run mochaFor -- --reporter mocha-junit-reporter --reporter-options mochaFile=./test_output/mocha.xml 'build/es/**/__tests__/*.mjs'",
|
|
30
32
|
"test": "npm run build && npm run mocha",
|
|
31
33
|
"prepublishOnly": "npm run test"
|
|
32
34
|
},
|
|
33
|
-
"
|
|
35
|
+
"types": "./types/index.d.ts",
|
|
36
|
+
"files": ["types", "build", "package.json", "README.md"]
|
|
34
37
|
}
|
package/package.json
CHANGED
/package/generators/gitlab-docker/templates/{.gitlab-trigger.yml → .gitlab/.gitlab-trigger.yml}
RENAMED
|
File without changes
|