1stages:
2 - test
3 - production
4 - build
5 - prepare
6
7test:
8 image: rust:alpine
9 stage: test
10 script:
11 - apk add musl-dev
12 - cargo install cargo2junit
13 - cargo test -- -Z unstable-options --format json --report-time | cargo2junit > results.xml
14 only:
15 - master
16 artifacts:
17 reports:
18 junit: results.xml
19
20production:
21 stage: production
22 image: ruby:latest
23 needs:
24 - test
25 script:
26 - apt-get update -qy
27 - apt-get install -y ruby-dev
28 - gem install dpl
29 - gem install faraday -v 1.8.0
30 - dpl --provider=heroku --app=$HEROKU_APP --api-key=$HEROKU_API_KEY
31 only:
32 - master
33
34prepare_job:
35 stage: prepare
36 image: rust:alpine
37 rules:
38 - if: $CI_COMMIT_TAG
39 script:
40 - echo "running release_job"
41 - apk add musl-dev
42 - cargo build --release
43 artifacts:
44 paths:
45 - target/release/hyper
46 - target/release/actix
47
48release_job:
49 stage: release
50 image: registry.gitlab.com/gitlab-org/release-cli:latest
51 rules:
52 - if: $CI_COMMIT_TAG
53 script:
54 - echo "running release_job for $TAG"
55 needs:
56 - job: prepare_job
57 artifacts: true
58 release:
59 name: 'Release $CI_COMMIT_TAG'
60 description: 'New macroblog version'
61 tag_name: '$CI_COMMIT_TAG'
62 ref: '$CI_COMMIT_TAG'