From 235ec55978959f9c3a427cb34c90d70f244565fe Mon Sep 17 00:00:00 2001 From: Finn Date: Fri, 9 Jul 2021 01:44:10 -0700 Subject: [PATCH] Standardize the deb build template --- .gitlab-ci.yml | 94 ++++++++++++++++++-------------------------------- 1 file changed, 34 insertions(+), 60 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c28a21..d68881c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 + - "sed -i 's/^Architecture:.*/Architecture: amd64/g' debian/control" 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