-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
70 lines (65 loc) · 1.6 KB
/
.gitlab-ci.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
67
68
69
70
image: "elixir:1.9"
.cache_deps: &cache_deps
cache:
untracked: true
key: "$CI_BUILD_REF_NAME"
paths:
- deps
- assets/node_modules
cache:
paths:
- deps
- assets/node_modules
test:
<<: *cache_deps
stage: test
services:
- redis:latest
- postgres:latest
variables:
POSTGRES_DB: hello_gitlab_ci_test
POSTGRES_HOST: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: "postgres"
MIX_ENV: "test"
REDIS_URL: redis://redis:6379/12
script:
# Install locale
# in case of strange errors
# - apt-get install -y locales >/dev/null
# - echo "en_US UTF-8" > /etc/locale.gen
# - locale-gen en_US.UTF-8
# - export LANG=en_US.UTF-8
# - export LANGUAGE=en_US:en
# - export LC_ALL=en_US.UTF-8
- apt-get update && apt-get -y install postgresql-client
- mix local.hex --force
- mix local.rebar --force
- mix deps.get --only test
- mix ecto.create
- mix ecto.load
- mix coveralls.json
- bash <(curl -s https://codecov.io/bash)
staging:
image: "ruby:2.6.2"
stage: deploy
environment:
name: staging
script:
- curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
- gem install dpl
- dpl --provider=heroku --app=$HEROKU_STAGING_APP_NAME --api-key=$HEROKU_API_KEY
only:
- develop
- staging
production:
image: "ruby:2.6.2"
stage: deploy
environment:
name: production
script:
- curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
- gem install dpl
- dpl --provider=heroku --app=$HEROKU_PRODUCTION_APP_NAME --api-key=$HEROKU_API_KEY
only:
- master