Attempt to fix jenkins builds (#260)
* Attempt to clean up docker image tags * Clean only master * Add back go version and actually use it
This commit is contained in:
parent
15657071d7
commit
5841065420
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -10,8 +10,10 @@ node('node') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Push Images') {
|
stage('Push Images') {
|
||||||
echo 'Push to Repo'
|
if (env.BRANCH_NAME == "master") {
|
||||||
sh 'make push-images'
|
echo 'Push to Repo'
|
||||||
|
sh 'make push-images'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
|
28
Makefile
28
Makefile
@ -1,9 +1,15 @@
|
|||||||
.PHONY: test lint proto check-copyrights build-dev-deps
|
.PHONY: test lint proto check-copyrights build-dev-deps
|
||||||
|
|
||||||
TAG := $$(git rev-parse --short HEAD)
|
|
||||||
GO_VERSION := 1.10
|
GO_VERSION ?= 1.10
|
||||||
COMPOSE_PROJECT_NAME := ${TAG}-$(shell git rev-parse --abbrev-ref HEAD)
|
COMPOSE_PROJECT_NAME := ${TAG}-$(shell git rev-parse --abbrev-ref HEAD)
|
||||||
GO_DIRS := $(shell go list ./... | grep -v storj.io/storj/examples)
|
GO_DIRS := $(shell go list ./... | grep -v storj.io/storj/examples)
|
||||||
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
|
ifeq (${BRANCH},master)
|
||||||
|
TAG := $(shell git rev-parse --short HEAD)-go${GO_VERSION}
|
||||||
|
else
|
||||||
|
TAG := $(shell git rev-parse --short HEAD)-${BRANCH}-go${GO_VERSION}
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
lint: check-copyrights
|
lint: check-copyrights
|
||||||
@ -93,20 +99,26 @@ test-docker-clean:
|
|||||||
-docker-compose down --rmi all
|
-docker-compose down --rmi all
|
||||||
|
|
||||||
images:
|
images:
|
||||||
docker build --build-arg VERSION=${GO_VERSION} -t storjlabs/satellite:${TAG}-${GO_VERSION} -f cmd/hc/Dockerfile .
|
docker build --build-arg GO_VERSION=${GO_VERSION} -t storjlabs/satellite:${TAG} -f cmd/hc/Dockerfile .
|
||||||
docker tag storjlabs/satellite:${TAG}-${GO_VERSION} storjlabs/satellite:latest
|
docker build --build-arg GO_VERSION=${GO_VERSION} -t storjlabs/storage-node:${TAG} -f cmd/farmer/Dockerfile .
|
||||||
docker build -t storjlabs/storage-node:${TAG} -f cmd/farmer/Dockerfile .
|
|
||||||
docker tag storjlabs/storage-node:${TAG} storjlabs/storage-node:latest
|
|
||||||
|
|
||||||
push-images:
|
push-images:
|
||||||
docker push storjlabs/satellite:${TAG}-${GO_VERSION}
|
docker tag storjlabs/satellite:${TAG} storjlabs/satellite:latest
|
||||||
|
docker push storjlabs/satellite:${TAG}
|
||||||
docker push storjlabs/satellite:latest
|
docker push storjlabs/satellite:latest
|
||||||
|
docker tag storjlabs/storage-node:${TAG} storjlabs/storage-node:latest
|
||||||
docker push storjlabs/storage-node:${TAG}
|
docker push storjlabs/storage-node:${TAG}
|
||||||
docker push storjlabs/storage-node:latest
|
docker push storjlabs/storage-node:latest
|
||||||
|
|
||||||
|
ifeq (${BRANCH},master)
|
||||||
clean-images:
|
clean-images:
|
||||||
-docker rmi storjlabs/satellite:${TAG}-${GO_VERSION} storjlabs/satellite:latest
|
-docker rmi storjlabs/satellite:${TAG} storjlabs/satellite:latest
|
||||||
-docker rmi storjlabs/storage-node:${TAG} storjlabs/storage-node:latest
|
-docker rmi storjlabs/storage-node:${TAG} storjlabs/storage-node:latest
|
||||||
|
else
|
||||||
|
clean-images:
|
||||||
|
-docker rmi storjlabs/satellite:${TAG}
|
||||||
|
-docker rmi storjlabs/storage-node:${TAG}
|
||||||
|
endif
|
||||||
|
|
||||||
install-deps:
|
install-deps:
|
||||||
go get -u -v golang.org/x/vgo
|
go get -u -v golang.org/x/vgo
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# build
|
# build
|
||||||
FROM golang:1.10-alpine AS build-env
|
ARG GO_VERSION=1.10
|
||||||
RUN apk add -U curl git musl-dev gcc \
|
FROM golang:${GO_VERSION}-alpine AS build-env
|
||||||
&& apk add git
|
RUN apk add -U curl git musl-dev gcc
|
||||||
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||||
COPY . /go/src/storj.io/storj
|
COPY . /go/src/storj.io/storj
|
||||||
RUN cd /go/src/storj.io/storj && dep ensure -vendor-only
|
RUN cd /go/src/storj.io/storj && dep ensure -vendor-only
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
FROM golang:1.10-alpine AS build-env
|
ARG GO_VERSION=1.10
|
||||||
|
FROM golang:${GO_VERSION}-alpine AS build-env
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
apk upgrade && \
|
apk upgrade && \
|
||||||
apk add curl && \
|
apk add curl && \
|
||||||
|
Loading…
Reference in New Issue
Block a user