Commit 6f43aa96 authored by Agustin Henze's avatar Agustin Henze

Merge branch 'using-variables' into 'master'

Use variables to avoid repeated definitions.

See merge request salsa-ci-team/pipeline!56
parents 893c611f 945ad0ce
include: salsa-ci.yml
variables:
RELEASE: 'stretch-backports'
stages:
- clone
- build
- test
- test-backwards
clone:
stage: clone
......@@ -21,7 +25,7 @@ before_script:
- cd repo_test
build:
extends: .build-unstable
extends: .build-package
reprotest:
extends: .test-reprotest
......@@ -40,3 +44,50 @@ blhc:
piuparts:
extends: .test-piuparts
# Backwards compat tests
.dry: &dry
before_script:
- cd repo_test
stage: test-backwards
build-unstable:
extends: .build-unstable
<<: *dry
dependencies:
- clone
build-stretch-backports:
extends: .build-stretch-bpo
<<: *dry
dependencies:
- clone
build-stretch:
extends: .build-stretch
<<: *dry
dependencies:
- clone
build-jessie:
extends: .build-jessie
<<: *dry
dependencies:
- clone
lintian-unstable:
extends: .test-lintian-unstable
<<: *dry
lintian-stretch-backports:
extends: .test-lintian-stretch-backports
<<: *dry
lintian-stretch:
extends: .test-lintian-stretch
<<: *dry
lintian-jessie:
extends: .test-lintian-jessie
<<: *dry
......@@ -23,7 +23,7 @@ It you want to use this tools to build and test your project, adding the followi
include: https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
build:
extends: .build-unstable
extends: .build-package
reprotest:
extends: .test-reprotest
......@@ -52,14 +52,22 @@ You can choose to run only some of the jobs.
Anyway, we **firmly recommend NOT to do it**.
### Building
3 different build jobs are provided:
- build-unstable
- build-stretch
- build-stretch-bpo
- build-jessie
Any of this 3 builds can be chosen.
The stretch\* jobs are intended to be used on the corresponding Debian branches.
The Debian release can be specified declaring the variable `RELEASE` on any of the images availables.
- unstable
- stretch-backports
- stretch
- jessie
This release is also gonna be used for some stages like lintian.
By default, `unstable` is used.
To change the `RELEASE`, define this after including the yaml:
```yaml
variables:
RELEASE: 'stretch'
```
Replace `stretch` with any of the releases listed previously.
### Testing
5 different tests are available to be used:
......
include: https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
variables:
RELEASE: 'stretch-backports'
build:
extends: .build-unstable
extends: .build-package
reprotest:
extends: .test-reprotest
......
.global_variables: &global_variables
variables:
DEBFULLNAME: "Salsa Pipeline"
DEBEMAIL: "<salsa-pipeline@debian.org>"
DEBIAN_FRONTEND: noninteractive
WORKING_DIR: $CI_PROJECT_DIR/debian/output
RELEASE: 'unstable'
stages:
- build
......@@ -33,33 +34,9 @@ stages:
- gbp pull --ignore-branch --pristine-tar --track-missing
- gbp buildpackage --git-ignore-branch --git-export-dir=${WORKING_DIR} --git-builder="docker-build.sh registry.salsa.debian.org/salsa-ci-team/images/dockerbuilder:${RELEASE}"
.build-jessie: &build-jessie
<<: *build-definition
<<: *artifacts-default-expire
variables:
<<: *global_variables
RELEASE: 'jessie'
.build-stretch: &build-stretch
<<: *build-definition
<<: *artifacts-default-expire
variables:
<<: *global_variables
RELEASE: 'stretch'
.build-stretch-bpo: &build-stretch-bpo
<<: *build-definition
<<: *artifacts-default-expire
variables:
<<: *global_variables
RELEASE: 'stretch-backports'
.build-unstable: &build-unstable
.build-package: &build-package
<<: *build-definition
<<: *artifacts-default-expire
variables:
<<: *global_variables
RELEASE: 'unstable'
.test-autopkgtest: &test-autopkgtest
stage: test
......@@ -67,7 +44,6 @@ stages:
script:
- eatmydata autopkgtest -U ${WORKING_DIR}/*.changes -- null || [ $? -eq 8 ]
variables:
<<: *global_variables
GIT_STRATEGY: none
.test-blhc: &test-blhc
......@@ -76,38 +52,20 @@ stages:
script:
- blhc --debian --line-numbers --color ${WORKING_DIR}/*.build || [ $? -eq 1 ]
variables:
<<: *global_variables
GIT_STRATEGY: none
.test-lintian: &test-lintian
stage: test
image: registry.salsa.debian.org/salsa-ci-team/images/lintian
image: registry.salsa.debian.org/salsa-ci-team/images/lintian:${RELEASE}
script:
- lintian ${WORKING_DIR}/*.changes | tee lintian.output
- cat lintian.output | /root/go/bin/lintian2junit > ${WORKING_DIR}/lintian.xml
variables:
<<: *global_variables
GIT_STRATEGY: none
artifacts:
reports:
junit: ${WORKING_DIR}/lintian.xml
.test-lintian-jessie: &test-lintian-jessie
<<: *test-lintian
image: registry.salsa.debian.org/salsa-ci-team/images/lintian:jessie
.test-lintian-stretch: &test-lintian-stretch
<<: *test-lintian
image: registry.salsa.debian.org/salsa-ci-team/images/lintian:stretch
.test-lintian-stretch-backports: &test-lintian-stretch-backports
<<: *test-lintian
image: registry.salsa.debian.org/salsa-ci-team/images/lintian:stretch-backports
.test-lintian-unstable: &test-lintian-unstable
<<: *test-lintian
image: registry.salsa.debian.org/salsa-ci-team/images/lintian:unstable
.test-reprotest: &test-reprotest
stage: test
image: registry.salsa.debian.org/salsa-ci-team/images/reprotest
......@@ -148,5 +106,71 @@ stages:
- cp -aTv /etc/apt/preferences.d ${CHROOT_PATH}/etc-target/apt/preferences.d
- piuparts --scriptsdir /etc/piuparts/scripts --allow-database --warn-on-leftovers-after-purge --hard-link -e ${CHROOT_PATH} ${WORKING_DIR}/*.deb
variables:
<<: *global_variables
GIT_STRATEGY: none
# Backwards compatibility stuff
#
.deprecation-warning: &deprecation-warning
before_script:
- |
echo "--------------------------------------";
echo "------------- Deprecated -------------";
echo "--------------------------------------";
echo;
echo "Please use the new jobs.";
echo "More info on salsa-ci-team/pipeline";
echo "This job will be removed soon";
echo;
echo "--------------------------------------";
echo "------------- Deprecated -------------";
echo "--------------------------------------";
.build-jessie: &build-jessie
extends: .build-package
<<: *deprecation-warning
variables:
RELEASE: 'jessie'
.build-stretch: &build-stretch
extends: .build-package
<<: *deprecation-warning
variables:
RELEASE: 'stretch'
.build-stretch-bpo: &build-stretch-bpo
extends: .build-package
<<: *deprecation-warning
variables:
RELEASE: 'stretch-backports'
.build-unstable: &build-unstable
extends: .build-package
<<: *deprecation-warning
variables:
RELEASE: 'unstable'
.test-lintian-jessie: &test-lintian-jessie
extends: .test-lintian
<<: *deprecation-warning
variables:
RELEASE: 'jessie'
.test-lintian-stretch: &test-lintian-stretch
extends: .test-lintian
<<: *deprecation-warning
variables:
RELEASE: 'stretch'
.test-lintian-stretch-backports: &test-lintian-stretch-backports
extends: .test-lintian
<<: *deprecation-warning
variables:
RELEASE: 'stretch-backports'
.test-lintian-unstable: &test-lintian-unstable
extends: .test-lintian
<<: *deprecation-warning
variables:
RELEASE: 'unstable'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment