generator-reshow 0.17.12 → 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,3 +2,5 @@ sourceImage=<%= sourceImage %>
2
2
  targetImage=<%= targetImage %>
3
3
  VERSION=0.0
4
4
  FOLDER_PREFIX=<%= folderPrefix %>
5
+ COPY_FILES[]=install-packages.sh
6
+ DOCKER_FILES[]=Dockerfile
@@ -7,5 +7,5 @@ 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.sh \
10
+ && INSTALL_VERSION=$VERSION install-packages \
11
11
  && rm /usr/local/bin/install-packages;
@@ -24,8 +24,19 @@ jobs:
24
24
  name: Gen Docker file
25
25
  command: |
26
26
  FOLDER_PREFIX=$(support/FOLDER_PREFIX.sh)
27
+ DOCKER_FILES=$(support/DOCKER_FILES.sh)
28
+ FOLDER=${FOLDER_PREFIX}<< parameters.docker-tag >>
27
29
  ./build.sh << parameters.docker-tag >>
28
- ls -la ${FOLDER_PREFIX}<< 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
29
40
  - run:
30
41
  name: build Docker image
31
42
  command: |
@@ -6,22 +6,29 @@ DIR="$(
6
6
  )"
7
7
 
8
8
  FOLDER_PREFIX=$(${DIR}/support/FOLDER_PREFIX.sh)
9
+ COPY_FILES=$(${DIR}/support/COPY_FILES.sh)
10
+ DOCKER_FILES=$(${DIR}/support/DOCKER_FILES.sh)
9
11
  BUILD_VERSION=$1
10
12
 
11
13
  if [ -z "$BUILD_VERSION" ]; then
12
14
  echo "Not set build version."
13
- exit 1;
15
+ exit 1
14
16
  fi
15
17
 
16
18
  do_build() {
19
+ echo 'building --- Version: ' $BUILD_VERSION '-->'
17
20
  DEST_FOLDER=${DIR}/${FOLDER_PREFIX}${BUILD_VERSION}
18
21
  mkdir -p ${DEST_FOLDER}
19
- echo 'building --- Version: ' $BUILD_VERSION '-->'
20
- DEST_FILE=${DEST_FOLDER}/Dockerfile
21
- cp Dockerfile ${DEST_FILE}
22
- cp install-packages.sh ${DEST_FOLDER}
23
- sed -i -e "s|\[VERSION\]|$BUILD_VERSION|g" ${DEST_FILE}
24
- if [ -e "${DEST_FILE}-e" ]; then rm ${DEST_FILE}-e; fi
22
+
23
+ for file in $COPY_FILES; do [ -e "$file" ] && cp $file ${DEST_FOLDER}; done
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 "$COPY_FILES" ]; then
10
+ COPY_FILES=$(awk -F "=" '/^COPY_FILES\[\]/ {print $2}' $ENV)
11
+ fi
12
+
13
+ echo $COPY_FILES
@@ -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
@@ -1,8 +1,12 @@
1
1
  #!/bin/bash
2
- DIR="$( cd "$(dirname "$0")" ; pwd -P )"
2
+ DIR="$(
3
+ cd "$(dirname "$0")"
4
+ pwd -P
5
+ )"
6
+ ENV=${DIR}/../.env.build
3
7
 
4
8
  if [ -z $FOLDER_PREFIX ]; then
5
- FOLDER_PREFIX=$(awk -F "=" '/^FOLDER_PREFIX/ {print $2}' ${DIR}/../.env.build)
9
+ FOLDER_PREFIX=$(awk -F "=" '/^FOLDER_PREFIX/ {print $2}' $ENV)
6
10
  fi
7
11
 
8
12
  echo $FOLDER_PREFIX
@@ -1,8 +1,9 @@
1
1
  #!/bin/bash
2
2
  DIR="$( cd "$(dirname "$0")" ; pwd -P )"
3
+ ENV=${DIR}/../.env.build
3
4
 
4
5
  if [ -z $VERSION ]; then
5
- VERSION=$(awk -F "=" '/^VERSION/ {print $2}' ${DIR}/../.env.build)
6
+ VERSION=$(awk -F "=" '/^VERSION/ {print $2}' $ENV)
6
7
  fi
7
8
 
8
9
  echo $VERSION
@@ -1,8 +1,12 @@
1
1
  #!/bin/bash
2
- DIR="$( cd "$(dirname "$0")" ; pwd -P )"
2
+ DIR="$(
3
+ cd "$(dirname "$0")"
4
+ pwd -P
5
+ )"
6
+ ENV=${DIR}/../.env.build
3
7
 
4
8
  if [ -z $sourceImage ]; then
5
- sourceImage=$(awk -F "=" '/^sourceImage/ {print $2}' ${DIR}/../.env.build)
9
+ sourceImage=$(awk -F "=" '/^sourceImage/ {print $2}' $ENV)
6
10
  fi
7
11
 
8
12
  echo $sourceImage
@@ -1,8 +1,12 @@
1
1
  #!/bin/bash
2
- DIR="$( cd "$(dirname "$0")" ; pwd -P )"
2
+ DIR="$(
3
+ cd "$(dirname "$0")"
4
+ pwd -P
5
+ )"
6
+ ENV=${DIR}/../.env.build
3
7
 
4
8
  if [ -z $targetImage ]; then
5
- targetImage=$(awk -F "=" '/^targetImage/ {print $2}' ${DIR}/../.env.build)
9
+ targetImage=$(awk -F "=" '/^targetImage/ {print $2}' $ENV)
6
10
  fi
7
11
 
8
12
  echo $targetImage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-reshow",
3
- "version": "0.17.12",
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": {