aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: f2a3b2ca38bdbc850d3b19136bab5d0264881e48 (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
stages:
  - test
  - package
  - publish

test:jessie: &test
  image: $CI_REGISTRY/docker-images/layers:$DISTRO-ruby
  stage: test
  services:
    - postgres:latest
  variables:
    POSTGRES_DB: mauve
    POSTGRES_USER: mauveuser
    POSTGRES_PASSWORD: ""
    DISTRO: jessie
  before_script:
    - apt install libpq-dev postgresql-server-dev-9.4
  script:
    - apt install libsqlite3-dev rake ruby-log4r ruby-ipaddress ruby-json ruby-sanitize ruby-rubymail thin ruby-haml ruby-haml-contrib ruby-redcloth ruby-rack ruby-rack-protection ruby-rack-flash3 ruby-tilt ruby-sinatra ruby-locale ruby-rack-test ruby-webmock ruby-timecop ruby-test-unit
    - bundle install -j $(nproc) --path vendor/bundle --without development
    - "POSTGRES_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres/$POSTGRES_DB bundle exec rake test"

.test:stretch:
  <<: *test
  variables:
    DISTRO: stretch
  before_script:
    - apt install libpq-dev postgresql-server-dev-9.6

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

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

publish:
  stage: publish
  tags:
    - shell
  script:
    - publish
  dependencies:
    - package:jessie
    - package:stretch