@leverege/build-tools 2.83.3 → 2.83.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.83.3",
3
+ "version": "2.83.5",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
package/src/Docker.mjs CHANGED
@@ -7,6 +7,7 @@ import handlebars from 'handlebars'
7
7
 
8
8
  import {
9
9
  errorExit,
10
+ getCleanTag,
10
11
  getDateTimestamp,
11
12
  getGcpAccount,
12
13
  log,
@@ -222,7 +223,8 @@ const buildContainerImage = async ( repoDescr ) => {
222
223
 
223
224
  setPreviousBuild( imageVersion ) // update docker/.previous file
224
225
 
225
- const { fullName : imageBuilder } = await getGcpAccount()
226
+ const { fullName } = await getGcpAccount()
227
+ const imageBuilder = getCleanTag( fullName )
226
228
  const imageInfoTag = `zzinfo_${defaultSettings.date}_${defaultSettings.nodeimage}_${imageBuilder}`
227
229
  const gcloudProjectNumber = await shellCmd( `gcloud projects describe ${artifactProject} --format="value(projectNumber)"` )
228
230
 
package/src/DockerPy.mjs CHANGED
@@ -10,6 +10,7 @@ import handlebars from 'handlebars'
10
10
 
11
11
  import {
12
12
  errorExit,
13
+ getCleanTag,
13
14
  getDateTimestamp,
14
15
  getGcpAccount,
15
16
  log,
@@ -189,7 +190,8 @@ async function buildContainerImage( {
189
190
 
190
191
  setPreviousBuild( imageVersion ) // update docker/.previous file
191
192
 
192
- const { fullName : imageBuilder } = await getGcpAccount()
193
+ const { fullName } = await getGcpAccount()
194
+ const imageBuilder = getCleanTag( fullName )
193
195
  const imageArch = defaultSettings.buildTag
194
196
  const imageInfoTag = `zzinfo_${imageArch}_${imageBuilder}_${defaultSettings.date}`
195
197
  const gcloudProjectNumber = await shellCmd( `gcloud projects describe ${artifactProject} --format="value(projectNumber)"` )
package/src/Utils.mjs CHANGED
@@ -134,6 +134,12 @@ export const getDateTimestamp = () => {
134
134
  return `${fullDTS.slice( 0, 8 )}-${fullDTS.slice( 8, 12 )}`
135
135
  }
136
136
 
137
+ export const getCleanTag = (str) => {
138
+ // Sanitize string to only include characters allowed in GCP Artifact Registry image tags
139
+ // Allowed characters: abcdefghijklmnopqrstuvwxyz0123456789_-./
140
+ return str.replace(/[^a-zA-Z0-9_\-\.\/]/g, '')
141
+ }
142
+
137
143
  export const getGcpAccount = async () => {
138
144
  const fullAccount = await shellCmd( 'gcloud config get account' )
139
145
  const [ principal, domain ] = fullAccount.split( '@' )
package/src/bash-funcs CHANGED
@@ -155,7 +155,7 @@ REPOADD
155
155
  # *** DEPRECATED *** REMOVE AFTER BITNAMI ERADICATED ***
156
156
  #
157
157
  function addBitnamiRepo() {
158
- warning( '*** the addBitnamiRepo function should be removed - DEPRECATED ***' ) # DEPRECATED
158
+ warning '*** the addBitnamiRepo function should be removed - DEPRECATED ***'
159
159
  if [ ! -z "$BITNAMI_LATEST" ] || [ "$1" == "latest" ];
160
160
  then
161
161
  BITNAMI_URL="https://charts.bitnami.com/bitnami"