diff --git a/Makefile b/Makefile index 1ef282444..139b11fe3 100644 --- a/Makefile +++ b/Makefile @@ -146,6 +146,13 @@ uplink-image: uplink_linux_arm uplink_linux_amd64 ## Build uplink Docker image ${DOCKER_BUILD} --pull=true -t storjlabs/uplink:${TAG}${CUSTOMTAG}-arm32v6 \ --build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \ -f cmd/uplink/Dockerfile . +.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 . .PHONY: binary binary: CUSTOMTAG = -${GOOS}-${GOARCH} @@ -197,8 +204,11 @@ certificates_%: .PHONY: inspector_% inspector_%: GOOS=$(word 2, $(subst _, ,$@)) GOARCH=$(word 3, $(subst _, ,$@)) COMPONENT=inspector $(MAKE) binary +.PHONY: versioncontrol_% +versioncontrol_%: + GOOS=$(word 2, $(subst _, ,$@)) GOARCH=$(word 3, $(subst _, ,$@)) COMPONENT=versioncontrol $(MAKE) binary -COMPONENTLIST := gateway satellite storagenode uplink identity certificates inspector +COMPONENTLIST := gateway satellite storagenode uplink identity certificates inspector versioncontrol OSARCHLIST := darwin_amd64 linux_amd64 linux_arm windows_amd64 BINARIES := $(foreach C,$(COMPONENTLIST),$(foreach O,$(OSARCHLIST),$C_$O)) .PHONY: binaries @@ -217,7 +227,7 @@ deploy: ## Update Kubernetes deployments in staging (jenkins) push-images: ## Push Docker images to Docker Hub (jenkins) # images have to be pushed before a manifest can be created # satellite - for c in satellite storagenode uplink gateway; do \ + for c in satellite storagenode uplink gateway versioncontrol; do \ docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-amd64 \ && docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v6 \ && for t in ${TAG}${CUSTOMTAG} ${LATEST_TAG}; do \ diff --git a/cmd/versioncontrol/Dockerfile b/cmd/versioncontrol/Dockerfile new file mode 100644 index 000000000..d6c6bd18f --- /dev/null +++ b/cmd/versioncontrol/Dockerfile @@ -0,0 +1,10 @@ +ARG DOCKER_ARCH +FROM ${DOCKER_ARCH:-amd64}/alpine +ARG TAG +ARG GOARCH +ENV GOARCH ${GOARCH} +EXPOSE 8080 +WORKDIR /app +COPY release/${TAG}/versioncontrol_linux_${GOARCH:-amd64} /app/versioncontrol +COPY cmd/versioncontrol/entrypoint /entrypoint +ENTRYPOINT ["/entrypoint"] diff --git a/cmd/versioncontrol/entrypoint b/cmd/versioncontrol/entrypoint new file mode 100755 index 000000000..71d46b020 --- /dev/null +++ b/cmd/versioncontrol/entrypoint @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ ! -f $HOME/.local/share/storj/versioncontrol/config.yaml ]; then + /app/versioncontrol setup +fi + +exec /app/versioncontrol run