Skip to content

Commit 23e750f

Browse files
committed
Attempt circleCi config update
1 parent cd9ccc0 commit 23e750f

File tree

2 files changed

+43
-73
lines changed

2 files changed

+43
-73
lines changed

.circleci/config.yml

+41-71
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,22 @@ orbs:
33
gcp-cli: circleci/[email protected]
44
slack: circleci/[email protected]
55
jobs:
6+
checkout-to-workspace:
7+
docker:
8+
- image: circleci/python:3.8-buster-node
9+
steps:
10+
- checkout
11+
- persist_to_workspace:
12+
root: .
13+
paths:
14+
- .
615
build-flask:
716
docker:
817
- image: circleci/python:3.8-buster
918
working_directory: ~/flask
1019
steps:
11-
- checkout
20+
- attach_workspace:
21+
at: ~/
1222
# Restore cached dependencies
1323
- restore_cache:
1424
key: flask-deps-{{ checksum "requirements.txt" }}
@@ -34,11 +44,8 @@ jobs:
3444
- image: circleci/python:3.8-buster-node
3545
working_directory: ~/react
3646
steps:
37-
- run:
38-
name: Clone React Repo
39-
command: |
40-
cd ..
41-
git clone --branch master https://github.com/boxwise/boxwise-react.git react
47+
- attach_workspace:
48+
at: ~/
4249
- run:
4350
name: Generate .env File
4451
command: |
@@ -50,7 +57,7 @@ jobs:
5057
REACT_APP_LOGOUT_URL=${REACT_APP_LOGOUT_URL}
5158
REACT_APP_GRAPHQL_SERVER=${REACT_APP_GRAPHQL_SERVER}" > .env
5259
- run:
53-
name: Set hompage in package.json
60+
name: Set homepage in package.json
5461
command: |
5562
sed -i 's|"homepage": "http://localhost:3000/"|"homepage": "https://'$URL'/mobile"|' package.json
5663
# following https://circleci.com/docs/2.0/yarn/
@@ -85,7 +92,7 @@ jobs:
8592
steps:
8693
# Attach workspace from build
8794
- attach_workspace:
88-
at: .
95+
at: ~/
8996
# - restore_cache:
9097
# key: flask-dev-deps-{{ checksum "requirements-dev.txt" }}
9198
- run:
@@ -122,7 +129,7 @@ jobs:
122129
steps:
123130
# Attach workspace from build
124131
- attach_workspace:
125-
at: .
132+
at: ~/
126133
# install gcloud orb
127134
- gcp-cli/install
128135
- run:
@@ -159,74 +166,19 @@ jobs:
159166
- slack/notify-on-failure:
160167
only_for_branches: master,production
161168

162-
163169
workflows:
164170
build-and-deploy:
165171
jobs:
166-
- build-flask
167-
168-
- test-flask:
169-
requires:
170-
- build-flask
171-
172-
- build-react:
173-
name: build-react-for-staging
174-
context: STAGING
175-
filters:
176-
branches:
177-
only: master
178-
179-
# deploy to staging
180-
- deploy:
181-
name: deploy-staging
182-
context: STAGING
183-
serviceName: api-staging
184-
requires:
185-
- test-flask
186-
- build-react-for-staging
187-
filters:
188-
branches:
189-
only: master
190-
191-
# deploy to demo
192-
- deploy:
193-
name: deploy-demo
194-
context: DEMO
195-
serviceName: api-demo
196-
filters:
197-
branches:
198-
only: production
199-
200-
# deploy to production
201-
- deploy:
202-
name: deploy-production
203-
context: PRODUCTION
204-
serviceName: api-production
205-
filters:
206-
branches:
207-
only: production
208-
# nightly workflow to deploy master from React each night
209-
nightly:
210-
triggers:
211-
- schedule:
212-
cron: "0 5 * * *"
213-
filters:
214-
branches:
215-
only:
216-
- master
217-
jobs:
218-
- build-flask
219-
172+
- checkout-to-workspace
173+
- build-flask:
174+
requires:
175+
- checkout-to-workspace
220176
- test-flask:
221177
requires:
222178
- build-flask
223-
224179
- build-react:
225-
name: build-react-for-staging
226-
context: STAGING
227-
filters:
228-
branches:
229-
only: master
180+
requires:
181+
- checkout-to-workspace
230182

231183
# deploy to staging
232184
- deploy:
@@ -235,7 +187,25 @@ workflows:
235187
serviceName: api-staging
236188
requires:
237189
- test-flask
238-
- build-react-for-staging
190+
- build-react
239191
filters:
240192
branches:
241193
only: master
194+
195+
# deploy to demo
196+
- deploy:
197+
name: deploy-demo
198+
context: DEMO
199+
serviceName: api-demo
200+
filters:
201+
branches:
202+
only: production
203+
204+
# deploy to production
205+
- deploy:
206+
name: deploy-production
207+
context: PRODUCTION
208+
serviceName: api-production
209+
filters:
210+
branches:
211+
only: production

flask/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="boxwise-flask",
8-
use_scm_version=True,
8+
use_scm_version={"root": ".."},
99
description="""Boxwise is a web application that makes it easy for
1010
organisations to source, store and distribute donated goods to people in
1111
need in a fair and dignified way.""",
@@ -16,4 +16,4 @@
1616
packages=find_packages(exclude=["test"]),
1717
setup_requires=["setuptools_scm"],
1818
install_requires=REQUIREMENTS,
19-
)
19+
)

0 commit comments

Comments
 (0)