1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-13 06:40:06 +02:00

chore: build packages before compose

This commit is contained in:
Sérgio Ramos 2017-05-30 19:45:00 +01:00
parent 96abc2a8bc
commit 6ad9c18683
3 changed files with 33 additions and 9 deletions

View File

@ -42,6 +42,7 @@ deployment:
branch: master
commands:
- ./bin/docker-login
- ./bin/build
- ./bin/deploy
# production:
# tag: /production-*/

View File

@ -43,9 +43,7 @@ prometheus:
# STYLEGUIDE
#############################################################################
styleguide:
build:
context: .
dockerfile: ./packages/ui-toolkit/Dockerfile
image: quay.io/yldio/joyent-ui-toolkit:$CIRCLE_BRANCH
ports:
- 6060:6060
mem_limit: 512m
@ -60,9 +58,7 @@ styleguide:
# FRONTEND
#############################################################################
cp-frontend:
build:
context: .
dockerfile: ./packages/cp-frontend/Dockerfile
image: quay.io/yldio/joyent-cp-frontend:$CIRCLE_BRANCH
mem_limit: 512m
labels:
- triton.cns.services=frontend-$CIRCLE_BRANCH
@ -77,9 +73,7 @@ cp-frontend:
# BACKEND
#############################################################################
gql-mock-server:
build:
context: .
dockerfile: ./packages/cp-gql-mock-server/Dockerfile
image: quay.io/yldio/joyent-cp-gql-mock-server:$CIRCLE_BRANCH
mem_limit: 512m
labels:
- triton.cns.services=frontend-$CIRCLE_BRANCH

29
scripts/build Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env node
const execa = require('execa');
const main = require('apr-main');
const map = require('apr-map');
const globby = require('globby');
const path = require('path');
const readPkg = require('read-pkg');
const ROOT = path.join(__dirname, '..');
const CIRCLE_BRANCH = process.env['CIRCLE_BRANCH'];
const build = async () => {
const dockerfiles = await globby(['packages/*/Dockerfile'], {
cwd: ROOT
});
return map(dockerfiles, async dockerfile => {
const folder = path.resolve(ROOT, path.dirname(dockerfile));
const { name } = await readPkg(folder);
const tag = `${name}:${CIRCLE_BRANCH}`;
return execa('docker', ['build', '-t', tag, '-f', dockerfile, '.'], {
stdio: 'inherit'
});
});
};
main(build());