@leverege/build-tools 1.11.3 → 1.12.0
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/server/git-tar +89 -0
- package/lib/server/helmup +18 -1
- package/package.json +1 -1
- package/src/git-tar +89 -0
- package/src/helmup +18 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# If it isn't already set use the default ~/work/.gitar
|
|
4
|
+
#
|
|
5
|
+
[ -z $GITAR ] && GITAR="${HOME}/.gitar"
|
|
6
|
+
|
|
7
|
+
if [ ! -d $GITAR ]
|
|
8
|
+
then
|
|
9
|
+
cat<<GITAR
|
|
10
|
+
|
|
11
|
+
*** Either set \$GITAR to point to the directory for storing the tarballs
|
|
12
|
+
*** or mkdir $GITAR and we will use that instead.
|
|
13
|
+
|
|
14
|
+
GITAR
|
|
15
|
+
exit 2
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
TARX="$GITAR/AAA_TarExcludes"
|
|
19
|
+
|
|
20
|
+
# Might be nice to eventually build this up from the .gitignore files or
|
|
21
|
+
# maybe the output from git ls-files --others --ignore --exclude-standard
|
|
22
|
+
if [ ! -f $TARX ]
|
|
23
|
+
then
|
|
24
|
+
cat<<TARX
|
|
25
|
+
|
|
26
|
+
*** Missing $TARX
|
|
27
|
+
|
|
28
|
+
*** This file is used to contain a list of files to exclude from the
|
|
29
|
+
*** tarball. Creating with default list of:
|
|
30
|
+
|
|
31
|
+
*.o
|
|
32
|
+
*.so
|
|
33
|
+
core.*
|
|
34
|
+
node_modules
|
|
35
|
+
TARX
|
|
36
|
+
|
|
37
|
+
cat > $TARX <<DEFX
|
|
38
|
+
*.o
|
|
39
|
+
*.so
|
|
40
|
+
core.*
|
|
41
|
+
node_modules
|
|
42
|
+
DEFX
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
# Ask git for the root directory of the repository,
|
|
46
|
+
GTOP=`git rev-parse --show-toplevel 2> /dev/null`
|
|
47
|
+
|
|
48
|
+
if [ $? != 0 ];
|
|
49
|
+
then
|
|
50
|
+
cat<<NOGIT
|
|
51
|
+
|
|
52
|
+
*** Are you sure this is a git repository?
|
|
53
|
+
|
|
54
|
+
NOGIT
|
|
55
|
+
exit 2
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
REPO=`basename ${GTOP}`
|
|
59
|
+
|
|
60
|
+
# Create the repo tarball dir if needed
|
|
61
|
+
#
|
|
62
|
+
[ ! -d $GITAR/$REPO ] && mkdir $GITAR/$REPO
|
|
63
|
+
|
|
64
|
+
# Build a date time string of YYYYMMDD-HHMMSS
|
|
65
|
+
#
|
|
66
|
+
DTS="`date +\"%Y%m%d-%H%M%S\"`"
|
|
67
|
+
|
|
68
|
+
TARB=${GITAR}/${REPO}/${DTS}.tar # Craft the target tarball name.
|
|
69
|
+
|
|
70
|
+
# Now do the work
|
|
71
|
+
#
|
|
72
|
+
cd ${GTOP}/..
|
|
73
|
+
printf "\n*** Tarring $TARB\n"
|
|
74
|
+
tar cf $TARB -X $TARX $REPO
|
|
75
|
+
chmod 0640 $TARB
|
|
76
|
+
|
|
77
|
+
# Do the compression and use xz if it's available
|
|
78
|
+
#
|
|
79
|
+
ZIPPER=bzip2
|
|
80
|
+
FIZ=bz2
|
|
81
|
+
if (type xz 2>&1) >/dev/null
|
|
82
|
+
then
|
|
83
|
+
ZIPPER=xz
|
|
84
|
+
FIZ=xz
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
printf "*** Compressing $TARB.$FIZ (background)\n\n"
|
|
88
|
+
$ZIPPER $TARB &
|
|
89
|
+
cd - 2>&1 >/dev/null
|
package/lib/server/helmup
CHANGED
|
@@ -191,7 +191,7 @@ function installKeel() {
|
|
|
191
191
|
|
|
192
192
|
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
|
193
193
|
SLACK_BOT_NAME="`overwhelm -k SLACK_BOT_NAME`"
|
|
194
|
-
[ -z "$SLACK_BOT_NAME" ] && SLACK_BOT_NAME=$BRANCH
|
|
194
|
+
[[ -z "$SLACK_BOT_NAME" || "$SLACK_BOT_NAME" == "undefined" ]] && SLACK_BOT_NAME=$BRANCH
|
|
195
195
|
SLACK_TOKEN="$LEV_KEYS/$BRANCH/slack-bot-token"
|
|
196
196
|
[ ! -f "$SLACK_TOKEN" ] &&
|
|
197
197
|
keelNeeds "Missing slack bot token => `color c $SLACK_TOKEN`"
|
|
@@ -224,6 +224,23 @@ NOMUSEUM
|
|
|
224
224
|
fi
|
|
225
225
|
|
|
226
226
|
GITTOP=`git rev-parse --show-toplevel` && cd $GITTOP
|
|
227
|
+
if [ -d "${GITTOP}/k8-utils" ];
|
|
228
|
+
then
|
|
229
|
+
cat<<BADK8
|
|
230
|
+
|
|
231
|
+
$YELO_WARN The k8_utils directory should be renamed to k8s_utils
|
|
232
|
+
|
|
233
|
+
This repository has the old k8_util directory name in place. Please rename
|
|
234
|
+
it to the newer k8s_utils directory that `color c helmup` will be looking for.
|
|
235
|
+
|
|
236
|
+
Run this => `color g "git mv k8-utils k8s-utils; git add k8*utils"`
|
|
237
|
+
|
|
238
|
+
$YELO_WARN Don't forget to commit and push after the renaming.
|
|
239
|
+
|
|
240
|
+
BADK8
|
|
241
|
+
exit 1
|
|
242
|
+
fi
|
|
243
|
+
|
|
227
244
|
K8S_UTILS="${GITTOP}/k8s-utils"
|
|
228
245
|
if [ ! -d "$K8S_UTILS" ];
|
|
229
246
|
then
|
package/package.json
CHANGED
package/src/git-tar
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# If it isn't already set use the default ~/work/.gitar
|
|
4
|
+
#
|
|
5
|
+
[ -z $GITAR ] && GITAR="${HOME}/.gitar"
|
|
6
|
+
|
|
7
|
+
if [ ! -d $GITAR ]
|
|
8
|
+
then
|
|
9
|
+
cat<<GITAR
|
|
10
|
+
|
|
11
|
+
*** Either set \$GITAR to point to the directory for storing the tarballs
|
|
12
|
+
*** or mkdir $GITAR and we will use that instead.
|
|
13
|
+
|
|
14
|
+
GITAR
|
|
15
|
+
exit 2
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
TARX="$GITAR/AAA_TarExcludes"
|
|
19
|
+
|
|
20
|
+
# Might be nice to eventually build this up from the .gitignore files or
|
|
21
|
+
# maybe the output from git ls-files --others --ignore --exclude-standard
|
|
22
|
+
if [ ! -f $TARX ]
|
|
23
|
+
then
|
|
24
|
+
cat<<TARX
|
|
25
|
+
|
|
26
|
+
*** Missing $TARX
|
|
27
|
+
|
|
28
|
+
*** This file is used to contain a list of files to exclude from the
|
|
29
|
+
*** tarball. Creating with default list of:
|
|
30
|
+
|
|
31
|
+
*.o
|
|
32
|
+
*.so
|
|
33
|
+
core.*
|
|
34
|
+
node_modules
|
|
35
|
+
TARX
|
|
36
|
+
|
|
37
|
+
cat > $TARX <<DEFX
|
|
38
|
+
*.o
|
|
39
|
+
*.so
|
|
40
|
+
core.*
|
|
41
|
+
node_modules
|
|
42
|
+
DEFX
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
# Ask git for the root directory of the repository,
|
|
46
|
+
GTOP=`git rev-parse --show-toplevel 2> /dev/null`
|
|
47
|
+
|
|
48
|
+
if [ $? != 0 ];
|
|
49
|
+
then
|
|
50
|
+
cat<<NOGIT
|
|
51
|
+
|
|
52
|
+
*** Are you sure this is a git repository?
|
|
53
|
+
|
|
54
|
+
NOGIT
|
|
55
|
+
exit 2
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
REPO=`basename ${GTOP}`
|
|
59
|
+
|
|
60
|
+
# Create the repo tarball dir if needed
|
|
61
|
+
#
|
|
62
|
+
[ ! -d $GITAR/$REPO ] && mkdir $GITAR/$REPO
|
|
63
|
+
|
|
64
|
+
# Build a date time string of YYYYMMDD-HHMMSS
|
|
65
|
+
#
|
|
66
|
+
DTS="`date +\"%Y%m%d-%H%M%S\"`"
|
|
67
|
+
|
|
68
|
+
TARB=${GITAR}/${REPO}/${DTS}.tar # Craft the target tarball name.
|
|
69
|
+
|
|
70
|
+
# Now do the work
|
|
71
|
+
#
|
|
72
|
+
cd ${GTOP}/..
|
|
73
|
+
printf "\n*** Tarring $TARB\n"
|
|
74
|
+
tar cf $TARB -X $TARX $REPO
|
|
75
|
+
chmod 0640 $TARB
|
|
76
|
+
|
|
77
|
+
# Do the compression and use xz if it's available
|
|
78
|
+
#
|
|
79
|
+
ZIPPER=bzip2
|
|
80
|
+
FIZ=bz2
|
|
81
|
+
if (type xz 2>&1) >/dev/null
|
|
82
|
+
then
|
|
83
|
+
ZIPPER=xz
|
|
84
|
+
FIZ=xz
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
printf "*** Compressing $TARB.$FIZ (background)\n\n"
|
|
88
|
+
$ZIPPER $TARB &
|
|
89
|
+
cd - 2>&1 >/dev/null
|
package/src/helmup
CHANGED
|
@@ -191,7 +191,7 @@ function installKeel() {
|
|
|
191
191
|
|
|
192
192
|
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
|
193
193
|
SLACK_BOT_NAME="`overwhelm -k SLACK_BOT_NAME`"
|
|
194
|
-
[ -z "$SLACK_BOT_NAME" ] && SLACK_BOT_NAME=$BRANCH
|
|
194
|
+
[[ -z "$SLACK_BOT_NAME" || "$SLACK_BOT_NAME" == "undefined" ]] && SLACK_BOT_NAME=$BRANCH
|
|
195
195
|
SLACK_TOKEN="$LEV_KEYS/$BRANCH/slack-bot-token"
|
|
196
196
|
[ ! -f "$SLACK_TOKEN" ] &&
|
|
197
197
|
keelNeeds "Missing slack bot token => `color c $SLACK_TOKEN`"
|
|
@@ -224,6 +224,23 @@ NOMUSEUM
|
|
|
224
224
|
fi
|
|
225
225
|
|
|
226
226
|
GITTOP=`git rev-parse --show-toplevel` && cd $GITTOP
|
|
227
|
+
if [ -d "${GITTOP}/k8-utils" ];
|
|
228
|
+
then
|
|
229
|
+
cat<<BADK8
|
|
230
|
+
|
|
231
|
+
$YELO_WARN The k8_utils directory should be renamed to k8s_utils
|
|
232
|
+
|
|
233
|
+
This repository has the old k8_util directory name in place. Please rename
|
|
234
|
+
it to the newer k8s_utils directory that `color c helmup` will be looking for.
|
|
235
|
+
|
|
236
|
+
Run this => `color g "git mv k8-utils k8s-utils; git add k8*utils"`
|
|
237
|
+
|
|
238
|
+
$YELO_WARN Don't forget to commit and push after the renaming.
|
|
239
|
+
|
|
240
|
+
BADK8
|
|
241
|
+
exit 1
|
|
242
|
+
fi
|
|
243
|
+
|
|
227
244
|
K8S_UTILS="${GITTOP}/k8s-utils"
|
|
228
245
|
if [ ! -d "$K8S_UTILS" ];
|
|
229
246
|
then
|