mirror of
https://github.com/yldio/copilot.git
synced 2024-11-14 07:10:05 +02:00
chore: build packages before compose
This commit is contained in:
parent
96abc2a8bc
commit
6ad9c18683
@ -42,6 +42,7 @@ deployment:
|
||||
branch: master
|
||||
commands:
|
||||
- ./bin/docker-login
|
||||
- ./bin/build
|
||||
- ./bin/deploy
|
||||
# production:
|
||||
# tag: /production-*/
|
||||
|
@ -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
29
scripts/build
Executable 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());
|
Loading…
Reference in New Issue
Block a user