|
1 |
| -# This references a standard debian container from the |
2 |
| -# Docker Hub https://registry.hub.docker.com/_/debian/ |
3 |
| -# Read more about containers on our dev center |
4 |
| -# https://devcenter.wercker.com/overview-and-core-concepts/containers/ |
5 | 1 | box: hashexpression/wercker
|
6 |
| - # You can also use services such as databases. Read more on our dev center: |
7 |
| - # https://devcenter.wercker.com/administration/services/ |
8 |
| - # services: |
9 |
| - # - postgres |
10 |
| - # https://devcenter.wercker.com/administration/services/examples/postgresql/ |
| 2 | +no-response-timeout: 10 |
11 | 3 |
|
12 |
| -# - mongo |
13 |
| -# https://devcenter.wercker.com/administration/services/examples/mongodb/ |
14 |
| - |
15 |
| -# This is the build pipeline. Pipelines are the core of wercker |
16 |
| -# Read more about pipelines on our dev center |
17 |
| -# https://devcenter.wercker.com/development/pipelines/ |
18 | 4 | build:
|
19 | 5 | # Steps make up the actions in your pipeline
|
20 | 6 | # Read more about steps on our dev center:
|
21 | 7 | # https://devcenter.wercker.com/development/steps/
|
22 | 8 | steps:
|
| 9 | + - script: |
| 10 | + name: restore cache |
| 11 | + code: | |
| 12 | + if [ -e "$WERCKER_CACHE_DIR/.stack-work" ]; then |
| 13 | + cp -r $WERCKER_CACHE_DIR/.stack-work . |
| 14 | + fi |
23 | 15 | - script:
|
24 | 16 | name: build & test
|
25 | 17 | code: |
|
26 |
| - stack build --test --ghc-options -O2 |
| 18 | + stack build --test --ghc-options -O2 --copy-bins --local-bin-path bins |
| 19 | + - script: |
| 20 | + name: store cache |
| 21 | + code: | |
| 22 | + cp -r .stack-work $WERCKER_CACHE_DIR |
| 23 | +
|
| 24 | +
|
| 25 | +create-release: |
| 26 | + box: ubuntu |
| 27 | + steps: |
| 28 | + - install-packages: |
| 29 | + packages: curl file |
| 30 | + - script: |
| 31 | + name: Get release version |
| 32 | + code: | |
| 33 | + export RELEASE_VERSION=$(cat VERSION) |
| 34 | + - script: |
| 35 | + name: Create symphony archive |
| 36 | + code: | |
| 37 | + tar czf symphony-$RELEASE_VERSION.tar.gz --directory=bins symphony |
| 38 | + - wercker/github-create-release@2.1.1: |
| 39 | + token: $GITHUB_TOKEN |
| 40 | + tag: v$RELEASE_VERSION |
| 41 | + title: v$RELEASE_VERSION |
| 42 | + - wercker/github-upload-asset@2.1.1: |
| 43 | + token: $GITHUB_TOKEN |
| 44 | + file: symphony-$RELEASE_VERSION.tar.gz |
| 45 | + |
| 46 | + |
| 47 | +create-docker-image: |
| 48 | + box: hashexpression/symphony_env |
| 49 | + steps: |
| 50 | + - script: |
| 51 | + name: Remove unncessary directories & files |
| 52 | + code: | |
| 53 | + rm -rf .stack-work |
| 54 | + rm -rf .git |
| 55 | + - script: |
| 56 | + name: Copy symphony to PATH |
| 57 | + code: | |
| 58 | + cp bins/symphony /usr/bin |
| 59 | + - internal/docker-push: |
| 60 | + username: $DOCKERHUB_USERNAME # Registry username |
| 61 | + password: $DUCKERHUB_PASSWORD # Registry password |
| 62 | + repository: hashexpression/symphony |
| 63 | + |
| 64 | + |
0 commit comments