Switch to go modules ()

This commit is contained in:
Cyrill Troxler 2019-03-02 11:03:07 +01:00 committed by GitHub
parent 4995b00f57
commit 577f229ef7
8 changed files with 141 additions and 532 deletions

View file

@ -13,7 +13,7 @@
# limitations under the License.
.PHONY: test build container push clean
PROJECT_DIR=/go/src/github.com/ctrox/csi-s3
PROJECT_DIR=/app
REGISTRY_NAME=ctrox
IMAGE_NAME=csi-s3
IMAGE_VERSION=1.0.1-alpha
@ -21,11 +21,10 @@ IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):$(IMAGE_VERSION)
TEST_IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):test
build:
if [ ! -d ./vendor ]; then dep ensure -vendor-only; fi
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o _output/s3driver ./cmd/s3driver
test:
docker build -t $(TEST_IMAGE_TAG) -f test/Dockerfile .
docker run --rm --privileged -v $(PWD):$(PROJECT_DIR):ro --device /dev/fuse $(TEST_IMAGE_TAG)
docker run --rm --privileged -v $(PWD):$(PROJECT_DIR) --device /dev/fuse $(TEST_IMAGE_TAG)
container: build
docker build -t $(IMAGE_TAG) -f cmd/s3driver/Dockerfile .
push: container