Commit a0b3dc5c authored by Guido Gunther's avatar Guido Gunther

Initial commit

parents
job:
tags:
- librem5
before_script:
- echo "man-db man-db/auto-update boolean false" | debconf-set-selections
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- apt-get -y install python3-yaml
script:
- python3 -c 'import yaml; import pprint; c = yaml.load(open("librem5-pipeline-definitions.yml")); pprint.pprint(c)'
# Pipeline steps for gitlab CI
Some gitlab snippets for easier gitlab-ci setup
## Usage:
This builds a Debian package and runs it's autopkttests. It can be built joined
with other stages like build and test:
```yaml
include:
- 'https://source.puri.sm/Librem5/librem5-ci/raw/master/librem5-pipeline-definitions.yml'
stages:
- package
- test-package
variables:
L5_DOCKER_IMAGE: debian:buster
package-debian-buster:
extends: .l5-build-debian-package
autopkgtest-debian-buster-package:
dependencies:
- package-debian-buster
extends: .l5-autopkgtest-debian-package
lintian-debian-buster-package:
dependencies:
- package-debian-buster
extends: .l5-lintian-debian-package
```
variables:
# Default docker image to use
L5_DOCKER_IMAGE: debian:buster
# Wheter to add our on-commit CI repos
L5_ADD_SCRATCH_CI: 'true'
L5_WORKING_DIR: $CI_PROJECT_DIR/debian/output
L5_LINTIAN_OPTS: --suppress-tags bad-distribution-in-changes-file
.l5-build-debian-package:
image: ${L5_DOCKER_IMAGE}
tags:
- librem5
stage: package
before_script:
- echo "man-db man-db/auto-update boolean false" | debconf-set-selections
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- '[ "$L5_ADD_SCRATCH_CI" != "true" ] || apt-get -y install build-essential wget ca-certificates gnupg'
- '[ "$L5_ADD_SCRATCH_CI" != "true" ] || echo "deb http://ci.puri.sm/ scratch librem5" > /etc/apt/sources.list.d/ci.list'
- '[ "$L5_ADD_SCRATCH_CI" != "true" ] || wget -O- https://ci.puri.sm/ci-repo.key | apt-key add -'
- apt-get -y update
- apt-get -y build-dep .
script:
- dpkg-buildpackage -b -uc -us
- rm -rf "${L5_WORKING_DIR}"; mkdir -p "${L5_WORKING_DIR}"
- cp -l ../*.deb ../*.changes ../*.buildinfo "${L5_WORKING_DIR}/"
artifacts:
paths:
- "${L5_WORKING_DIR}"
.l5-autopkgtest-debian-package:
image: ${L5_DOCKER_IMAGE}
tags:
- librem5
stage: test-package
dependencies:
- pkg:build-debian-package
before_script:
- echo "man-db man-db/auto-update boolean false" | debconf-set-selections
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- '[ "$L5_ADD_SCRATCH_CI" != "true" ] || apt-get -y install wget ca-certificates gnupg autopkgtest'
- '[ "$L5_ADD_SCRATCH_CI" != "true" ] || echo "deb http://ci.puri.sm/ scratch librem5" > /etc/apt/sources.list.d/ci.list'
- '[ "$L5_ADD_SCRATCH_CI" != "true" ] || wget -O- https://ci.puri.sm/ci-repo.key | apt-key add -'
script:
- ls "${L5_WORKING_DIR}"
- RET=0;
autopkgtest -U ${L5_WORKING_DIR}/*.changes -- autopkgtest-virt-null || RET=$?;
echo "Autopkgtest exited with ${RET}";
[ "${RET}" -eq 8 ] && exit 0 || exit "${RET}"
.l5-lintian-debian-package:
image: ${L5_DOCKER_IMAGE}
tags:
- librem5
stage: test-package
dependencies:
- pkg:build-debian-package
before_script:
- echo "man-db man-db/auto-update boolean false" | debconf-set-selections
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- apt-get -y install wget ca-certificates gnupg lintian
script:
- ls "${L5_WORKING_DIR}"
- lintian ${L5_LINTIAN_OPTS} ${L5_WORKING_DIR}/*.changes
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