@leverege/build-tools 2.4.3 → 2.4.5
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/lib/web/packleate/Packleator.js +1 -1
- package/lib/web/packleate/index.js +1 -1
- package/package.json +1 -1
- package/src/dockreate +33 -2
- package/src/husky-run +6 -0
|
@@ -80,7 +80,7 @@ var Packleator = /*#__PURE__*/function () {
|
|
|
80
80
|
|
|
81
81
|
var args = options.args;
|
|
82
82
|
this.privatePackages = new Set();
|
|
83
|
-
this.args = args ? _objectSpread({}, args, {
|
|
83
|
+
this.args = args ? _objectSpread(_objectSpread({}, args), {}, {
|
|
84
84
|
output: args.output.substr(-1) === '/' ? args.output.substr(0, args.output.length) : args.output
|
|
85
85
|
}) : {}; // args || {}
|
|
86
86
|
|
package/package.json
CHANGED
package/src/dockreate
CHANGED
|
@@ -4,6 +4,9 @@ if [ -z "$1" ]; then
|
|
|
4
4
|
exit 1
|
|
5
5
|
fi
|
|
6
6
|
|
|
7
|
+
# Global Vars
|
|
8
|
+
pluginFile="Dockerfile.plugin"
|
|
9
|
+
|
|
7
10
|
# cleanup trapper for gracefully killing, which doesn't do much right now
|
|
8
11
|
cleanup() {
|
|
9
12
|
printf "\nCleaning up and exiting...\n\n"
|
|
@@ -50,7 +53,7 @@ create_Dockerfile() {
|
|
|
50
53
|
local nodeimg="${2:-erbium-alpine}"
|
|
51
54
|
local apkadds="${3}"
|
|
52
55
|
echo "Creating the Dockerfile for node ${nodeimg}"
|
|
53
|
-
cat<<
|
|
56
|
+
cat<<DOCKERBLD > Dockerfile
|
|
54
57
|
# Version ${regvers} @ `date`
|
|
55
58
|
#
|
|
56
59
|
# The FROM directive sets the Base Image for subsequent instructions
|
|
@@ -86,6 +89,16 @@ RUN apk update && \
|
|
|
86
89
|
apk add --no-cache tini bash vim ${apkadds} && \
|
|
87
90
|
rm /bin/sh && ln -s /bin/bash /bin/sh && \
|
|
88
91
|
mkdir -p /usr/src/app /tmp/levlog
|
|
92
|
+
DOCKERBLD
|
|
93
|
+
|
|
94
|
+
if [ -f "${pluginFile}" ];
|
|
95
|
+
then
|
|
96
|
+
printf "\n# ${pluginFile} BEGIN\n" >> Dockerfile
|
|
97
|
+
cat $pluginFile >> Dockerfile
|
|
98
|
+
printf "# ${pluginFile} END\n\n" >> Dockerfile
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
cat<<EODOCKER >> Dockerfile
|
|
89
102
|
ENTRYPOINT [ "/sbin/tini", "--" ]
|
|
90
103
|
WORKDIR /usr/src/app
|
|
91
104
|
|
|
@@ -200,7 +213,21 @@ runuser=$(strip_undefined "`node -p \"require('../package.json').leverege.runuse
|
|
|
200
213
|
container="`node -p \"require('../package.json').leverege.container\"`"
|
|
201
214
|
if [ "$container" == "undefined" ];
|
|
202
215
|
then
|
|
203
|
-
|
|
216
|
+
gitremote=`git config --get remote.origin.url`
|
|
217
|
+
if [ -z $gitremote ];
|
|
218
|
+
then
|
|
219
|
+
cat<<NOCONTAINER
|
|
220
|
+
|
|
221
|
+
$(colorize 'red' '***ERROR: attempting to build an unnamed container')
|
|
222
|
+
|
|
223
|
+
You are attempting to create a docker image without a container name or
|
|
224
|
+
a git remote setup. Either define a $(colorize 'yellow' 'container') statement in the leverege
|
|
225
|
+
section of package.json, or add a $(colorize 'green' 'git remote') to this repository.
|
|
226
|
+
|
|
227
|
+
NOCONTAINER
|
|
228
|
+
exit 1
|
|
229
|
+
fi
|
|
230
|
+
container=$(basename $gitremote .git)
|
|
204
231
|
fi
|
|
205
232
|
gcimage=gcr.io/$project/$container
|
|
206
233
|
|
|
@@ -264,12 +291,16 @@ else
|
|
|
264
291
|
tagstat=$(colorize 'red' 'BETA RELEASE WILL NOT BE TAGGED')
|
|
265
292
|
fi
|
|
266
293
|
|
|
294
|
+
pluggedIn=$(colorize 'green' "no")
|
|
295
|
+
[ -f "${pluginFile}" ] && pluggedIn=$(colorize 'yellow' "YES")
|
|
296
|
+
|
|
267
297
|
cat<<IMGINFO
|
|
268
298
|
|
|
269
299
|
Project: $(colorize 'green' "$project")
|
|
270
300
|
Container: $(colorize 'green' "$container")
|
|
271
301
|
NodeImage: $(colorize 'green' "$nodeimg")
|
|
272
302
|
AddedPkgs: $(colorize 'green' "$apkadds")
|
|
303
|
+
PluggedIn: ${pluggedIn}
|
|
273
304
|
Version: $(colorize 'green' "$version") $tagstat
|
|
274
305
|
Run User: $(colorize 'green' "$runuser")
|
|
275
306
|
Previous: $(colorize 'yellow' "$previous")
|