2019-08-14 11:18:10 +01:00
|
|
|
GO_VERSION ?= 1.12.8
|
2018-08-31 16:21:44 +01:00
|
|
|
GOOS ?= linux
|
|
|
|
GOARCH ?= amd64
|
2018-07-25 22:47:02 +01:00
|
|
|
COMPOSE_PROJECT_NAME := ${TAG}-$(shell git rev-parse --abbrev-ref HEAD)
|
2019-05-21 15:36:09 +01:00
|
|
|
BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD | sed "s!/!-!g")
|
|
|
|
ifeq (${BRANCH_NAME},master)
|
2019-03-07 18:58:55 +00:00
|
|
|
TAG := $(shell git rev-parse --short HEAD)-go${GO_VERSION}
|
|
|
|
TRACKED_BRANCH := true
|
|
|
|
LATEST_TAG := latest
|
2018-08-22 03:54:56 +01:00
|
|
|
else
|
2019-05-21 15:36:09 +01:00
|
|
|
TAG := $(shell git rev-parse --short HEAD)-${BRANCH_NAME}-go${GO_VERSION}
|
|
|
|
ifneq (,$(findstring release-,$(BRANCH_NAME)))
|
2019-03-07 18:58:55 +00:00
|
|
|
TRACKED_BRANCH := true
|
2019-05-21 15:36:09 +01:00
|
|
|
LATEST_TAG := ${BRANCH_NAME}-latest
|
2019-03-07 18:58:55 +00:00
|
|
|
endif
|
2018-08-22 03:54:56 +01:00
|
|
|
endif
|
2018-08-31 16:21:44 +01:00
|
|
|
CUSTOMTAG ?=
|
2018-07-25 22:47:02 +01:00
|
|
|
|
2018-08-31 16:21:44 +01:00
|
|
|
FILEEXT :=
|
|
|
|
ifeq (${GOOS},windows)
|
|
|
|
FILEEXT := .exe
|
|
|
|
endif
|
|
|
|
|
|
|
|
DOCKER_BUILD := docker build \
|
2019-04-08 21:01:20 +01:00
|
|
|
--build-arg TAG=${TAG}
|
2018-06-21 20:36:39 +01:00
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
.PHONY: help
|
|
|
|
help:
|
|
|
|
@awk 'BEGIN { \
|
|
|
|
FS = ":.*##"; \
|
|
|
|
printf "\nUsage:\n make \033[36m<target>\033[0m\n"\
|
|
|
|
} \
|
|
|
|
/^[a-zA-Z_-]+:.*?##/ { \
|
|
|
|
printf " \033[36m%-17s\033[0m %s\n", $$1, $$2 \
|
|
|
|
} \
|
|
|
|
/^##@/ { \
|
|
|
|
printf "\n\033[1m%s\033[0m\n", substr($$0, 5) \
|
|
|
|
} ' $(MAKEFILE_LIST)
|
|
|
|
|
|
|
|
##@ Dependencies
|
|
|
|
|
|
|
|
.PHONY: build-dev-deps
|
|
|
|
build-dev-deps: ## Install dependencies for builds
|
|
|
|
go get github.com/mattn/goveralls
|
|
|
|
go get golang.org/x/tools/cover
|
|
|
|
go get github.com/modocache/gover
|
2019-06-21 15:57:38 +01:00
|
|
|
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ${GOPATH}/bin v1.17.1
|
2018-10-16 19:47:43 +01:00
|
|
|
|
|
|
|
.PHONY: lint
|
|
|
|
lint: check-copyrights ## Analyze and find programs in source code
|
2018-04-23 17:05:52 +01:00
|
|
|
@echo "Running ${@}"
|
2018-09-11 14:13:25 +01:00
|
|
|
@golangci-lint run
|
2018-04-12 14:50:22 +01:00
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
.PHONY: check-copyrights
|
|
|
|
check-copyrights: ## Check source files for copyright headers
|
2018-04-23 17:05:52 +01:00
|
|
|
@echo "Running ${@}"
|
2018-11-15 12:47:52 +00:00
|
|
|
@go run ./scripts/check-copyright.go
|
2018-04-23 17:05:52 +01:00
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
.PHONY: goimports-fix
|
|
|
|
goimports-fix: ## Applies goimports to every go file (excluding vendored files)
|
2018-12-07 13:44:25 +00:00
|
|
|
goimports -w -local storj.io $$(find . -type f -name '*.go' -not -path "*/vendor/*")
|
2018-06-13 19:22:32 +01:00
|
|
|
|
2018-12-13 20:01:43 +00:00
|
|
|
.PHONY: goimports-st
|
|
|
|
goimports-st: ## Applies goimports to every go file in `git status` (ignores untracked files)
|
2019-01-22 12:35:48 +00:00
|
|
|
@git status --porcelain -uno|grep .go|grep -v "^D"|sed -E 's,\w+\s+(.+->\s+)?,,g'|xargs -I {} goimports -w -local storj.io {}
|
2018-12-13 20:01:43 +00:00
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
.PHONY: proto
|
|
|
|
proto: ## Rebuild protobuf files
|
2018-04-12 14:50:22 +01:00
|
|
|
@echo "Running ${@}"
|
2018-11-30 15:02:01 +00:00
|
|
|
go run scripts/protobuf.go install
|
|
|
|
go run scripts/protobuf.go generate
|
2018-04-17 18:29:15 +01:00
|
|
|
|
2019-06-27 19:52:50 +01:00
|
|
|
.PHONY: build-packages
|
|
|
|
build-packages: build-packages-race build-packages-normal ## Test docker images locally
|
|
|
|
build-packages-race:
|
|
|
|
go install -v ./...
|
|
|
|
build-packages-normal:
|
|
|
|
go install -v -race ./...
|
|
|
|
|
2019-01-16 23:09:57 +00:00
|
|
|
##@ Simulator
|
2019-01-16 18:50:16 +00:00
|
|
|
|
2019-01-16 23:09:57 +00:00
|
|
|
.PHONY: install-sim
|
|
|
|
install-sim: ## install storj-sim
|
2019-01-16 18:50:16 +00:00
|
|
|
@echo "Running ${@}"
|
2019-04-03 20:13:39 +01:00
|
|
|
@go install -race -v storj.io/storj/cmd/storj-sim storj.io/storj/cmd/versioncontrol storj.io/storj/cmd/bootstrap storj.io/storj/cmd/satellite storj.io/storj/cmd/storagenode storj.io/storj/cmd/uplink storj.io/storj/cmd/gateway storj.io/storj/cmd/identity storj.io/storj/cmd/certificates
|
2019-01-16 18:50:16 +00:00
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
##@ Test
|
2018-04-25 15:55:26 +01:00
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
.PHONY: test
|
2019-04-30 19:18:32 +01:00
|
|
|
test: ## Run tests on source code (jenkins)
|
2018-09-11 14:13:25 +01:00
|
|
|
go test -race -v -cover -coverprofile=.coverprofile ./...
|
2018-05-09 00:01:46 +01:00
|
|
|
@echo done
|
2018-06-05 22:06:37 +01:00
|
|
|
|
2019-01-16 23:09:57 +00:00
|
|
|
.PHONY: test-sim
|
2019-04-30 19:18:32 +01:00
|
|
|
test-sim: ## Test source with storj-sim (jenkins)
|
2019-01-08 15:24:15 +00:00
|
|
|
@echo "Running ${@}"
|
2019-01-16 23:09:57 +00:00
|
|
|
@./scripts/test-sim.sh
|
2019-01-08 15:24:15 +00:00
|
|
|
|
2019-01-04 17:23:23 +00:00
|
|
|
.PHONY: test-certificate-signing
|
2019-04-30 19:18:32 +01:00
|
|
|
test-certificate-signing: ## Test certificate signing service and storagenode setup (jenkins)
|
2019-01-04 17:23:23 +00:00
|
|
|
@echo "Running ${@}"
|
|
|
|
@./scripts/test-certificate-signing.sh
|
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
.PHONY: test-docker
|
|
|
|
test-docker: ## Run tests in Docker
|
2018-07-25 22:47:02 +01:00
|
|
|
docker-compose up -d --remove-orphans test
|
|
|
|
docker-compose run test make test
|
|
|
|
|
2019-06-04 18:12:27 +01:00
|
|
|
.PHONY: check-satellite-config-lock
|
|
|
|
check-satellite-config-lock: ## Test if the satellite config file has changed (jenkins)
|
|
|
|
@echo "Running ${@}"
|
|
|
|
@cd scripts; ./check-satellite-config-lock.sh
|
|
|
|
|
2018-08-23 16:48:03 +01:00
|
|
|
.PHONY: all-in-one
|
2018-10-16 19:47:43 +01:00
|
|
|
all-in-one: ## Deploy docker images with one storagenode locally
|
2019-01-03 19:54:27 +00:00
|
|
|
export VERSION="${TAG}${CUSTOMTAG}" \
|
|
|
|
&& $(MAKE) satellite-image storagenode-image gateway-image \
|
|
|
|
&& docker-compose up --scale storagenode=1 satellite gateway
|
|
|
|
|
|
|
|
.PHONY: test-all-in-one
|
|
|
|
test-all-in-one: ## Test docker images locally
|
|
|
|
export VERSION="${TAG}${CUSTOMTAG}" \
|
|
|
|
&& $(MAKE) satellite-image storagenode-image gateway-image \
|
|
|
|
&& ./scripts/test-aio.sh
|
2018-06-21 20:36:39 +01:00
|
|
|
|
2019-08-07 00:03:14 +01:00
|
|
|
.PHONY: test-sim-backwards-compatible
|
|
|
|
test-sim-backwards-compatible: ## Test uploading a file with lastest release (jenkins)
|
|
|
|
@echo "Running ${@}"
|
|
|
|
@./scripts/test-sim-backwards.sh
|
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
##@ Build
|
2018-07-13 16:02:33 +01:00
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
.PHONY: images
|
2019-05-21 12:57:20 +01:00
|
|
|
images: bootstrap-image gateway-image satellite-image storagenode-image uplink-image versioncontrol-image ## Build bootstrap, gateway, satellite, storagenode, uplink, and versioncontrol Docker images
|
2018-10-16 19:47:43 +01:00
|
|
|
echo Built version: ${TAG}
|
2018-08-23 22:04:51 +01:00
|
|
|
|
2019-05-21 12:57:20 +01:00
|
|
|
.PHONY: bootstrap-image
|
|
|
|
bootstrap-image: bootstrap_linux_arm bootstrap_linux_amd64 ## Build bootstrap Docker image
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/bootstrap:${TAG}${CUSTOMTAG}-amd64 \
|
|
|
|
-f cmd/bootstrap/Dockerfile .
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/bootstrap:${TAG}${CUSTOMTAG}-arm32v6 \
|
|
|
|
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
|
|
|
|
-f cmd/bootstrap/Dockerfile .
|
2018-12-04 21:10:23 +00:00
|
|
|
.PHONY: gateway-image
|
2019-04-08 21:01:20 +01:00
|
|
|
gateway-image: gateway_linux_arm gateway_linux_amd64 ## Build gateway Docker image
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/gateway:${TAG}${CUSTOMTAG}-amd64 \
|
|
|
|
-f cmd/gateway/Dockerfile .
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/gateway:${TAG}${CUSTOMTAG}-arm32v6 \
|
|
|
|
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
|
|
|
|
-f cmd/gateway/Dockerfile .
|
2018-10-16 19:47:43 +01:00
|
|
|
.PHONY: satellite-image
|
2019-04-08 21:01:20 +01:00
|
|
|
satellite-image: satellite_linux_arm satellite_linux_amd64 ## Build satellite Docker image
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/satellite:${TAG}${CUSTOMTAG}-amd64 \
|
|
|
|
-f cmd/satellite/Dockerfile .
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/satellite:${TAG}${CUSTOMTAG}-arm32v6 \
|
|
|
|
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
|
|
|
|
-f cmd/satellite/Dockerfile .
|
2018-10-16 19:47:43 +01:00
|
|
|
.PHONY: storagenode-image
|
2019-04-08 21:01:20 +01:00
|
|
|
storagenode-image: storagenode_linux_arm storagenode_linux_amd64 ## Build storagenode Docker image
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/storagenode:${TAG}${CUSTOMTAG}-amd64 \
|
|
|
|
-f cmd/storagenode/Dockerfile .
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/storagenode:${TAG}${CUSTOMTAG}-arm32v6 \
|
|
|
|
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
|
|
|
|
-f cmd/storagenode/Dockerfile .
|
2018-10-16 19:47:43 +01:00
|
|
|
.PHONY: uplink-image
|
2019-04-08 21:01:20 +01:00
|
|
|
uplink-image: uplink_linux_arm uplink_linux_amd64 ## Build uplink Docker image
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/uplink:${TAG}${CUSTOMTAG}-amd64 \
|
|
|
|
-f cmd/uplink/Dockerfile .
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/uplink:${TAG}${CUSTOMTAG}-arm32v6 \
|
|
|
|
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
|
|
|
|
-f cmd/uplink/Dockerfile .
|
2019-05-02 22:25:04 +01:00
|
|
|
.PHONY: versioncontrol-image
|
|
|
|
versioncontrol-image: versioncontrol_linux_arm versioncontrol_linux_amd64 ## Build versioncontrol Docker image
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/versioncontrol:${TAG}${CUSTOMTAG}-amd64 \
|
|
|
|
-f cmd/versioncontrol/Dockerfile .
|
|
|
|
${DOCKER_BUILD} --pull=true -t storjlabs/versioncontrol:${TAG}${CUSTOMTAG}-arm32v6 \
|
|
|
|
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
|
|
|
|
-f cmd/versioncontrol/Dockerfile .
|
2018-08-27 22:06:55 +01:00
|
|
|
|
2018-08-31 16:21:44 +01:00
|
|
|
.PHONY: binary
|
|
|
|
binary: CUSTOMTAG = -${GOOS}-${GOARCH}
|
|
|
|
binary:
|
2018-09-05 21:40:47 +01:00
|
|
|
@if [ -z "${COMPONENT}" ]; then echo "Try one of the following targets instead:" \
|
|
|
|
&& for b in binaries ${BINARIES}; do echo "- $$b"; done && exit 1; fi
|
2018-08-31 16:21:44 +01:00
|
|
|
mkdir -p release/${TAG}
|
2019-06-18 18:18:10 +01:00
|
|
|
mkdir -p /tmp/go-cache /tmp/go-pkg
|
2018-10-16 19:48:17 +01:00
|
|
|
rm -f cmd/${COMPONENT}/resource.syso
|
|
|
|
if [ "${GOARCH}" = "amd64" ]; then sixtyfour="-64"; fi; \
|
2018-11-26 14:11:09 +00:00
|
|
|
[ "${GOARCH}" = "amd64" ] && goversioninfo $$sixtyfour -o cmd/${COMPONENT}/resource.syso \
|
2018-10-16 19:48:17 +01:00
|
|
|
-original-name ${COMPONENT}_${GOOS}_${GOARCH}${FILEEXT} \
|
|
|
|
-description "${COMPONENT} program for Storj" \
|
2019-04-12 16:31:31 +01:00
|
|
|
-product-ver-build 9 -ver-build 9 \
|
|
|
|
-product-version "alpha9" \
|
2018-10-16 19:48:17 +01:00
|
|
|
resources/versioninfo.json || echo "goversioninfo is not installed, metadata will not be created"
|
2019-04-12 16:31:31 +01:00
|
|
|
docker run --rm -i -v "${PWD}":/go/src/storj.io/storj -e GO111MODULE=on \
|
2018-11-26 14:11:09 +00:00
|
|
|
-e GOOS=${GOOS} -e GOARCH=${GOARCH} -e GOARM=6 -e CGO_ENABLED=1 \
|
2019-06-18 18:18:10 +01:00
|
|
|
-v /tmp/go-cache:/tmp/.cache/go-build -v /tmp/go-pkg:/go/pkg \
|
2019-04-12 16:31:31 +01:00
|
|
|
-w /go/src/storj.io/storj -e GOPROXY -u $(shell id -u):$(shell id -g) storjlabs/golang:${GO_VERSION} \
|
|
|
|
scripts/release.sh build -o release/${TAG}/$(COMPONENT)_${GOOS}_${GOARCH}${FILEEXT} \
|
|
|
|
storj.io/storj/cmd/${COMPONENT}
|
2018-09-05 21:40:47 +01:00
|
|
|
chmod 755 release/${TAG}/$(COMPONENT)_${GOOS}_${GOARCH}${FILEEXT}
|
2018-10-17 19:21:18 +01:00
|
|
|
[ "${FILEEXT}" = ".exe" ] && storj-sign release/${TAG}/$(COMPONENT)_${GOOS}_${GOARCH}${FILEEXT} || echo "Skipping signing"
|
2018-08-31 16:21:44 +01:00
|
|
|
rm -f release/${TAG}/${COMPONENT}_${GOOS}_${GOARCH}.zip
|
|
|
|
|
2019-05-21 12:57:20 +01:00
|
|
|
.PHONY: bootstrap_%
|
|
|
|
bootstrap_%:
|
|
|
|
GOOS=$(word 2, $(subst _, ,$@)) GOARCH=$(word 3, $(subst _, ,$@)) COMPONENT=bootstrap $(MAKE) binary
|
|
|
|
$(MAKE) binary-check COMPONENT=bootstrap GOARCH=$(word 3, $(subst _, ,$@)) GOOS=$(word 2, $(subst _, ,$@))
|
2018-11-07 18:19:09 +00:00
|
|
|
.PHONY: gateway_%
|
|
|
|
gateway_%:
|
|
|
|
GOOS=$(word 2, $(subst _, ,$@)) GOARCH=$(word 3, $(subst _, ,$@)) COMPONENT=gateway $(MAKE) binary
|
2019-04-08 21:01:20 +01:00
|
|
|
$(MAKE) binary-check COMPONENT=gateway GOARCH=$(word 3, $(subst _, ,$@)) GOOS=$(word 2, $(subst _, ,$@))
|
2018-09-05 21:40:47 +01:00
|
|
|
.PHONY: satellite_%
|
|
|
|
satellite_%:
|
|
|
|
GOOS=$(word 2, $(subst _, ,$@)) GOARCH=$(word 3, $(subst _, ,$@)) COMPONENT=satellite $(MAKE) binary
|
2019-04-08 21:01:20 +01:00
|
|
|
$(MAKE) binary-check COMPONENT=satellite GOARCH=$(word 3, $(subst _, ,$@)) GOOS=$(word 2, $(subst _, ,$@))
|
2018-09-05 21:40:47 +01:00
|
|
|
.PHONY: storagenode_%
|
|
|
|
storagenode_%:
|
2019-04-08 21:01:20 +01:00
|
|
|
$(MAKE) binary-check COMPONENT=storagenode GOARCH=$(word 3, $(subst _, ,$@)) GOOS=$(word 2, $(subst _, ,$@))
|
|
|
|
.PHONY: binary-check
|
|
|
|
binary-check:
|
|
|
|
@if [ -f release/${TAG}/${COMPONENT}_${GOOS}_${GOARCH} ]; then echo "release/${TAG}/${COMPONENT}_${GOOS}_${GOARCH} exists"; else $(MAKE) binary; fi
|
2018-09-05 21:40:47 +01:00
|
|
|
.PHONY: uplink_%
|
|
|
|
uplink_%:
|
|
|
|
GOOS=$(word 2, $(subst _, ,$@)) GOARCH=$(word 3, $(subst _, ,$@)) COMPONENT=uplink $(MAKE) binary
|
2019-04-08 21:01:20 +01:00
|
|
|
$(MAKE) binary-check COMPONENT=uplink GOARCH=$(word 3, $(subst _, ,$@)) GOOS=$(word 2, $(subst _, ,$@))
|
2019-01-18 18:15:07 +00:00
|
|
|
.PHONY: identity_%
|
|
|
|
identity_%:
|
2019-04-08 21:01:20 +01:00
|
|
|
$(MAKE) binary-check COMPONENT=identity GOARCH=$(word 3, $(subst _, ,$@)) GOOS=$(word 2, $(subst _, ,$@))
|
2019-01-18 18:15:07 +00:00
|
|
|
.PHONY: certificates_%
|
|
|
|
certificates_%:
|
|
|
|
GOOS=$(word 2, $(subst _, ,$@)) GOARCH=$(word 3, $(subst _, ,$@)) COMPONENT=certificates $(MAKE) binary
|
2019-02-08 08:53:40 +00:00
|
|
|
.PHONY: inspector_%
|
|
|
|
inspector_%:
|
|
|
|
GOOS=$(word 2, $(subst _, ,$@)) GOARCH=$(word 3, $(subst _, ,$@)) COMPONENT=inspector $(MAKE) binary
|
2019-05-02 22:25:04 +01:00
|
|
|
.PHONY: versioncontrol_%
|
|
|
|
versioncontrol_%:
|
|
|
|
GOOS=$(word 2, $(subst _, ,$@)) GOARCH=$(word 3, $(subst _, ,$@)) COMPONENT=versioncontrol $(MAKE) binary
|
2018-09-05 21:40:47 +01:00
|
|
|
|
2019-05-21 12:57:20 +01:00
|
|
|
COMPONENTLIST := bootstrap certificates gateway identity inspector satellite storagenode uplink versioncontrol
|
2018-11-26 14:11:09 +00:00
|
|
|
OSARCHLIST := darwin_amd64 linux_amd64 linux_arm windows_amd64
|
2018-09-05 21:40:47 +01:00
|
|
|
BINARIES := $(foreach C,$(COMPONENTLIST),$(foreach O,$(OSARCHLIST),$C_$O))
|
2018-08-31 16:21:44 +01:00
|
|
|
.PHONY: binaries
|
2019-05-21 12:57:20 +01:00
|
|
|
binaries: ${BINARIES} ## Build bootstrap, certificates, gateway, identity, inspector, satellite, storagenode, uplink, and versioncontrol binaries (jenkins)
|
2018-10-16 19:47:43 +01:00
|
|
|
|
2019-06-15 12:23:12 +01:00
|
|
|
.PHONY: libuplink
|
|
|
|
libuplink:
|
2019-08-13 13:24:31 +01:00
|
|
|
go build -ldflags="-s -w" -buildmode c-shared -o uplink.so storj.io/storj/lib/uplinkc
|
2019-06-15 12:23:12 +01:00
|
|
|
cp lib/uplinkc/uplink_definitions.h uplink_definitions.h
|
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
##@ Deploy
|
|
|
|
|
|
|
|
.PHONY: deploy
|
|
|
|
deploy: ## Update Kubernetes deployments in staging (jenkins)
|
|
|
|
for deployment in $$(kubectl --context nonprod -n v3 get deployment -l app=storagenode --output=jsonpath='{.items..metadata.name}'); do \
|
|
|
|
kubectl --context nonprod --namespace v3 patch deployment $$deployment -p"{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"storagenode\",\"image\":\"storjlabs/storagenode:${TAG}\"}]}}}}" ; \
|
|
|
|
done
|
2019-04-26 06:08:42 +01:00
|
|
|
kubectl --context nonprod --namespace v3 patch deployment earth-satellite -p"{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"satellite\",\"image\":\"storjlabs/satellite:${TAG}\"}]}}}}"
|
2018-10-16 19:47:43 +01:00
|
|
|
|
|
|
|
.PHONY: push-images
|
|
|
|
push-images: ## Push Docker images to Docker Hub (jenkins)
|
2019-04-08 21:01:20 +01:00
|
|
|
# images have to be pushed before a manifest can be created
|
|
|
|
# satellite
|
2019-05-21 12:57:20 +01:00
|
|
|
for c in bootstrap gateway satellite storagenode uplink versioncontrol ; do \
|
2019-04-15 20:04:02 +01:00
|
|
|
docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-amd64 \
|
|
|
|
&& docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v6 \
|
2019-04-15 18:49:08 +01:00
|
|
|
&& for t in ${TAG}${CUSTOMTAG} ${LATEST_TAG}; do \
|
2019-04-15 19:30:36 +01:00
|
|
|
docker manifest create storjlabs/$$c:$$t storjlabs/$$c:${TAG}${CUSTOMTAG}-amd64 storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v6 \
|
|
|
|
&& docker manifest annotate storjlabs/$$c:$$t storjlabs/$$c:${TAG}${CUSTOMTAG}-amd64 --os linux --arch amd64 \
|
|
|
|
&& docker manifest annotate storjlabs/$$c:$$t storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v6 --os linux --arch arm --variant arm32v6 \
|
2019-04-15 18:49:08 +01:00
|
|
|
&& docker manifest push --purge storjlabs/$$c:$$t \
|
|
|
|
; done \
|
|
|
|
; done
|
2018-08-31 16:21:44 +01:00
|
|
|
|
|
|
|
.PHONY: binaries-upload
|
2018-10-16 19:47:43 +01:00
|
|
|
binaries-upload: ## Upload binaries to Google Storage (jenkins)
|
2019-04-12 18:28:04 +01:00
|
|
|
cd "release/${TAG}"; for f in *; do zip $${f}.zip $${f}; done
|
2019-04-08 21:01:20 +01:00
|
|
|
cd "release/${TAG}"; gsutil -m cp -r *.zip "gs://storj-v3-alpha-builds/${TAG}/"
|
2018-08-31 16:21:44 +01:00
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
##@ Clean
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean: test-docker-clean binaries-clean clean-images ## Clean docker test environment, local release binaries, and local Docker images
|
|
|
|
|
2018-08-31 16:21:44 +01:00
|
|
|
.PHONY: binaries-clean
|
2018-10-16 19:47:43 +01:00
|
|
|
binaries-clean: ## Remove all local release binaries (jenkins)
|
2018-08-31 16:21:44 +01:00
|
|
|
rm -rf release
|
|
|
|
|
2018-10-16 19:47:43 +01:00
|
|
|
.PHONY: clean-images
|
|
|
|
clean-images:
|
2019-05-21 12:57:20 +01:00
|
|
|
-docker rmi storjlabs/bootstrap:${TAG}${CUSTOMTAG}
|
2019-03-07 15:22:18 +00:00
|
|
|
-docker rmi storjlabs/gateway:${TAG}${CUSTOMTAG}
|
|
|
|
-docker rmi storjlabs/satellite:${TAG}${CUSTOMTAG}
|
|
|
|
-docker rmi storjlabs/storagenode:${TAG}${CUSTOMTAG}
|
|
|
|
-docker rmi storjlabs/uplink:${TAG}${CUSTOMTAG}
|
2019-05-21 12:57:20 +01:00
|
|
|
-docker rmi storjlabs/versioncontrol:${TAG}${CUSTOMTAG}
|
2018-10-16 19:47:43 +01:00
|
|
|
|
|
|
|
.PHONY: test-docker-clean
|
|
|
|
test-docker-clean: ## Clean up Docker environment used in test-docker target
|
|
|
|
-docker-compose down --rmi all
|
|
|
|
|
2019-05-09 14:25:44 +01:00
|
|
|
|
|
|
|
##@ Tooling
|
|
|
|
|
2019-06-04 18:12:27 +01:00
|
|
|
.PHONY: update-satellite-config-lock
|
|
|
|
update-satellite-config-lock: ## Update the satellite config lock file
|
2019-05-09 14:25:44 +01:00
|
|
|
@docker run -ti --rm \
|
|
|
|
-v ${GOPATH}/pkg/mod:/go/pkg/mod \
|
|
|
|
-v $(shell pwd):/storj \
|
|
|
|
-v $(shell go env GOCACHE):/go-cache \
|
|
|
|
-e "GOCACHE=/go-cache" \
|
|
|
|
-u root:root \
|
|
|
|
golang:${GO_VERSION} \
|
2019-06-04 18:12:27 +01:00
|
|
|
/bin/bash -c "cd /storj/scripts; ./update-satellite-config-lock.sh"
|