stages:
  - test

test:
  image: leapcode/soledad:latest
  stage: test
  script:
    - tox --recreate

stages:
  #- test
  - package
  - test_package

.job_template: &job_definition
  stage: package
  image: "0xacab.org:4567/leap/gitlab-buildpackage:build_${DIST}_${ARCH}"
  script:
    - build-build-package
    # sleep 1h to allow debugging of running container
    #- sleep 3600
  artifacts:
    expire_in: 1w
    paths:
    - '*_*.xz'
    - '*_*.dsc'
    - '*_amd64.changes'
    - '*.deb'
    - 'results/*'

#test:
#  image: leapcode/soledad:latest
#  stage: test
#  script:
#  - tox --recreate

package:amd64:jessie:
  variables:
    #CI_DEBUG_TRACE: "true"
    REPOREMOTE: "gitlab-runner@deb.leap.se"
    REPOURL: "deb.leap.se/gitbuildpackage"
    REPOREMOTE_OPTS: "-p 4422 -o StrictHostKeyChecking=no -i /etc/dockerbuild.id_rsa -o SendEnv=REPOSITORY"
    REPOSITORY: "/srv/gitbuildpackage"
    ARCH: "amd64"
    DIST: "jessie"
    REPOS: "jessie"
  <<: *job_definition

lintian:
  variables:
    ARCH: "amd64"
    DIST: "jessie"
  image: "0xacab.org:4567/leap/gitlab-buildpackage:build_${DIST}_${ARCH}"
  stage: test_package
  script: bash -x build-test-lintian --fail-on-warnings

Build and test deb packages on 0xacab.org
Build and test deb packages on 0xacab.org
