generator-reshow 0.17.75 → 0.17.77
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/docker/index.js +1 -1
- package/generators/docker/templates/Dockerfile +3 -3
- package/generators/docker/templates/_circleci/config.yml +21 -9
- package/generators/docker/templates/bin/enter.sh +1 -1
- package/generators/docker/templates/compile.sh +11 -0
- package/generators/docker/templates/docker/{entrypoint.sh → sbin/entrypoint.sh} +1 -1
- package/generators/docker/templates/install-packages.sh +1 -0
- package/generators/npm/index.js +4 -2
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ module.exports = class extends YoGenerator {
|
|
|
26
26
|
* https://github.com/SBoudrias/Inquirer.js
|
|
27
27
|
*/
|
|
28
28
|
async prompting() {
|
|
29
|
-
const {
|
|
29
|
+
const { handleAnswers, promptChainAll } = YoHelper(this);
|
|
30
30
|
|
|
31
31
|
const prompts = [
|
|
32
32
|
...commonPrompt.mainName(this),
|
|
@@ -7,9 +7,9 @@ ARG VERSION
|
|
|
7
7
|
# apk
|
|
8
8
|
COPY ./install-packages.sh /usr/local/bin/install-packages
|
|
9
9
|
RUN apk update && apk add bash bc \
|
|
10
|
-
&& INSTALL_VERSION=$VERSION install-packages \
|
|
10
|
+
&& INSTALL_VERSION=$VERSION INSTALL_TARGETPLATFORM=$TARGETPLATFORM install-packages \
|
|
11
11
|
&& rm /usr/local/bin/install-packages;
|
|
12
12
|
|
|
13
|
-
COPY ./docker/
|
|
14
|
-
ENTRYPOINT ["/entrypoint.sh"]
|
|
13
|
+
COPY ./docker/sbin /usr/local/sbin
|
|
14
|
+
ENTRYPOINT ["/usr/local/sbin/entrypoint.sh"]
|
|
15
15
|
CMD ["server"]
|
|
@@ -3,18 +3,24 @@ version: 2.1
|
|
|
3
3
|
commands:
|
|
4
4
|
install-docker-buildx:
|
|
5
5
|
description: Install Docker Buildx
|
|
6
|
+
parameters:
|
|
7
|
+
docker-tag:
|
|
8
|
+
type: string
|
|
9
|
+
buildx-version:
|
|
10
|
+
type: string
|
|
11
|
+
default: v0.11.2
|
|
6
12
|
steps:
|
|
7
13
|
- run:
|
|
8
14
|
name: Install Docker Buildx
|
|
9
15
|
command: |
|
|
10
16
|
mkdir -vp ~/.docker/cli-plugins/
|
|
11
|
-
curl --silent -L "https://github.com/docker/buildx/releases/download
|
|
17
|
+
curl --silent -L "https://github.com/docker/buildx/releases/download/<< parameters.buildx-version >>/buildx-<< parameters.buildx-version >>.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
|
|
12
18
|
chmod a+x ~/.docker/cli-plugins/docker-buildx
|
|
13
19
|
docker buildx version
|
|
14
20
|
sudo apt-get update && sudo apt-get install -y binfmt-support qemu-user-static
|
|
15
21
|
docker run --rm --privileged tonistiigi/binfmt --install arm64
|
|
16
22
|
docker context create buildcontext
|
|
17
|
-
docker buildx create buildcontext --use
|
|
23
|
+
docker buildx create --name joyful-<< parameters.docker-tag >>- --append buildcontext --use
|
|
18
24
|
|
|
19
25
|
executors:
|
|
20
26
|
docker-publisher:
|
|
@@ -29,7 +35,7 @@ jobs:
|
|
|
29
35
|
steps:
|
|
30
36
|
- checkout
|
|
31
37
|
- setup_remote_docker:
|
|
32
|
-
version: 20.10.
|
|
38
|
+
version: 20.10.24
|
|
33
39
|
docker_layer_caching: true
|
|
34
40
|
- run:
|
|
35
41
|
name: "Test with terratest"
|
|
@@ -46,7 +52,7 @@ jobs:
|
|
|
46
52
|
steps:
|
|
47
53
|
- checkout
|
|
48
54
|
- setup_remote_docker:
|
|
49
|
-
version: 20.10.
|
|
55
|
+
version: 20.10.24
|
|
50
56
|
docker_layer_caching: true
|
|
51
57
|
- run:
|
|
52
58
|
name: Log time
|
|
@@ -68,10 +74,8 @@ jobs:
|
|
|
68
74
|
cat ${BUILD_FOLDER}/$file
|
|
69
75
|
echo ""
|
|
70
76
|
done
|
|
71
|
-
- install-docker-buildx
|
|
72
|
-
|
|
73
|
-
name: login
|
|
74
|
-
command: ./compile.sh login
|
|
77
|
+
- install-docker-buildx:
|
|
78
|
+
docker-tag: << parameters.docker-tag >>
|
|
75
79
|
- run:
|
|
76
80
|
name: build Docker image
|
|
77
81
|
command: |
|
|
@@ -90,15 +94,23 @@ jobs:
|
|
|
90
94
|
LATEST_TAG="-t $IMAGE_NAME:latest"
|
|
91
95
|
fi
|
|
92
96
|
echo "Build ARGS: ${BUILD_ARG}"
|
|
97
|
+
docker pull $IMAGE_NAME:${BUILD_VERSION} || true
|
|
93
98
|
docker buildx inspect --bootstrap
|
|
99
|
+
echo "# ------ Start to Login ------ #"
|
|
100
|
+
./compile.sh login
|
|
101
|
+
./compile.sh rate
|
|
102
|
+
echo "# ------ End to Login ------ #"
|
|
94
103
|
docker buildx build ${BUILD_ARG} -f ${BUILD_FOLDER}/Dockerfile \
|
|
104
|
+
--cache-to=type=inline,mode=all \
|
|
105
|
+
--cache-from $IMAGE_NAME:${BUILD_VERSION} \
|
|
95
106
|
--push \
|
|
107
|
+
--progress=plain \
|
|
96
108
|
--platform linux/amd64,linux/arm64/v8 \
|
|
97
109
|
-t $IMAGE_NAME:${BUILD_VERSION} ${LATEST_TAG} \
|
|
98
110
|
./${BUILD_FOLDER}
|
|
99
111
|
./compile.sh updateDockerHubDesc
|
|
100
112
|
- run:
|
|
101
|
-
name: logout
|
|
113
|
+
name: logout
|
|
102
114
|
command: docker logout
|
|
103
115
|
|
|
104
116
|
workflows:
|
|
@@ -20,7 +20,7 @@ containerName=${localImage//\//-}-${pid}
|
|
|
20
20
|
echo $containerName
|
|
21
21
|
|
|
22
22
|
cli='env docker run --rm -it'
|
|
23
|
-
cli+=" -v $DIR/../docker/
|
|
23
|
+
cli+=" -v $DIR/../docker/sbin:/usr/local/sbin"
|
|
24
24
|
cli+=" -v $MY_PWD:$MY_PWD"
|
|
25
25
|
cli+=" -w $MY_PWD"
|
|
26
26
|
cli+=" --entrypoint sh"
|
|
@@ -74,6 +74,14 @@ updateDockerHubDesc() {
|
|
|
74
74
|
echo $RESULT
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
getRateLimit() {
|
|
78
|
+
# https://docs.docker.com/docker-hub/download-rate-limit/
|
|
79
|
+
token=$(curl -s --user "${DOCKER_LOGIN}:${DOCKER_PASSWORD}" "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
|
|
80
|
+
curl -s -I \
|
|
81
|
+
-H "Authorization: Bearer $token" \
|
|
82
|
+
"https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest" | grep "ratelimit-"
|
|
83
|
+
}
|
|
84
|
+
|
|
77
85
|
push() {
|
|
78
86
|
login
|
|
79
87
|
PUSH_VERSION=${1:-$VERSION}
|
|
@@ -147,6 +155,9 @@ case "$1" in
|
|
|
147
155
|
updateDockerHubDesc)
|
|
148
156
|
updateDockerHubDesc
|
|
149
157
|
;;
|
|
158
|
+
rate)
|
|
159
|
+
getRateLimit
|
|
160
|
+
;;
|
|
150
161
|
p)
|
|
151
162
|
push $2 $3
|
|
152
163
|
;;
|
package/generators/npm/index.js
CHANGED
|
@@ -55,7 +55,7 @@ module.exports = class extends YoGenerator {
|
|
|
55
55
|
writing() {
|
|
56
56
|
this.env.options.nodePackageManager = "yarn";
|
|
57
57
|
const { cp, chMainName } = YoHelper(this);
|
|
58
|
-
const { isUseBabel, isUseBabelUI } = this.payload || {};
|
|
58
|
+
const { isUseBabel, isUseBabelUI, babelRootMode } = this.payload || {};
|
|
59
59
|
|
|
60
60
|
// handle change to new folder
|
|
61
61
|
chMainName(this.mainName);
|
|
@@ -64,7 +64,9 @@ module.exports = class extends YoGenerator {
|
|
|
64
64
|
cp("README.md", null, this.payload);
|
|
65
65
|
cp(".gitignore", null, this.payload);
|
|
66
66
|
if (isUseBabel) {
|
|
67
|
-
|
|
67
|
+
if (null == babelRootMode) {
|
|
68
|
+
cp("babel.config.js");
|
|
69
|
+
}
|
|
68
70
|
if (isUseBabelUI) {
|
|
69
71
|
cp("ui-src", "src");
|
|
70
72
|
cp("UITest.js", "src/ui/pages/__tests__/IndexTest.js", this.payload);
|
package/package.json
CHANGED