Skip to content

Commit 477d616

Browse files
committed
devops(circleci): test if build passes
1 parent 49f6c3c commit 477d616

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

examples/next-starter/.circleci/config.yml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ orbs:
77

88
commands:
99
run_test:
10-
description: "Build and test"
10+
description: 'Build and test'
1111
steps:
1212
- checkout
1313

@@ -45,8 +45,12 @@ commands:
4545
command: |
4646
yarn test:ci
4747
environment:
48-
JEST_JUNIT_OUTPUT_DIR: "reports/jest/js-test-results.xml"
48+
JEST_JUNIT_OUTPUT_DIR: 'reports/jest/js-test-results.xml'
4949

50+
- run:
51+
name: See if passed build
52+
command: |
53+
yarn turbo run build --filter=web...
5054
# - run:
5155
# name: Build storybooks
5256
# command: |
@@ -65,7 +69,7 @@ commands:
6569
path: storybook-static
6670

6771
use_capistrano_to_deploy:
68-
description: "Deploy"
72+
description: 'Deploy'
6973
steps:
7074
- checkout
7175

@@ -123,10 +127,10 @@ jobs:
123127
create-repo: false
124128
dockerfile: Dockerfile
125129
path: .
126-
region: "${AWS_REGION}"
130+
region: '${AWS_REGION}'
127131
repo: next-starter
128-
tag: "latest,release-${CIRCLE_SHA1}"
129-
extra-build-args: "--target runner"
132+
tag: 'latest,release-${CIRCLE_SHA1}'
133+
extra-build-args: '--target runner'
130134

131135
build-production-image:
132136
executor: aws-ecr/default
@@ -138,10 +142,10 @@ jobs:
138142
create-repo: false
139143
dockerfile: Dockerfile
140144
path: .
141-
region: "${AWS_REGION}"
145+
region: '${AWS_REGION}'
142146
repo: next-starter
143-
tag: "${CIRCLE_TAG}"
144-
extra-build-args: "--target runner"
147+
tag: '${CIRCLE_TAG}'
148+
extra-build-args: '--target runner'
145149

146150
create-deployment:
147151
docker:
@@ -170,23 +174,23 @@ jobs:
170174
- run:
171175
name: Update image tag and deploy
172176
command: |
173-
ENVIRONMENT="staging"
174-
TAG="release-${CIRCLE_SHA1}"
177+
ENVIRONMENT="staging"
178+
TAG="release-${CIRCLE_SHA1}"
175179
176-
if [ -n "${CIRCLE_TAG}" ]; then
177-
ENVIRONMENT="production"
178-
TAG="${CIRCLE_TAG}"
179-
fi
180+
if [ -n "${CIRCLE_TAG}" ]; then
181+
ENVIRONMENT="production"
182+
TAG="${CIRCLE_TAG}"
183+
fi
180184
181-
root=$(pwd)
185+
root=$(pwd)
182186
183-
echo "deploying ${TAG} to ${ENVIRONMENT}"
187+
echo "deploying ${TAG} to ${ENVIRONMENT}"
184188
185-
cd ${root}/tools/infrastructure/container-based/ochestration/kubernetes/bases
186-
kustomize edit set image "next-starter=${AWS_ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/ultron-client:${TAG}"
189+
cd ${root}/tools/infrastructure/container-based/ochestration/kubernetes/bases
190+
kustomize edit set image "next-starter=${AWS_ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/ultron-client:${TAG}"
187191
188-
cd ${root}/tools/infrastructure/container-based/ochestration/kubernetes/${ENVIRONMENT}/bases
189-
kustomize build | kubectl apply -f -
192+
cd ${root}/tools/infrastructure/container-based/ochestration/kubernetes/${ENVIRONMENT}/bases
193+
kustomize build | kubectl apply -f -
190194
191195
workflows:
192196
version: 2
@@ -198,14 +202,12 @@ workflows:
198202
only: /^v.*/
199203
branches:
200204
only: /.*/
201-
202205
# - build-staging-image:
203206
# requires:
204207
# - run_test
205208
# filters:
206209
# branches:
207210
# only: main
208-
209211
# - build-production-image:
210212
# requires:
211213
# - run_test
@@ -214,7 +216,6 @@ workflows:
214216
# only: /^v.*/
215217
# branches:
216218
# ignore: /.*/
217-
218219
# for staging
219220
# - create-deployment:
220221
# cluster-name: staging-eks-cluster
@@ -224,7 +225,6 @@ workflows:
224225
# filters:
225226
# branches:
226227
# only: main
227-
228228
# for production
229229
# - create-deployment:
230230
# cluster-name: production-eks-cluster
@@ -236,7 +236,6 @@ workflows:
236236
# only: /^v.*/
237237
# branches:
238238
# ignore: /.*/
239-
240239
# - use_capistrano_to_deploy_prod:
241240
# requires:
242241
# - run_test

0 commit comments

Comments
 (0)