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: "" variables: 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