File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,11 +6,20 @@ def getBasePath = { String filepath ->
66 return filepath. substring(0 , filename)
77}
88
9+ def make = { String target ->
10+ try {
11+ sh " make ${ target} fileperms"
12+ } catch (error) {
13+ sh " make fileperms"
14+ false
15+ }
16+ }
17+
918def upload_artifacts = { String filepath ->
1019 withCredentials([[$class : ' FileBinding' , credentialsId : ' e80fd033-dd76-4d96-be79-6c272726fb82' , variable : ' GCSKEY' ]]) {
1120 sh " mkdir -p ${ getBasePath(filepath)} "
1221 sh " cat \"\$ {GCSKEY}\" > ${ filepath} "
13- sh " make upload-gcs"
22+ make ' upload-gcs'
1423 }
1524}
1625
@@ -57,9 +66,9 @@ node('linux') {
5766 stage ' Checkout Linux'
5867 checkout scm
5968 stage ' Install Linux'
60- sh ' make bootstrap'
69+ make ' bootstrap'
6170 stage ' Test Linux'
62- sh ' make test'
71+ make ' test'
6372 }
6473}
6574
@@ -100,8 +109,9 @@ parallel(
100109 env. BUILD_ARCH = " amd64"
101110 }
102111
103- sh ' make bootstrap'
104- sh " VERSION=${ git_commit.take(7)} make build-revision"
112+ make ' bootstrap'
113+ env. VERSION = git_commit. take(7 )
114+ make ' build-revision'
105115
106116 upload_artifacts(keyfile)
107117 }
@@ -116,8 +126,8 @@ parallel(
116126 checkout scm
117127
118128 if (git_branch == " remotes/origin/master" ) {
119- sh ' make bootstrap'
120- sh ' make build-latest'
129+ make ' bootstrap'
130+ make ' build-latest'
121131
122132 upload_artifacts(keyfile)
123133 } else {
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ GOTEST = go test --cover --race -v
3434GIT_TAG := $(shell git tag -l --contains HEAD)
3535VERSION ?= $(shell git rev-parse --short HEAD)
3636
37+ # UID and GID of local user
38+ UID := $(shell id -u)
39+ GID := $(shell id -g)
40+
3741define check-static-binary
3842 if file $(1 ) | egrep -q "(statically linked|Mach-O)"; then \
3943 echo -n ""; \
@@ -105,3 +109,7 @@ upload-gcs:
105109 ${GSUTIL_CMD} sh -c ' gsutil -mq cp -a public-read -r /upload/* ${GCS_BUCKET}'
106110 # This has to run in the container to delete files created by the container
107111 ${GSUTIL_CMD} sh -c ' rm -rf /.config/*'
112+
113+ # Set local user as owner for files
114+ fileperms :
115+ ${DEV_ENV_PREFIX_CGO_ENABLED} ${DEV_ENV_IMAGE} chown -R ${UID} :${GID} .
You can’t perform that action at this time.
0 commit comments