forked from govau/design-system-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
48 lines (44 loc) · 2.21 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
machine:
node:
version: 7.5.0 # keep this real
timezone:
Australia/Sydney # timezone is important
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin" # need this for yarn
general:
artifacts:
- $CIRCLE_ARTIFACTS # telling circle to do it’s job / to enable artifacts
dependencies:
pre:
- curl -v -L -o cf-cli_amd64.deb 'https://cli.run.pivotal.io/stable?release=debian64&source=github' # getting the cf tool
- sudo dpkg -i cf-cli_amd64.deb # installing it
- cf -v # logging what we got
- sudo apt-get install tree # install tree (soo much nicer)
override:
- find . -name "node_modules" -exec rm -rf '{}' + # removing all node_modules/ folder to help circle get it’s act together with caching
- yarn # install dependencies
- yarn bootstrap # running bootstrap script -> install and link all dependencies via lerna
- yarn build # running build script -> build all assets
cache_directories:
- ~/.cache/yarn # yarn needs this
test:
post:
- find . -name "node_modules" -exec rm -rf '{}' + # removing all node_modules/ folder
- find . -name "lib" -exec rm -rf '{}' + # removing all lib/ folders
- find . -name "src" -exec rm -rf '{}' + # removing all src/ folder
- tree -C # let’s log what we got now
- cp -r * $CIRCLE_ARTIFACTS/ # moving all remaining files to $CIRCLE_ARTIFACTS
deployment:
development:
branch: master # only on master branch
commands:
- cf login -a https://api.system.staging.digital.gov.au -o $CF_ORG_PROD -s $CF_SPACE_PROD -u $CF_USER_PROD -p $CF_PASSWORD_PROD
- cf target -o $CF_ORG_PROD -s $CF_SPACE_PROD
- cf push -f manifest.yml
production:
branch: develop # only develop branch
commands:
- cf login -a https://api.system.staging.digital.gov.au -o $CF_ORG_STAGING -s $CF_SPACE_STAGING -u $CF_USER_STAGING -p $CF_PASSWORD_STAGING
- cf target -o $CF_ORG_STAGING -s $CF_SPACE_STAGING
- cf push -f manifest.yml