@leverege/build-tools 2.93.3-beta.4 → 2.93.3-beta.6
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
package/src/artifacts/Utils.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { parseYamlFile, err, warning, debug, shellCmd } from '../Utils.mjs'
|
|
|
8
8
|
|
|
9
9
|
import { ArtifactTypeEnum, ArtifactsSchema, GenericArtifactSchema } from './Structs.mjs'
|
|
10
10
|
|
|
11
|
-
const getArtifactsSchema = async ( artifactsFilePath = './artifacts.
|
|
11
|
+
const getArtifactsSchema = async ( artifactsFilePath = './artifacts.yaml' ) => {
|
|
12
12
|
const artifactsConfig = await parseYamlFile( artifactsFilePath )
|
|
13
13
|
const [ error, result ] = validate( artifactsConfig, ArtifactsSchema )
|
|
14
14
|
if ( error ) {
|
|
@@ -13,8 +13,8 @@ import { GenericArtifactPuller } from './ArtifactPuller.mjs'
|
|
|
13
13
|
program
|
|
14
14
|
.name( 'pull-artifact' )
|
|
15
15
|
.description( 'Pull artifacts from GCP Artifact Registry' )
|
|
16
|
-
.option( '-f, --file <path>', 'Path to artifacts.yaml file', './artifacts.yaml' )
|
|
17
|
-
.option( '-a, --artifact <artifact-path>', 'GCP artifact path' )
|
|
16
|
+
.option( '-f, --file-path <file-path>', 'Path to artifacts.yaml file', './artifacts.yaml' )
|
|
17
|
+
.option( '-a, --artifact-path <artifact-path>', 'GCP artifact path' )
|
|
18
18
|
.parse()
|
|
19
19
|
|
|
20
20
|
const options = program.opts()
|
|
@@ -25,8 +25,8 @@ async function main() {
|
|
|
25
25
|
|
|
26
26
|
let filteredArtifactsSchema = flattenedArtifactsSchema
|
|
27
27
|
|
|
28
|
-
if ( options.
|
|
29
|
-
const artifactPathElements = options.
|
|
28
|
+
if ( options.artifactPath ) {
|
|
29
|
+
const artifactPathElements = options.artifactPath.split( '/' )
|
|
30
30
|
|
|
31
31
|
if ( artifactPathElements.length !== 5 ) {
|
|
32
32
|
warning( 'Invalid artifact path, it must be in the format <project>/<location>/<repository>/<package>/<version>' )
|
|
@@ -13,8 +13,8 @@ import { GenericArtifactPusher } from './ArtifactPusher.mjs'
|
|
|
13
13
|
program
|
|
14
14
|
.name( 'push-artifact' )
|
|
15
15
|
.description( 'Push artifacts to GCP Artifact Registry' )
|
|
16
|
-
.option( '-f, --file <path>', 'Path to artifacts.yaml file', './artifacts.yaml' )
|
|
17
|
-
.option( '-a, --artifact <artifact-path>', 'GCP artifact path' )
|
|
16
|
+
.option( '-f, --file-path <file-path>', 'Path to artifacts.yaml file', './artifacts.yaml' )
|
|
17
|
+
.option( '-a, --artifact-path <artifact-path>', 'GCP artifact path' )
|
|
18
18
|
.parse()
|
|
19
19
|
|
|
20
20
|
const options = program.opts()
|
|
@@ -25,8 +25,8 @@ async function main() {
|
|
|
25
25
|
|
|
26
26
|
let filteredArtifactsSchema = flattenedArtifactsSchema
|
|
27
27
|
|
|
28
|
-
if ( options.
|
|
29
|
-
const artifactPathElements = options.
|
|
28
|
+
if ( options.artifactPath ) {
|
|
29
|
+
const artifactPathElements = options.artifactPath.split( '/' )
|
|
30
30
|
if ( artifactPathElements.length !== 5 ) {
|
|
31
31
|
warning( 'Invalid artifact path, it must be in the format <project>/<location>/<repository>/<package>/<version>' )
|
|
32
32
|
return false
|