From 78d308f4cf04e8d00c9cd9378c0a5faf4ad4c995 Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Wed, 25 May 2016 12:57:28 -0700 Subject: [PATCH] chore(Makefile,mc): remove mc and integration tests --- Makefile | 24 +---------- mc/Dockerfile | 14 ------- mc/Makefile | 16 ------- mc/install.sh | 17 -------- mc/integration/Makefile | 12 ------ mc/integration/integration.sh | 78 ----------------------------------- 6 files changed, 2 insertions(+), 159 deletions(-) delete mode 100644 mc/Dockerfile delete mode 100644 mc/Makefile delete mode 100755 mc/install.sh delete mode 100644 mc/integration/Makefile delete mode 100755 mc/integration/integration.sh diff --git a/Makefile b/Makefile index ecb7e2e..6902cb9 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,6 @@ IMAGE_PREFIX ?= deis include versioning.mk -MC_IMAGE := ${DEIS_REGISTRY}${IMAGE_PREFIX}/mc:${VERSION} -MC_INTEGRATION_IMAGE := ${DEIS_REGISTRY}${IMAGE_PREFIX}/mc-integration:${VERSION} - TEST_PACKAGES := $(shell ${DEV_ENV_CMD} glide nv) all: build docker-build docker-push @@ -48,27 +45,10 @@ docker-build: build build-server docker tag -f ${IMAGE} ${MUTABLE_IMAGE} -deploy: build docker-build docker-push kube-rc +deploy: build docker-build docker-push # build the minio server build-server: docker run -e GO15VENDOREXPERIMENT=1 -e GOROOT=/usr/local/go --rm -v "${CURDIR}/server":/pwd -w /pwd golang:1.6 ./install.sh -mc-build: - make -C mc build - -mc-docker-build: - make -C mc docker-build - -mc-docker-push: - make -C mc docker-push - -# targets for the mc integration tests - -mc-integration-docker-build: - make -C mc/integration docker-build - -mc-integration-docker-push: - make -C mc/integration docker-push - -.PHONY: all build docker-compile kube-up kube-down deploy mc kube-mc +.PHONY: all bootstrap glideup build test docker-build deploy build-server diff --git a/mc/Dockerfile b/mc/Dockerfile deleted file mode 100644 index a08af7e..0000000 --- a/mc/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM alpine:3.3 - -RUN apk add -U ca-certificates && rm -rf /var/cache/apk/* - -ADD mc /bin/mc - -ENV WORKFLOW_RELEASE=2.0.0-dev -ADD ./integration/integration.sh /bin/integration.sh -RUN chmod +x /bin/integration.sh - -# this is so the minio client (https://github.com/minio/mc) works properly -ENV DOCKERIMAGE=1 - -CMD mc diff --git a/mc/Makefile b/mc/Makefile deleted file mode 100644 index 35ba199..0000000 --- a/mc/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -DEV_REGISTRY ?= $(docker-machine ip deis):5000 -DEIS_REGISTRY ?= ${DEV_REGISTRY} -IMAGE_PREFIX ?= deis -VERSION ?= git-$(shell git rev-parse --short HEAD) - -MC_IMAGE := ${DEIS_REGISTRY}${IMAGE_PREFIX}/mc:${VERSION} -MC_INTEGRATION_IMAGE := ${DEIS_REGISTRY}${IMAGE_PREFIX}/mc:${VERSION} - -build: - docker run -e CGO_ENABLED=0 -e GO15VENDOREXPERIMENT=1 -e GOROOT=/usr/local/go --rm -v ${CURDIR}:/pwd -w /pwd golang:1.5.2 ./install.sh - -docker-build: - docker build -t ${MC_IMAGE} ${CURDIR} - -docker-push: - docker push ${MC_IMAGE} diff --git a/mc/install.sh b/mc/install.sh deleted file mode 100755 index d7319e9..0000000 --- a/mc/install.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# This script builds the minio mc client (https://github.com/minio/mc) inside a Docker container. It should be run inside a golang:1.5.2 container, with the following environment variables set. -# -# - GOROOT=/usr/local/go -# - GO15VENDOREXPERIMENT=1 -# -# It also expects the current directory (mc/) to be mounted at /pwd, and for /pwd to be the current working directory -# -# See the 'mc' build target in the Makefile (in the parent directory) for an example of how to use this script. - -mkdir -p $GOPATH/src/github.com/minio -cd $GOPATH/src/github.com/minio -curl -L -O -s https://github.com/minio/mc/archive/master.tar.gz && tar -xvzf master.tar.gz && rm master.tar.gz && mv mc-master mc -cd mc -make install -cp $GOPATH/bin/mc /pwd/mc diff --git a/mc/integration/Makefile b/mc/integration/Makefile deleted file mode 100644 index f9138a4..0000000 --- a/mc/integration/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -DEV_REGISTRY ?= $(docker-machine ip deis):5000 -DEIS_REGISTRY ?= ${DEV_REGISTRY} -IMAGE_PREFIX ?= deis -VERSION ?= git-$(shell git rev-parse --short HEAD) - -IMAGE := ${DEIS_REGISTRY}${IMAGE_PREFIX}/mc-integration:${VERSION} - -docker-build: - docker build -t ${IMAGE} ${CURDIR}/.. - -docker-push: - docker push ${IMAGE} diff --git a/mc/integration/integration.sh b/mc/integration/integration.sh deleted file mode 100755 index 2ad9ea8..0000000 --- a/mc/integration/integration.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -# This script provides a simple integration test against the minio server (https://github.com/minio/minio). -# It uses the Minio 'mc' client (https://github.com/minio/mc) to do all its work. -# -# It's intended to be run inside a Docker container running an image built with the Dockerfile in this directory. -# The 'mc' target in the Makefile (in the parent directory) builds such an image. -# -# Finally, this script expects to run in a Kubernetes cluster with the following components installed: -# -# 1. The minio-user secret installed -# 3. A Minio replication controller or pod running -# 4. A Minio service running -# -# To install all of these components, run 'make docker-push kube-service kube-rc' from the parent directory. -# -# Then, when you're ready to run this test, run 'make build-mc docker-build-mc-integration docker-push-mc-integration kube-mc-integration' from the parent directory. -# -# TODO: probably rewrite this script in Go! - - -SECRET_PREFIX="/var/run/secrets/deis/minio/user" -ACCESS_KEY_FILE="$SECRET_PREFIX/accesskey" -ACCESS_SECRET_FILE="$SECRET_PREFIX/secretkey" - -if [ -z "$DEIS_MINIO_SERVICE_HOST" ]; then - echo "ERROR: no DEIS_MINIO_SERVICE_HOST env var " - exit 1 -elif [ -z "$DEIS_MINIO_SERVICE_PORT" ]; then - echo "ERROR: no DEIS_MINIO_SERVICE_PORT env var" - exit 1 -fi - -if ! [ -e $ACCESS_KEY_FILE ]; then - echo "ERROR: no access key file found at $ACCESS_KEY_FILE" - exit 1 -elif ! [ -e $ACCESS_SECRET_FILE ]; then - echo "ERROR: no access secret file found at $ACCESS_SECRET_FILE" - exit 1 -fi - -FULL_HOST="http://$DEIS_MINIO_SERVICE_HOST:$DEIS_MINIO_SERVICE_PORT" -BUCKET=mybucket -ACCESS_KEY=`cat $ACCESS_KEY_FILE` -ACCESS_SECRET=`cat $ACCESS_SECRET_FILE` -mc config host add $FULL_HOST $ACCESS_KEY $ACCESS_SECRET - -echo "mc mb $FULL_HOST/$BUCKET" -MB_OUT=$(mc mb $FULL_HOST/$BUCKET) -if [ $? -ne 0 ]; then - echo "FAIL: exit code $?" - exit 1 -elif [ -z "$MB_OUT" ]; then - echo "FAIL: no output" - exit 1 -fi -echo "$MB_OUT" - -echo "abc" > file.txt - -echo "mc cp file.txt $FULL_HOST/$BUCKET/file.txt" -CP_OUT=$(mc cp file.txt $FULL_HOST/$BUCKET/file.txt) -if [ $? -ne 0 ]; then - echo "FAIL: exit code $?" - exit 1 -elif [ -z "$CP_OUT" ]; then - echo "FAIL: no output" - exit 1 -fi - -FILE=$(mc cat $FULL_HOST/$BUCKET/file.txt) -if [ $? -ne 0 ]; then - echo "FAIL: exit code $?" - exit 1 -elif [ -z "$FILE" ]; - echo "FAIL: no output" - exit 1 -fi