File tree Expand file tree Collapse file tree 5 files changed +29
-20
lines changed
Expand file tree Collapse file tree 5 files changed +29
-20
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,19 @@ VERSION = $(shell cat VERSION)
1212export GITHUB_USER ?= status-im
1313export GITHUB_REPO ?= $(PROJECT_NAME )
1414
15- export IMAGE_TAG ?= latest
15+ export IMAGE_TAG ?= xgo-1.18.1
1616export IMAGE_NAME ?= statusteam/keycard-cli-ci :$(IMAGE_TAG )
1717
1818export GO_PROJECT_PATH ?= github.com/$(GITHUB_USER ) /$(GITHUB_REPO )
1919
20- deps :
20+ deps : install-xgo install-github-release
2121 go version
22- go install github.com/karalabe/xgo@latest
23- go install github.com/aktau/github-release@latest
22+
23+ install-xgo :
24+ go install github.com/crazy-max/xgo@v0.23.0
25+
26+ install-github-release :
27+ go install github.com/aktau/github-release@v0.10.0
2428
2529build :
2630 go build -o $(GOBIN ) /$(BIN_NAME ) -v -ldflags " -X main.version=$( VERSION) " .
@@ -35,10 +39,10 @@ docker-image:
3539
3640build-platforms :
3741 xgo \
38- -ldflags " -X main.version=$( VERSION) " \
39- -out $(BIN_NAME ) \
40- -dest $(GOBIN ) \
41- -image $(IMAGE_NAME ) \
42+ -ldflags= " -X main.version=$( VERSION) " \
43+ -out= $(BIN_NAME ) \
44+ -dest= $(GOBIN ) \
45+ -docker- image= $(IMAGE_NAME ) \
4246 -targets=$(XGO_TARGETS ) .
4347
4448release :
Original file line number Diff line number Diff line change @@ -13,14 +13,14 @@ pipeline {
1313 }
1414
1515 environment {
16- PROJECT = ' src/github.com/status-im/keycard-cli'
16+ PROJECT = " ${ env.WORKSPACE } / src/github.com/status-im/keycard-cli"
1717 GOPATH = " ${ env.WORKSPACE} "
1818 PATH = " ${ env.PATH} :${ env.GOPATH} /bin"
1919 }
2020
2121 stages {
2222 stage(' Prep' ) {
23- steps { dir(env . PROJECT ) {
23+ steps { dir(PROJECT ) {
2424 sh ' make deps'
2525 } }
2626 }
@@ -29,7 +29,7 @@ pipeline {
2929 agent {
3030 docker {
3131 label ' linux'
32- image ' statusteam/keycard-cli-ci:latest '
32+ image ' statusteam/keycard-cli-ci:xgo-1.18.1 '
3333 args ' --entrypoint=""' /* allows jenkins use cat */
3434 }
3535 }
@@ -40,25 +40,25 @@ pipeline {
4040 options {
4141 checkoutToSubdirectory(' src/github.com/status-im/keycard-cli' )
4242 }
43- steps { dir(env . PROJECT ) {
43+ steps { dir(PROJECT ) {
4444 sh ' make test'
4545 } }
4646 }
4747
4848 stage(' Build' ) {
49- steps { script { dir(env . PROJECT ) {
49+ steps { script { dir(PROJECT ) {
5050 sh ' make build-platforms'
5151 } } }
5252 }
5353
5454 stage(' Archive' ) {
55- steps { dir(env . PROJECT ) {
55+ steps { dir(PROJECT ) {
5656 archiveArtifacts(' build/bin/*' )
5757 } }
5858 }
5959
6060 stage(' Release' ) {
61- steps { dir(env . PROJECT ) {
61+ steps { dir(PROJECT ) {
6262 withCredentials([usernamePassword(
6363 credentialsId : ' status-im-auto' ,
6464 usernameVariable : ' GITHUB_USER_NAME' ,
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ pipeline {
22 agent {
33 docker {
44 label 'linux'
5- image 'statusteam/keycard-cli-ci:latest '
5+ image 'statusteam/keycard-cli-ci:xgo-1.18.1 '
66 args '--entrypoint=""' /* allows jenkins use cat */
77 }
88 }
Original file line number Diff line number Diff line change 1- FROM karalabe/xgo-1.13.x
1+ ARG GO_VERSION=1.18.1
2+ FROM crazymax/xgo:$GO_VERSION
23
34ENV LANG=en_US.UTF-8 \
45 LC_ALL=en_US.UTF-8 \
@@ -10,7 +11,9 @@ RUN apt-get update \
1011 && locale-gen ${LANG} \
1112 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1213
14+ # Jenkins user needs a specific UID/GID to work
15+ RUN groupadd -g 1001 jenkins \
16+ && useradd --create-home -u 1001 -g 1001 jenkins
17+
1318MAINTAINER Jakub Sokolowski "jakub@status.im"
1419LABEL description="Image for building keycard-cli tool."
15-
16- ENTRYPOINT ["/build.sh" ]
Original file line number Diff line number Diff line change 11GIT_COMMIT = $(shell git rev-parse --short HEAD)
22GIT_ROOT = $(shell git rev-parse --show-toplevel)
33
4- IMAGE_TAG ?= latest
4+ GO_VERSION ?= 1.18.1
5+ IMAGE_TAG ?= xgo-$(GO_VERSION )
56IMAGE_NAME ?= statusteam/keycard-cli-ci:$(IMAGE_TAG )
67
78build :
89 docker build \
10+ --build-arg " GO_VERSION=$( GO_VERSION) " \
911 --label " commit=$( GIT_COMMIT) " \
1012 -t $(IMAGE_NAME ) .
1113
You can’t perform that action at this time.
0 commit comments