generator-reshow 0.17.15 → 0.17.16

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.
@@ -2,7 +2,9 @@
2
2
 
3
3
  > Docker generator
4
4
 
5
- ## Environment Variables
6
-
5
+ ## Environment Variables
7
6
  * DOCKER_LOGIN
8
7
  * DOCKER_PASSWORD
8
+
9
+ ### circleci sample url
10
+ * https://app.circleci.com/settings/project/github/[git-org]/[git-repository-name]/environment-variables
@@ -2,5 +2,5 @@ sourceImage=<%= sourceImage %>
2
2
  targetImage=<%= targetImage %>
3
3
  VERSION=0.0
4
4
  FOLDER_PREFIX=<%= folderPrefix %>
5
- COPY_FILES[]=Dockerfile
6
5
  COPY_FILES[]=install-packages.sh
6
+ DOCKER_FILES[]=Dockerfile
@@ -20,14 +20,23 @@ jobs:
20
20
  - run:
21
21
  name: Log time
22
22
  command: date
23
- - run: FOLDER_PREFIX=$(support/FOLDER_PREFIX.sh)
24
- FOLDER=${FOLDER_PREFIX}<< parameters.docker-tag >>
25
- ./build.sh << parameters.docker-tag >>
26
- ls -la ${FOLDER}
27
- echo "###"
28
- echo "# --- Dockerfile Content ---"
29
- echo "###"
30
- cat ${FOLDER}/Dockerfile
23
+ - run:
24
+ name: Gen Docker file
25
+ command: |
26
+ FOLDER_PREFIX=$(support/FOLDER_PREFIX.sh)
27
+ DOCKER_FILES=$(support/DOCKER_FILES.sh)
28
+ FOLDER=${FOLDER_PREFIX}<< parameters.docker-tag >>
29
+ ./build.sh << parameters.docker-tag >>
30
+ ls -la ${FOLDER}
31
+ for file in $DOCKER_FILES; do
32
+ echo ""
33
+ echo "###"
34
+ echo "# --- Dockerfile ($file) Content ---"
35
+ echo "###"
36
+ echo ""
37
+ cat ${FOLDER}/$file
38
+ echo ""
39
+ done
31
40
  - run:
32
41
  name: build Docker image
33
42
  command: |
@@ -7,21 +7,28 @@ DIR="$(
7
7
 
8
8
  FOLDER_PREFIX=$(${DIR}/support/FOLDER_PREFIX.sh)
9
9
  COPY_FILES=$(${DIR}/support/COPY_FILES.sh)
10
+ DOCKER_FILES=$(${DIR}/support/DOCKER_FILES.sh)
10
11
  BUILD_VERSION=$1
11
12
 
12
13
  if [ -z "$BUILD_VERSION" ]; then
13
14
  echo "Not set build version."
14
- exit 1;
15
+ exit 1
15
16
  fi
16
17
 
17
18
  do_build() {
19
+ echo 'building --- Version: ' $BUILD_VERSION '-->'
18
20
  DEST_FOLDER=${DIR}/${FOLDER_PREFIX}${BUILD_VERSION}
19
21
  mkdir -p ${DEST_FOLDER}
20
- echo 'building --- Version: ' $BUILD_VERSION '-->'
22
+
21
23
  for file in $COPY_FILES; do [ -e "$file" ] && cp $file ${DEST_FOLDER}; done
22
- DEST_FILE=${DEST_FOLDER}/Dockerfile
23
- sed -i -e "s|\[VERSION\]|$BUILD_VERSION|g" ${DEST_FILE}
24
- if [ -e "${DEST_FILE}-e" ]; then rm ${DEST_FILE}-e; fi
24
+ for file in $DOCKER_FILES; do
25
+ if [ -e "$file" ]; then
26
+ cp $file ${DEST_FOLDER}
27
+ DEST_FILE=${DEST_FOLDER}/$file
28
+ sed -i -e "s|\[VERSION\]|$BUILD_VERSION|g" ${DEST_FILE}
29
+ if [ -e "${DEST_FILE}-e" ]; then rm ${DEST_FILE}-e; fi
30
+ fi
31
+ done
25
32
  }
26
33
 
27
34
  do_build
@@ -70,6 +70,9 @@ build() {
70
70
  if [ ! -z "$VERSION" ]; then
71
71
  BUILD_ARG="$BUILD_ARG --build-arg VERSION=${VERSION}"
72
72
  fi
73
+ if [ ! -z "$ALT_VERSION" ]; then
74
+ BUILD_ARG="$BUILD_ARG --build-arg ALT_VERSION=${ALT_VERSION}"
75
+ fi
73
76
  echo build: ${DIR}/${DOCKER_FILE}
74
77
  if [ "x" != "x$NO_CACHE" ]; then
75
78
  echo nocache: ${NO_CACHE}
@@ -0,0 +1,13 @@
1
+ #!/bin/bash
2
+
3
+ DIR="$(
4
+ cd "$(dirname "$0")"
5
+ pwd -P
6
+ )"
7
+ ENV=${DIR}/../.env.build
8
+
9
+ if [ -z "$DOCKER_FILES" ]; then
10
+ DOCKER_FILES=$(awk -F "=" '/^DOCKER_FILES\[\]/ {print $2}' $ENV)
11
+ fi
12
+
13
+ echo $DOCKER_FILES
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-reshow",
3
- "version": "0.17.15",
3
+ "version": "0.17.16",
4
4
  "description": "Yeoman generator for reshow. (app, generator, ...etc)",
5
5
  "author": "Hill <hill@kimo.com>",
6
6
  "repository": {