1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-28 06:00: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 branch: master
commands: commands:
- ./bin/docker-login - ./bin/docker-login
- ./bin/build
- ./bin/deploy - ./bin/deploy
# production: # production:
# tag: /production-*/ # tag: /production-*/

View File

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