@leverege/build-tools 2.67.3-beta.13 → 2.67.3-beta.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.67.3-beta.13",
3
+ "version": "2.67.3-beta.2",
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
@@ -175,7 +175,7 @@ const validateCloudBuildBucket = async ( artifactProject ) => {
175
175
 
176
176
  const buildContainerImage = async ( {
177
177
  artifactProject, artifactRegistry, containerName,
178
- imageVersion, isNpmWorkspace, options
178
+ imageVersion, imagePlatform, isNpmWorkspace, options
179
179
  } ) => {
180
180
  const buildWorkspace = './build/workspace' // passed to Cloud Build
181
181
  const imageName = `${artifactRegistry}/images/${containerName}`
@@ -219,7 +219,7 @@ const buildContainerImage = async ( {
219
219
  // build the cloudbuild.yaml from the handlebars template
220
220
  const cloudBuildFile = './build/cloudbuild.yaml'
221
221
  const cbst = handlebars.compile( cloudBuildSteps, { noEscape : true } )
222
- const cbs = cbst( { artifactProject, artifactRegistry, imageName, imageVersion, imageInfoTag, } )
222
+ const cbs = cbst( { artifactProject, artifactRegistry, imageName, imageVersion, imageInfoTag, imagePlatform } )
223
223
  fs.writeFileSync( cloudBuildFile, cbs )
224
224
 
225
225
  // build up the cloud build command and options
package/src/DockerPy.mjs CHANGED
@@ -161,8 +161,8 @@ async function validateCloudBuildBucket( artifactProject ) {
161
161
  }
162
162
 
163
163
  async function buildContainerImage( {
164
- artifactProject, artifactRegistry, containerName,
165
- imageVersion, imagePlatform, isNpmWorkspace, options
164
+ artifactProject, artifactRegistry, containerName,
165
+ imageVersion, isNpmWorkspace, options
166
166
  } ) {
167
167
  const buildWorkspace = './build/workspace' // passed to Cloud Build
168
168
  const imageName = `${artifactRegistry}/images/${containerName}`
@@ -195,7 +195,7 @@ async function buildContainerImage( {
195
195
  // build the cloudbuild.yaml from the handlebars template
196
196
  const cloudBuildFile = './build/cloudbuild.yaml'
197
197
  const cbst = handlebars.compile( cloudBuildSteps, { noEscape : true } )
198
- const cbs = cbst( { artifactProject, artifactRegistry, imageName, imageVersion, imageInfoTag, imagePlatform } )
198
+ const cbs = cbst( { artifactProject, artifactRegistry, imageName, imageVersion, imageInfoTag, } )
199
199
  fs.writeFileSync( cloudBuildFile, cbs )
200
200
 
201
201
  // build up the cloud build command and options
@@ -91,9 +91,9 @@ const repoDescr = {
91
91
  containerName : pyproject.project.name,
92
92
  packageVersion : `v${pyproject.project.version}`,
93
93
  artifactRegistry : pyproject.leverege.registry || 'us-docker.pkg.dev/leverege-registry/stack',
94
- // registryFolder : `${pyproject.leverege['registry-folder']}/images/${pyproject.project.name}`, Not being used
94
+ registryFolder : `${pyproject.leverege['registry-folder']}/images/${pyproject.project.name}`,
95
95
  imageBase : pyproject.leverege['image-base'],
96
- imagePlatform : pyproject.leverege['image-platform'] || 'linux/amd64',
96
+ imagePlatform : pyproject.leverege['image-platform'],
97
97
  helmChart : await parseHelmChart(),
98
98
  }
99
99
 
@@ -215,7 +215,6 @@ log( `
215
215
  ${chalk.green.bold( 'Build Information:' )}
216
216
  Container: ${chalk.green.bold( containerName )}
217
217
  Version: ${chalk.green.bold( imageVersion )} ${tagInfo}
218
- Platform: ${chalk.green.bold( repoDescr.imagePlatform )}
219
218
  Registry: ${chalk.green.bold( artifactRegistry )}
220
219
  Image Folder: ${chalk.yellow.bold( registryFolder )}
221
220
 
@@ -273,7 +272,7 @@ if ( willGitTag ) {
273
272
  await proceed()
274
273
 
275
274
  log( chalk.green.bold( 'Building the Docker Image...' ) )
276
- await Docker.buildContainerImage( { ...repoDescr, imagePlatformList : [ repoDescr.imagePlatform.split( '/' )[0] ], options, imageVersion } )
275
+ await Docker.buildContainerImage( { ...repoDescr, options, imageVersion } )
277
276
  log( chalk.blue.bold( 'Done Building the Docker Image...' ) )
278
277
 
279
278
  if ( willGitTag ) {
@@ -2,20 +2,14 @@ options:
2
2
  machineType: E2_HIGHCPU_8
3
3
 
4
4
  steps:
5
- {{#each imagePlatformList}}
6
5
  - name: 'gcr.io/cloud-builders/docker'
7
6
  entrypoint: 'bash'
8
- args: ['-c', 'docker pull --platform={{this}} {{imageName}}:latest || exit 0']
9
- waitFor: ['-']
10
- {{/each}}
11
-
12
- - name: 'gcr.io/cloud-builders/docker'
13
- args: ['buildx', 'create', '--driver', 'docker-container', '--name', 'container', '--driver-opt', 'network=cloudbuild', '--use']
7
+ args: ['-c', 'docker pull {{imageName}}:latest || exit 0']
14
8
 
15
9
  - name: 'gcr.io/cloud-builders/docker'
16
10
  args:
17
- - 'buildx'
18
11
  - 'build'
12
+ - '--platform={{imagePlatform}}'
19
13
  - '--network=cloudbuild'
20
14
  - '-t'
21
15
  - '{{imageName}}:{{imageVersion}}'