librem5-pipeline-definitions.yml 2.55 KB
Newer Older
Guido Gunther's avatar
Guido Gunther committed
1
2
3
4
5
6
7
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
Guido Gunther's avatar
Guido Gunther committed
8
  L5_GIT_SUBMODULE_UPDATE: 'true'
Guido Gunther's avatar
Guido Gunther committed
9
10
11
12
13
14
15
16
17
18

.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
Guido Gunther's avatar
Guido Gunther committed
19
    - '[ "$L5_ADD_SCRATCH_CI" != "true" ] || apt-get -y install build-essential wget ca-certificates gnupg git'
Guido Gunther's avatar
Guido Gunther committed
20
21
22
23
24
    - '[ "$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:
Guido Gunther's avatar
Guido Gunther committed
25
    - '[ "$L5_GIT_SUBMODULE_UPDATE" != "true" ] || git submodule update --recursive'
Guido Gunther's avatar
Guido Gunther committed
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
    - 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