@leverege/build-tools 2.47.0 → 2.47.2
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/package.json +1 -1
- package/src/Docker.mjs +3 -5
- package/src/docker-to-registry.mjs +16 -4
- package/src/k8cryo.sh +7 -2
package/package.json
CHANGED
package/src/Docker.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import handlebars from 'handlebars'
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
errorExit,
|
|
8
|
+
getDateTimestamp,
|
|
8
9
|
getGcpAccount,
|
|
9
10
|
log,
|
|
10
11
|
proceed,
|
|
@@ -129,12 +130,9 @@ dunm() {
|
|
|
129
130
|
}
|
|
130
131
|
`
|
|
131
132
|
|
|
132
|
-
// Just uses the old dockreate of formatting the date.
|
|
133
|
-
const dateTimestamp = await shellCmd( 'date +%Y%m%d-%H%M' )
|
|
134
|
-
|
|
135
133
|
const defaultSettings = {
|
|
136
134
|
apkadds : '',
|
|
137
|
-
date :
|
|
135
|
+
date : getDateTimestamp(),
|
|
138
136
|
nodeimage : 'iron-alpine',
|
|
139
137
|
npmlogging : '--silent',
|
|
140
138
|
pluginfile : '# NO PLUGIN',
|
|
@@ -292,7 +290,7 @@ const repoCleanup = async () => {
|
|
|
292
290
|
|
|
293
291
|
fs.writeFileSync( 'docker/.gitignore', '.previous\nDockerfile' )
|
|
294
292
|
|
|
295
|
-
await shellCmd( 'git add docker' )
|
|
293
|
+
await shellCmd( 'git add -f docker' )
|
|
296
294
|
|
|
297
295
|
log( `
|
|
298
296
|
${chalk.yellow.bold( '***IMPORTANT***' )}
|
|
@@ -131,7 +131,7 @@ const chart = helmChart?.yaml['Chart.yaml']
|
|
|
131
131
|
const values = helmChart?.yaml['values.yaml']
|
|
132
132
|
const expectedChartRegistry = `${artifactRegistry}/images`
|
|
133
133
|
|
|
134
|
-
if ( expectedChartRegistry !== values.image
|
|
134
|
+
if ( expectedChartRegistry !== values.image?.registry ) {
|
|
135
135
|
log( `
|
|
136
136
|
${chalk.red.bold( '***Error: mismatched package.json registry and helm/values.yaml' )}
|
|
137
137
|
|
|
@@ -142,12 +142,23 @@ if ( expectedChartRegistry !== values.image.registry ) {
|
|
|
142
142
|
|
|
143
143
|
Current settings:
|
|
144
144
|
package.json registry => ${chalk.yellow.bold( artifactRegistry )}
|
|
145
|
-
values.yaml registry => ${chalk.red.bold( values.image
|
|
145
|
+
values.yaml registry => ${chalk.red.bold( values.image?.registry )}
|
|
146
146
|
|
|
147
147
|
Expected settings:
|
|
148
148
|
values.yaml registry => ${chalk.green.bold( expectedChartRegistry )}
|
|
149
149
|
` )
|
|
150
150
|
|
|
151
|
+
if ( !values.image ) {
|
|
152
|
+
log( `
|
|
153
|
+
${chalk.yellow.bold( '***DEPRECATED: legacy helm charts detected' )}
|
|
154
|
+
|
|
155
|
+
The helm chart structure appears to be based on the pre-ignition helm chart
|
|
156
|
+
layouts. The charts must be upgraded before docker-to-registry can complete
|
|
157
|
+
its job.
|
|
158
|
+
|
|
159
|
+
` )
|
|
160
|
+
}
|
|
161
|
+
|
|
151
162
|
process.exit( 1 )
|
|
152
163
|
}
|
|
153
164
|
|
|
@@ -224,9 +235,10 @@ if ( isNpmWorkspace ) {
|
|
|
224
235
|
await docker.buildContainerImage( { artifactProject, artifactRegistry, containerName, imageVersion, isNpmWorkspace } )
|
|
225
236
|
|
|
226
237
|
if ( willGitTag ) {
|
|
227
|
-
log( chalk.green.bold( `Tagging and Pushing ${imageVersion}\n` ) )
|
|
228
238
|
const tagDescription = `docker_${imageVersion}`
|
|
229
|
-
|
|
239
|
+
const fullImageTag = repoDescr.isMonoRepo ? `${repoDescr.containerName}/${imageVersion}` : imageVersion
|
|
240
|
+
log( chalk.green.bold( `Tagging and Pushing ${fullImageTag}\n` ) )
|
|
241
|
+
await shellCmd( `git tag -f ${fullImageTag} -m ${tagDescription}` )
|
|
230
242
|
await shellCmd( 'git push --follow-tags' )
|
|
231
243
|
} else {
|
|
232
244
|
log( chalk.yellow.bold( '\n*** Skipped git tagging - beta release' ) )
|
package/src/k8cryo.sh
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
#
|
|
3
3
|
. `build-tools --bashfun`
|
|
4
4
|
|
|
5
|
+
daysToKeep=${1:-60}
|
|
6
|
+
let hoursToKeep="$daysToKeep*24"
|
|
7
|
+
printf "\ncryo backup set to keep for $daysToKeep days / $hoursToKeep hours\n"
|
|
8
|
+
|
|
5
9
|
if [ "`basename $0`" == "k8thaw" ];
|
|
6
10
|
then
|
|
7
11
|
errorExit "k8thaw - UNDER CONSTRUCTION"
|
|
@@ -11,5 +15,6 @@ fi
|
|
|
11
15
|
# generating the Date Time Stamp for scheduled backups.
|
|
12
16
|
DTS="`date -u +\"%Y%m%d%H%M%S\"`"
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
printf "\nExecuting = > velero backup create velero-cryo-$DTS --ttl ${hoursToKeep}h\n"
|
|
19
|
+
|
|
20
|
+
velero backup create velero-cryo-$DTS --ttl ${hoursToKeep}h
|