This repository has been archived by the owner on Dec 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/kwasi/metadata into kfm-f…
…etch-executions-api-pr
- Loading branch information
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Docker build cross platform script for KF Metadata | ||
* This will calculate your current hash, and build date and use them | ||
* to build the docker image in the format: | ||
* | ||
* gcr.io/kubeflow-images-public/metadata-frontend:${COMMIT_HASH} | ||
*/ | ||
const {exec, spawn} = require('child_process') | ||
const runCmd = cmd => new Promise((res, rej) => exec(cmd, (e, out, err) => e?rej(e):res({out, err}))) | ||
|
||
// COMMIT_HASH=`git rev-parse HEAD`; docker build -t gcr.io/kubeflow-images-public/metadata-frontend:${COMMIT_HASH} --build-arg COMMIT_HASH=${COMMIT_HASH} --build-arg DATE=\"`date -u`\" . | ||
const main = async _ => { | ||
const commitHash = (await runCmd('git rev-parse HEAD')).out.trim() | ||
const date = new Date().toUTCString() | ||
const protocProcess = spawn( | ||
'docker', [ | ||
`build`, | ||
`-t`,`gcr.io/kubeflow-images-public/metadata-frontend:${commitHash}`, | ||
`--build-arg`,`COMMIT_HASH=${commitHash}`, | ||
`--build-arg`,`DATE="${date}"`, | ||
`.` | ||
], {shell: true} | ||
); | ||
protocProcess.stdout.on('data', buffer => console.log(buffer.toString())) | ||
protocProcess.stderr.on('data', buffer => console.error(buffer.toString())) | ||
protocProcess.on('close', code => { | ||
if (code) return | ||
console.log(`Docker image built!`) | ||
}) | ||
} | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters