aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 07b992b99b7dffe8e81679cbdf526035074f42eb (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
51
52
53
54
55
56
57
stages:
  - test
  - package
  - publish

.test: &test
  image: $CI_REGISTRY/docker-images/layers:$DISTRO-ruby
  stage: test
  script:
    - apt install libsqlite3-dev zlib1g-dev libxml2-dev ruby-dev libpq-dev
    - bundle install -j $(nproc) --path vendor/bundle --without development
    - "POSTGRES_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres/$POSTGRES_DB bundle exec rake test"
  services:
    - postgres:$POSTGRES_VERSION
  before_script:
    - apt install postgresql-server-dev-$POSTGRES_VERSION

test:jessie:
  <<: *test
  variables:
    DISTRO: jessie
    POSTGRES_USER: root
    POSTGRES_VERSION: "9.4"

test:stretch:
  <<: *test
  variables:
    DISTRO: stretch
    POSTGRES_USER: root
    POSTGRES_VERSION: "9.6"

.package: &package
  image: $CI_REGISTRY/docker-images/layers:$DISTRO-deb
  stage: package
  script:
    - package
  artifacts:
    paths:
      - pkg/

package:jessie:
  <<: *package
  variables:
    DISTRO: jessie

package:stretch:
  <<: *package
  variables:
    DISTRO: stretch

publish:
  stage: publish
  tags:
    - shell
  script:
    - publish