@leverege/build-tools 2.93.0-beta.12 → 2.93.0-beta.14
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/README.md
CHANGED
|
@@ -18,7 +18,15 @@ npm install -g @leverege/build-tools
|
|
|
18
18
|
```bash
|
|
19
19
|
. `build-tools --bashfun`
|
|
20
20
|
```
|
|
21
|
-
* **docker-to-registry**: used to build and deploy docker images to the GCP
|
|
21
|
+
* **docker-to-registry**: used to build and deploy application docker images to the GCP artifact registry
|
|
22
|
+
* **pull-artifact**: used to pull generic artifacts from the GCP artifact registry
|
|
23
|
+
```bash
|
|
24
|
+
Usage: pull-artifact -f <artifact schema file path> -n <package name> -v <package version>
|
|
25
|
+
```
|
|
26
|
+
* **push-artifact**: used to push generic artifacts to the GCP artifact registry
|
|
27
|
+
```bash
|
|
28
|
+
Usage: push-artifact -f <artifact schema file path> -n <package name> -v <package version>
|
|
29
|
+
```
|
|
22
30
|
|
|
23
31
|
### Helm Helpers:
|
|
24
32
|
* **overwhelm**: a k8s context helper and yaml replacer *${REPLACE_ME}*
|
package/package.json
CHANGED
package/src/artifacts/Utils.mjs
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { program } from 'commander'
|
|
4
|
+
|
|
5
|
+
import { warning, log } from '../Utils.mjs'
|
|
4
6
|
|
|
5
7
|
import { getArtifactsSchema, flattenArtifactsSchema } from './Utils.mjs'
|
|
6
8
|
import { ArtifactTypeEnum } from './Structs.mjs'
|
|
7
9
|
import { GenericArtifactPuller } from './ArtifactPuller.mjs'
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
program
|
|
12
|
+
.name( 'pull-artifact' )
|
|
13
|
+
.description( 'Pull artifacts from GCP Artifact Registry' )
|
|
14
|
+
.requiredOption( '-f, --file-path <path>', 'Path to artifacts.yaml file' )
|
|
15
|
+
.option( '-n, --package-name <name>', 'Filter by artifact package name' )
|
|
16
|
+
.option( '-v, --package-version <version>', 'Filter by artifact package version' )
|
|
17
|
+
.parse()
|
|
10
18
|
|
|
11
|
-
|
|
12
|
-
err( 'Usage:' )
|
|
13
|
-
err( ' pull-artifact.mjs <artifacts.yml>' )
|
|
14
|
-
err( ' pull-artifact.mjs <artifacts.yml> <artifact package name>' )
|
|
15
|
-
err( ' pull-artifact.mjs <artifacts.yml> <artifact package name> <artifact package version>' )
|
|
16
|
-
process.exit( 1 )
|
|
17
|
-
}
|
|
19
|
+
const options = program.opts()
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
21
|
+
async function main() {
|
|
22
|
+
const artifactsYmlPath = options.artifactsFilePath
|
|
23
|
+
const artifactPackageName = options.packageName || null
|
|
24
|
+
const artifactPackageVersion = options.packageVersion || null
|
|
22
25
|
|
|
23
26
|
const artifactsSchema = await getArtifactsSchema( artifactsYmlPath )
|
|
24
27
|
const flattenedArtifactsSchema = flattenArtifactsSchema( artifactsSchema )
|
|
@@ -65,7 +68,7 @@ async function main() {
|
|
|
65
68
|
|
|
66
69
|
counter = pullResults.filter( Boolean ).length
|
|
67
70
|
|
|
68
|
-
log( `Successfully
|
|
71
|
+
log( `Successfully pulled ${counter}/${filteredArtifactsSchema.length} artifacts` )
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
main()
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { program } from 'commander'
|
|
4
|
+
|
|
5
|
+
import { warning, log } from '../Utils.mjs'
|
|
4
6
|
|
|
5
7
|
import { getArtifactsSchema, flattenArtifactsSchema } from './Utils.mjs'
|
|
6
8
|
import { ArtifactTypeEnum } from './Structs.mjs'
|
|
7
9
|
import { GenericArtifactPusher } from './ArtifactPusher.mjs'
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
program
|
|
12
|
+
.name( 'push-artifact' )
|
|
13
|
+
.description( 'Push artifacts to GCP Artifact Registry' )
|
|
14
|
+
.requiredOption( '-f, --file-path <path>', 'Path to artifacts.yaml file' )
|
|
15
|
+
.option( '-n, --package-name <name>', 'Filter by artifact package name' )
|
|
16
|
+
.option( '-v, --package-version <version>', 'Filter by artifact package version' )
|
|
17
|
+
.parse()
|
|
10
18
|
|
|
11
|
-
|
|
12
|
-
err( 'Usage:' )
|
|
13
|
-
err( ' push-artifact.mjs <artifacts.yml>' )
|
|
14
|
-
err( ' push-artifact.mjs <artifacts.yml> <artifact package name>' )
|
|
15
|
-
err( ' push-artifact.mjs <artifacts.yml> <artifact package name> <artifact package version>' )
|
|
16
|
-
process.exit( 1 )
|
|
17
|
-
}
|
|
19
|
+
const options = program.opts()
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
21
|
+
async function main() {
|
|
22
|
+
const artifactsYmlPath = options.artifactsFilePath
|
|
23
|
+
const artifactPackageName = options.packageName || null
|
|
24
|
+
const artifactPackageVersion = options.packageVersion || null
|
|
22
25
|
|
|
23
26
|
const artifactsSchema = await getArtifactsSchema( artifactsYmlPath )
|
|
24
27
|
const flattenedArtifactsSchema = flattenArtifactsSchema( artifactsSchema )
|