aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 1d1fa6ea36d45b5da5815a1f26dc337c39387187 (plain)
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
stages:
    - test
    - production
    - release

test:
    image: rust:alpine
    stage: test
    script:
        - apk add musl-dev
        - cargo install cargo2junit
        - cargo test -- -Z unstable-options --format json --report-time | cargo2junit > results.xml
    only:
        - master
    artifacts:
        reports:
            junit: results.xml

production:
    stage: production
    image: ruby:latest
    needs:
      - test
    script:
        - apt-get update -qy
        - apt-get install -y ruby-dev
        - gem install dpl
        - gem install faraday -v 1.8.0
        - dpl --provider=heroku --app=$HEROKU_APP --api-key=$HEROKU_API_KEY
    only:
        - master

release_job:
  stage: release
  image: rust:alpine
  rules:
    - if: $CI_COMMIT_TAG
  script:
    - echo "running release_job"
    - apk add musl-dev
    - cargo build --release
  artifacts:
    paths:
      - target/release/hyper
      - target/release/actix
  release:
    name: 'Release $CI_COMMIT_TAG'
    description: 'New macroblog version'
    tag_name: '$CI_COMMIT_TAG'
    ref: '$CI_COMMIT_TAG'