Skip to content

Commit 0a62b41

Browse files
committed
Make CircleCI bundle homepage/app in parallel
1 parent 40eebf0 commit 0a62b41

File tree

2 files changed

+47
-7
lines changed

2 files changed

+47
-7
lines changed

.circleci/config.yml

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
paths:
4343
- ~/codesandbox-client
4444

45-
build-prod:
45+
build-app:
4646
docker:
4747
- image: circleci/node:9.11.1
4848
working_directory: ~/codesandbox-client
@@ -54,18 +54,48 @@ jobs:
5454
key: v8-prod-app-build-cache-master
5555
- run:
5656
name: Build Application
57-
command: yarn build:prod
57+
command: yarn build:app
5858
- save_cache:
5959
key: v8-prod-app-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
6060
paths:
6161
- ./packages/app/www
62+
63+
build-homepage:
64+
docker:
65+
- image: circleci/node:9.11.1
66+
working_directory: ~/codesandbox-client
67+
steps:
68+
- restore_cache:
69+
key: v8-repo-{{ .Environment.CIRCLE_SHA1 }}
70+
- run:
71+
name: Build Application
72+
command: yarn build:homepage
73+
- save_cache:
74+
key: v8-prod-homepage-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
75+
paths:
76+
- ./packages/homepage/public
77+
78+
build-combine:
79+
docker:
80+
- image: circleci/node:9.11.1
81+
working_directory: ~/codesandbox-client
82+
steps:
83+
- restore_cache:
84+
key: v8-repo-{{ .Environment.CIRCLE_SHA1 }}
85+
86+
# Restore app build
87+
- restore_cache:
88+
key: v8-prod-app-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
89+
# Restore homepage build
90+
- restore_cache:
91+
key: v8-prod-homepage-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
92+
- run:
93+
name: Build Application
94+
command: yarn build:combine
6295
- save_cache:
6396
key: v8-prod-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
6497
paths:
6598
- ./www
66-
- store_artifacts:
67-
path: ./www
68-
destination: www
6999

70100
test-integrations:
71101
docker:
@@ -150,12 +180,19 @@ workflows:
150180
- lint:
151181
requires:
152182
- build-dependencies
153-
- build-prod:
183+
- build-app:
154184
requires:
155185
- build-dependencies
186+
- build-homepage:
187+
requires:
188+
- build-dependencies
189+
- build-combine:
190+
requires:
191+
- build-app
192+
- build-homepage
156193
- create-docker-image:
157194
requires:
158-
- build-prod
159195
- lint
160196
- test-integrations
161197
- test-jest
198+
- build-combine

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
"private": true,
66
"scripts": {
77
"build": "yarn build:deps && yarn build:prod",
8+
"build:app": "lerna run build --scope app --stream",
9+
"build:homepage": "lerna run build --scope homepage --stream",
810
"build:prod": "lerna run build --scope app --scope homepage --parallel && gulp",
911
"build:clean": "lerna run build:clean --scope app --scope homepage && rimraf www",
1012
"build:deps": "lerna run build:dev --scope codesandbox-api --scope codesandbox-browserfs",
13+
"build:combine": "gulp",
1114
"start": "yarn build:deps && lerna run start --scope app --stream",
1215
"start:fast": "lerna run start --scope app --stream",
1316
"start:home": "lerna run start --scope homepage --stream",

0 commit comments

Comments
 (0)