stages: - test - package - publish test:jessie: &test image: $CI_REGISTRY/docker-images/layers:$DISTRO-ruby stage: test services: - postgres:9.4 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 - 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