2018-10-09 00:37:39 +00:00
|
|
|
stages:
|
|
|
|
- build
|
2021-01-30 04:26:54 +00:00
|
|
|
- publish
|
2018-10-09 00:37:39 +00:00
|
|
|
|
|
|
|
lint:
|
2021-05-06 03:05:12 +00:00
|
|
|
image: golang:latest
|
2020-11-22 08:26:30 +00:00
|
|
|
stage: build
|
2018-10-09 00:39:16 +00:00
|
|
|
before_script:
|
2021-05-06 03:05:12 +00:00
|
|
|
- apt-get update
|
|
|
|
- apt-get install -y wget golang-go
|
|
|
|
- wget https://github.com/golangci/golangci-lint/releases/download/v1.39.0/golangci-lint-1.39.0-linux-amd64.deb
|
|
|
|
- apt-get install -y ./golangci-lint-1.39.0-linux-amd64.deb
|
2018-10-09 00:37:39 +00:00
|
|
|
script:
|
2020-11-22 08:26:30 +00:00
|
|
|
- golangci-lint run
|
2020-10-13 05:24:11 +00:00
|
|
|
- go mod tidy
|
|
|
|
- diff --color=always go.mod "${CI_PROJECT_DIR}/go.mod"
|
|
|
|
- diff --color=always go.sum "${CI_PROJECT_DIR}/go.sum"
|
2018-10-09 00:37:39 +00:00
|
|
|
|
2021-02-03 08:10:45 +00:00
|
|
|
.build:
|
2018-10-09 00:37:39 +00:00
|
|
|
stage: build
|
|
|
|
image: golang:latest
|
2018-10-09 00:39:16 +00:00
|
|
|
before_script:
|
2020-10-13 05:24:11 +00:00
|
|
|
- mkdir -p /go/src/gitlab.com/signald/signald-go
|
|
|
|
- cp -r * /go/src/gitlab.com/signald/signald-go
|
2018-10-09 00:37:39 +00:00
|
|
|
script:
|
2021-02-03 08:10:45 +00:00
|
|
|
- git checkout "${CI_COMMIT_BRANCH}"
|
|
|
|
- VERSION="$(git describe --abbrev=0 HEAD)-$(git rev-list $(git describe --abbrev=0 HEAD)..HEAD --count)-$(git rev-parse --short=8 HEAD)"
|
|
|
|
- echo "building ${VERSION}"
|
|
|
|
- cd /go/src/gitlab.com/signald/signald-go
|
|
|
|
- go build -o "${CI_PROJECT_DIR}/signaldctl" --ldflags "-X gitlab.com/signald/signald-go/cmd/signaldctl/common.Version=${VERSION} -X gitlab.com/signald/signald-go/cmd/signaldctl/common.Branch=${CI_COMMIT_BRANCH} -X gitlab.com/signald/signald-go/cmd/signaldctl/common.Commit=${CI_COMMIT_SHA}" ./cmd/signaldctl
|
2018-10-09 00:37:39 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-12-13 00:33:29 +00:00
|
|
|
- signaldctl
|
2018-10-09 00:37:39 +00:00
|
|
|
expire_in: 1 month
|
2020-12-13 02:43:30 +00:00
|
|
|
|
2021-02-03 08:10:45 +00:00
|
|
|
build:x86:
|
|
|
|
extends: .build
|
|
|
|
|
|
|
|
build:aarch64:
|
|
|
|
tags: [arm-builder]
|
|
|
|
extends: .build
|
2021-04-05 22:25:42 +00:00
|
|
|
rules:
|
|
|
|
- if: '$CI_PROJECT_NAMESPACE == "signald" && $CI_COMMIT_REF_PROTECTED == "true"'
|
|
|
|
when: on_success
|
|
|
|
- when: manual
|
|
|
|
allow_failure: true
|
2021-02-03 08:10:45 +00:00
|
|
|
|
2021-02-03 05:33:47 +00:00
|
|
|
build:cross-compile:
|
|
|
|
stage: build
|
|
|
|
image: golang:latest
|
|
|
|
before_script:
|
|
|
|
- mkdir -p /go/src/gitlab.com/signald/signald-go
|
|
|
|
- cp -r * /go/src/gitlab.com/signald/signald-go
|
|
|
|
script:
|
2021-02-03 08:10:45 +00:00
|
|
|
- git checkout "${CI_COMMIT_BRANCH}"
|
|
|
|
- VERSION="$(git describe --abbrev=0 HEAD)-$(git rev-list $(git describe --abbrev=0 HEAD)..HEAD --count)-$(git rev-parse --short=8 HEAD)"
|
|
|
|
- echo "building ${VERSION}"
|
|
|
|
- cd /go/src/gitlab.com/signald/signald-go
|
|
|
|
- go build -o "${CI_PROJECT_DIR}/signaldctl-${GOOS}-${GOARCH}" --ldflags "-X gitlab.com/signald/signald-go/cmd/signaldctl/common.Version=${VERSION} -X gitlab.com/signald/signald-go/cmd/signaldctl/common.Branch=${CI_COMMIT_BRANCH} -X gitlab.com/signald/signald-go/cmd/signaldctl/common.Commit=${CI_COMMIT_SHA}" ./cmd/signaldctl
|
2021-02-03 05:33:47 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- signaldctl-*
|
|
|
|
expire_in: 1 month
|
|
|
|
parallel:
|
|
|
|
matrix:
|
|
|
|
- GOOS: linux
|
|
|
|
GOARCH:
|
|
|
|
- arm
|
|
|
|
- arm64
|
|
|
|
- amd64
|
|
|
|
- GOOS: darwin
|
|
|
|
GOARCH: amd64
|
|
|
|
|
2021-01-30 04:26:54 +00:00
|
|
|
build:x86:deb:
|
|
|
|
stage: build
|
|
|
|
image: debian:latest
|
|
|
|
before_script:
|
|
|
|
- apt-get update
|
2021-02-03 05:35:42 +00:00
|
|
|
- apt-get install -y git-buildpackage dh-golang bash-completion golang-any golang-github-spf13-cobra-dev golang-github-spf13-viper-dev
|
2021-01-30 10:11:29 +00:00
|
|
|
- apt-get install -y ./*.deb && rm -vf *.deb
|
2021-04-05 22:25:42 +00:00
|
|
|
- "sed -i 's/^Architecture:.*/Architecture: amd64/g' debian/control"
|
2021-01-30 04:26:54 +00:00
|
|
|
script:
|
2021-02-03 10:30:14 +00:00
|
|
|
- git checkout "${CI_COMMIT_BRANCH}"
|
2021-02-03 05:03:02 +00:00
|
|
|
- go run ./cmd/signaldctl doc -o man
|
|
|
|
- go run ./cmd/signaldctl completion bash > debian/package.bash-completion
|
2021-02-03 01:13:31 +00:00
|
|
|
- ls *.1 > debian/manpages
|
2021-02-03 08:39:48 +00:00
|
|
|
- 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)"
|
2021-01-30 04:26:54 +00:00
|
|
|
- dpkg-buildpackage -us -uc -b
|
2021-01-30 09:51:16 +00:00
|
|
|
- mv ../*.deb .
|
2021-01-30 04:26:54 +00:00
|
|
|
needs:
|
2021-01-31 10:03:40 +00:00
|
|
|
- project: signald/libraries/golang-github-mdp-qrterminal
|
|
|
|
job: build
|
|
|
|
ref: master
|
|
|
|
artifacts: true
|
|
|
|
- project: signald/libraries/golang-github-jedib0t-go-pretty
|
2021-01-30 04:26:54 +00:00
|
|
|
job: build
|
|
|
|
ref: master
|
|
|
|
artifacts: true
|
2021-02-03 05:03:02 +00:00
|
|
|
variables:
|
2021-02-03 05:17:57 +00:00
|
|
|
SIGNALDCTL_PUBLIC_DOC_MODE: "on"
|
2021-01-30 04:26:54 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2021-01-30 09:51:16 +00:00
|
|
|
- "*.deb"
|
2021-02-03 01:13:31 +00:00
|
|
|
- "*.1"
|
2021-01-30 04:26:54 +00:00
|
|
|
expire_in: 1 month
|
|
|
|
|
2021-04-05 22:25:42 +00:00
|
|
|
build:aarch64:deb:
|
|
|
|
stage: build
|
|
|
|
image: debian:latest
|
|
|
|
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}"
|
|
|
|
- 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
|
|
|
|
|
|
|
|
|
2021-02-02 23:03:17 +00:00
|
|
|
publish deb:
|
2021-01-30 04:26:54 +00:00
|
|
|
image: registry.gitlab.com/signald/infrastructure/signald-builder-x86:d5e68709
|
|
|
|
stage: publish
|
|
|
|
tags: [deb-signer]
|
2021-04-13 08:23:51 +00:00
|
|
|
needs: ["build:x86:deb", "build:aarch64:deb"]
|
2021-01-30 04:26:54 +00:00
|
|
|
script:
|
|
|
|
- aptly repo create signald
|
|
|
|
- aptly mirror create -ignore-signatures backfill-mirror https://updates.signald.org "${DISTRIBUTION}" main
|
|
|
|
- aptly mirror update -ignore-signatures backfill-mirror
|
2021-01-30 10:51:10 +00:00
|
|
|
- aptly repo import backfill-mirror signald signald signaldctl
|
2021-01-30 04:26:54 +00:00
|
|
|
- aptly repo add signald *.deb
|
|
|
|
- aptly publish repo -config=.aptly.conf -batch -gpg-key="${SIGNING_KEY}" -distribution="${DISTRIBUTION}" "signald" "s3:updates.signald.org:"
|
|
|
|
variables:
|
|
|
|
DISTRIBUTION: unstable
|
|
|
|
only:
|
|
|
|
- main
|
2021-02-02 21:40:02 +00:00
|
|
|
- tags
|
|
|
|
|
2021-03-25 02:27:23 +00:00
|
|
|
docs.signald.org:
|
2021-02-02 21:40:02 +00:00
|
|
|
stage: publish
|
|
|
|
needs: ["build:x86"]
|
2021-03-26 01:02:09 +00:00
|
|
|
trigger: signald/signald.org
|
2021-03-25 02:27:23 +00:00
|
|
|
only:
|
|
|
|
- main
|