-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.yml
66 lines (58 loc) · 2.2 KB
/
config.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
version: 2
jobs:
build:
docker:
- image: fpco/stack-build
working_directory: ~/app
steps:
- checkout
- restore_cache:
keys:
- stack-work-cache-{{ arch }}-{{ checksum "stack.yaml" }}-{{ checksum "package.yaml" }}
- stack-cache-{{ arch }}-{{ checksum "stack.yaml" }}-{{ checksum "package.yaml" }}
- run:
name: Workaround for GCC bug affecting static compilation
command: |
# More info about this workaround:
# - https://www.fpcomplete.com/blog/2016/10/static-compilation-with-stack
# - https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/640734
cp /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginT.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginT.o.orig
cp /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginT.o
- run:
name: Configure Stack
command: |
stack config set system-ghc --global true
- run:
name: Statically compile Yesod app
command: |
stack --local-bin-path ~/app/dist install --ghc-options '-optl-static -fPIC'
- run:
name: Run tests
command: |
stack test
- save_cache:
key: stack-work-cache-{{ arch }}
paths:
- ~/app/.stack-work/-{{ checksum "stack.yaml" }}-{{ checksum "package.yaml" }}
- save_cache:
key: stack-cache-{{ arch }}-{{ checksum "stack.yaml" }}-{{ checksum "package.yaml" }}
paths:
- ~/.stack/
- store_artifacts:
path: ~/app/dist
- run:
name: Setup Heroku
command: bash .circleci/setup-heroku.sh
- add_ssh_keys:
fingerprints:
- "34:e6:c0:32:7f:74:bf:19:0a:3a:09:52:e6:6e:12:52"
- deploy:
name: Deploy Master to Heroku
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
git config --global user.email "rene.klacan@gmail.com"
git config --global user.name "Rene Klacan (CI)"
git add -f dist
git commit -m "Deployment: Add dist folder"
git push -f heroku master
fi