From 5b98b6b13635533987d453caf71bff30331d6f8e Mon Sep 17 00:00:00 2001 From: Finn Date: Sat, 7 Aug 2021 13:16:49 -0700 Subject: [PATCH] Refactor deb build and remove git pull before build --- .gitlab-ci.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cd1ab35..196dafd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,6 @@ lint: - mkdir -p /go/src/gitlab.com/signald/signald-go - cp -r * /go/src/gitlab.com/signald/signald-go script: - - (git checkout "${CI_COMMIT_BRANCH}" && git pull) || true - VERSION="$(./version.sh)" - echo "building ${VERSION}" - cd /go/src/gitlab.com/signald/signald-go @@ -43,7 +42,7 @@ lint: - apt-get update - apt-get install -y -t buster-backports 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}" && git pull) || true + - 'sed -i "s/^Architecture:.*/Architecture: ${ARCH}/g" debian/control' - go run ./cmd/signaldctl doc -o man - go run ./cmd/signaldctl completion bash > debian/package.bash-completion - ls *.1 > debian/manpages @@ -93,7 +92,6 @@ build:cross-compile: - mkdir -p /go/src/gitlab.com/signald/signald-go - cp -r * /go/src/gitlab.com/signald/signald-go script: - - (git checkout "${CI_COMMIT_BRANCH}" && git pull)|| true - VERSION="$(./version.sh)" - echo "building ${VERSION}" - cd /go/src/gitlab.com/signald/signald-go @@ -117,23 +115,23 @@ build:cross-compile: build:x86:deb: extends: .build-deb - before_script: - - "sed -i 's/^Architecture:.*/Architecture: amd64/g' debian/control" rules: - when: on_success + variables: + ARCH: amd64 build:aarch64:deb: extends: .build-deb tags: [arm-builder] - before_script: - - "sed -i 's/^Architecture:.*/Architecture: arm64/g' debian/control" + variables: + ARCH: arm64 build:armhf:deb: extends: .build-deb image: arm32v7/debian:latest tags: [arm-builder] - before_script: - - "sed -i 's/^Architecture:.*/Architecture: armhf/g' debian/control" + variables: + ARCH: armhf publish deb: image: registry.gitlab.com/signald/infrastructure/signald-builder-x86:d5e68709 @@ -162,5 +160,4 @@ signald.org: trigger: signald/signald.org rules: - if: '$CI_PROJECT_NAMESPACE == "signald" && $CI_COMMIT_REF_PROTECTED == "true"' - when: on_success - \ No newline at end of file + when: on_success \ No newline at end of file