aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorHans-Christoph Steiner <hans@eds.org>2020-07-16 20:09:20 +0200
committerHans-Christoph Steiner <hans@eds.org>2021-12-01 11:48:06 +0100
commit51f2c026fde882c5c7b84b0aebe976703752f866 (patch)
treec17722edcc406ac25beabc50f52855a760c11397 /.gitlab-ci.yml
parent1318b6a9ec69b1e776d8ed5e0a99ab20eef3576c (diff)
downloadsnowflake-51f2c026fde882c5c7b84b0aebe976703752f866.tar.gz
snowflake-51f2c026fde882c5c7b84b0aebe976703752f866.zip
gitlab-ci: include flags to make reproducible builds
* https://github.com/golang/go/issues/33772
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml14
1 files changed, 8 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 35caa6c..c9dd50b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,9 @@
+variables:
+ DEBIAN_FRONTEND: noninteractive
+ REPRODUCIBLE_FLAGS: -trimpath -ldflags=-buildid=
+
+# set up apt for automated use
.apt-template: &apt-template
- export LC_ALL=C.UTF-8
- export DEBIAN_FRONTEND=noninteractive
@@ -13,13 +18,13 @@
- apt-get update
- apt-get dist-upgrade
+
# Set things up to use the OS-native packages for Go. Anything that
# is downloaded by go during the `go fmt` stage is not coming from the
# Debian/Ubuntu repo. So those would need to be packaged for this to
# make it into Debian and/or Ubuntu.
.debian-native-template: &debian-native-template
variables:
- DEBIAN_FRONTEND: noninteractive
GOPATH: /usr/share/gocode
before_script:
- apt-get update
@@ -47,8 +52,6 @@
# use Go installed as part of the official, Debian-based Docker images
.golang-docker-debian-template: &golang-docker-debian-template
- variables:
- DEBIAN_FRONTEND: noninteractive
before_script:
- apt-get update
- apt-get -qy install --no-install-recommends
@@ -63,7 +66,7 @@
- cd $CI_PROJECT_DIR/client/
- go get
- - go build
+ - go build $REPRODUCIBLE_FLAGS
.test-template: &test-template
artifacts:
@@ -86,7 +89,6 @@ android:
image: debian:bullseye-backports
variables:
ANDROID_HOME: /usr/lib/android-sdk
- DEBIAN_FRONTEND: noninteractive
GOPATH: "/go"
LANG: C.UTF-8
PATH: "/go/bin:/usr/lib/go-1.16/bin:/usr/bin:/bin"
@@ -135,7 +137,7 @@ android:
# gomobile builds a shared library not a CLI executable
- sed -i 's,^package main$,package snowflakeclient,' snowflake.go
- go get golang.org/x/mobile/bind
- - gomobile bind -v -target=android -trimpath .
+ - gomobile bind -v -target=android $REPRODUCIBLE_FLAGS .
go-1.13:
image: golang:1.13-stretch