Standardize the deb build template

This commit is contained in:
Finn 2021-07-09 01:44:10 -07:00
parent 460fef2f0e
commit 235ec55978

View file

@ -33,6 +33,37 @@ lint:
- signaldctl
expire_in: 1 month
.build-deb:
stage: build
image: debian:latest
script:
- apt-get update
- apt-get install -y git-buildpackage dh-golang bash-completion golang-any golang-github-spf13-cobra-dev golang-github-spf13-viper-dev
- apt-get install -y ./*.deb && rm -vf *.deb
- git checkout "${CI_COMMIT_BRANCH}" || true
- go run ./cmd/signaldctl doc -o man
- go run ./cmd/signaldctl completion bash > debian/package.bash-completion
- ls *.1 > debian/manpages
- gbp dch --ignore-branch --debian-tag="%(version)s" --git-author --new-version="$(git describe --abbrev=0 HEAD)+git$(date +%Y-%m-%d)r$(git rev-parse --short=8 HEAD).$(git rev-list $(git describe --abbrev=0 HEAD)..HEAD --count)"
- dpkg-buildpackage -us -uc -b
- mv ../*.deb .
needs:
- project: signald/libraries/golang-github-mdp-qrterminal
job: build
ref: master
artifacts: true
- project: signald/libraries/golang-github-jedib0t-go-pretty
job: build
ref: master
artifacts: true
variables:
SIGNALDCTL_PUBLIC_DOC_MODE: "on"
artifacts:
paths:
- "*.deb"
- "*.1"
expire_in: 1 month
build:x86:
extends: .build
@ -72,72 +103,15 @@ build:cross-compile:
GOARCH: amd64
build:x86:deb:
stage: build
image: debian:latest
extends: .build-deb
before_script:
- apt-get update
- apt-get install -y git-buildpackage dh-golang bash-completion golang-any golang-github-spf13-cobra-dev golang-github-spf13-viper-dev
- apt-get install -y ./*.deb && rm -vf *.deb
- "sed -i 's/^Architecture:.*/Architecture: amd64/g' debian/control"
script:
- git checkout "${CI_COMMIT_BRANCH}" || true
- go run ./cmd/signaldctl doc -o man
- go run ./cmd/signaldctl completion bash > debian/package.bash-completion
- ls *.1 > debian/manpages
- gbp dch --ignore-branch --debian-tag="%(version)s" --git-author --new-version="$(git describe --abbrev=0 HEAD)+git$(date +%Y-%m-%d)r$(git rev-parse --short=8 HEAD).$(git rev-list $(git describe --abbrev=0 HEAD)..HEAD --count)"
- dpkg-buildpackage -us -uc -b
- mv ../*.deb .
needs:
- project: signald/libraries/golang-github-mdp-qrterminal
job: build
ref: master
artifacts: true
- project: signald/libraries/golang-github-jedib0t-go-pretty
job: build
ref: master
artifacts: true
variables:
SIGNALDCTL_PUBLIC_DOC_MODE: "on"
artifacts:
paths:
- "*.deb"
- "*.1"
expire_in: 1 month
build:aarch64:deb:
stage: build
image: debian:latest
extends: .build-deb
tags: [arm-builder]
before_script:
- apt-get update
- apt-get install -y git-buildpackage dh-golang bash-completion golang-any golang-github-spf13-cobra-dev golang-github-spf13-viper-dev
- apt-get install -y ./*.deb && rm -vf *.deb
- "sed -i 's/^Architecture:.*/Architecture: arm64/g' debian/control"
script:
- git checkout "${CI_COMMIT_BRANCH}" || true
- go run ./cmd/signaldctl doc -o man
- go run ./cmd/signaldctl completion bash > debian/package.bash-completion
- ls *.1 > debian/manpages
- gbp dch --ignore-branch --debian-tag="%(version)s" --git-author --new-version="$(git describe --abbrev=0 HEAD)+git$(date +%Y-%m-%d)r$(git rev-parse --short=8 HEAD).$(git rev-list $(git describe --abbrev=0 HEAD)..HEAD --count)"
- dpkg-buildpackage -us -uc -b
- mv ../*.deb .
needs:
- project: signald/libraries/golang-github-mdp-qrterminal
job: build
ref: master
artifacts: true
- project: signald/libraries/golang-github-jedib0t-go-pretty
job: build
ref: master
artifacts: true
variables:
SIGNALDCTL_PUBLIC_DOC_MODE: "on"
artifacts:
paths:
- "*.deb"
- "*.1"
expire_in: 1 month
publish deb:
image: registry.gitlab.com/signald/infrastructure/signald-builder-x86:d5e68709