mirror of
https://github.com/yldio/copilot.git
synced 2024-11-28 06:00:06 +02:00
chore: push image after build
This commit is contained in:
parent
cf5f476898
commit
b7371b355a
@ -65,6 +65,7 @@
|
||||
"lerna": "^2.0.0-rc.5",
|
||||
"lerna-wizard": "ramitos/lerna-wizard#7bcdc11",
|
||||
"license-to-fail": "^2.2.0",
|
||||
"lodash.flatten": "^4.4.0",
|
||||
"lodash.isplainobject": "^4.0.6",
|
||||
"lodash.isstring": "^4.0.1",
|
||||
"lodash.uniq": "^4.5.0",
|
||||
|
@ -5,8 +5,10 @@ const main = require('apr-main');
|
||||
const map = require('apr-map');
|
||||
const globby = require('globby');
|
||||
const path = require('path');
|
||||
const flatten = require('lodash.flatten');
|
||||
const readPkg = require('read-pkg');
|
||||
|
||||
const NAMESPACE = 'quay.io/yldio';
|
||||
const ROOT = path.join(__dirname, '..');
|
||||
const CIRCLE_BRANCH = process.env['CIRCLE_BRANCH'];
|
||||
|
||||
@ -18,9 +20,23 @@ const build = async () => {
|
||||
return map(dockerfiles, async dockerfile => {
|
||||
const folder = path.resolve(ROOT, path.dirname(dockerfile));
|
||||
const { name } = await readPkg(folder);
|
||||
const tag = `${name}:${CIRCLE_BRANCH}`;
|
||||
const tags = [`${name}:${CIRCLE_BRANCH}`, `${name}:latest`];
|
||||
|
||||
return execa('docker', ['build', '-t', tag, '-f', dockerfile, '.'], {
|
||||
await execa(
|
||||
'docker',
|
||||
flatten([
|
||||
'build',
|
||||
flatten(tags.map(name => ['-t', `${NAMESPACE}/${name}`])),
|
||||
'-f',
|
||||
dockerfile,
|
||||
'.'
|
||||
]),
|
||||
{
|
||||
stdio: 'inherit'
|
||||
}
|
||||
);
|
||||
|
||||
return execa('push', ['push', `${NAMESPACE}/${name}`], {
|
||||
stdio: 'inherit'
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user