Skip to content

Commit

Permalink
Update shell tests: Add "image pull" examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanilves committed Oct 8, 2017
1 parent b819c91 commit 531324e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
# Built artifacts
/lstags
/dist/*

# Temporary "scratch" directory
/tmp/*
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,30 @@ package-test:
integration-test:
go test -integration -v

shell-test: build
env:
env

shell-test: build shell-test-alpine shell-test-wrong-image shell-test-pull-public shell-test-pull-private

shell-test-alpine:
./lstags alpine | egrep "\salpine:latest"

shell-test-wrong-image:
./lstags nobody/nothing &>/dev/null && exit 1 || true

shell-test-pull-public: DOCKERHUB_PUBLIC_REPO?=ivanilves/dummy
shell-test-pull-public:
./lstags --pull ${DOCKERHUB_PUBLIC_REPO}~/latest/

shell-test-pull-private: DOCKER_JSON:=tmp/docker.json.private-repo
shell-test-pull-private:
mkdir -p tmp
if [[ -n "${DOCKERHUB_PRIVATE_REPO}" && -n "${DOCKERHUB_AUTH}" ]]; then\
touch "${DOCKER_JSON}" && chmod 0600 "${DOCKER_JSON}" \
&& echo "{ \"auths\": { \"registry.hub.docker.com\": { \"auth\": \"${DOCKERHUB_AUTH}\" } } }" >"${DOCKER_JSON}"\
&& ./lstags -j "${DOCKER_JSON}" --pull ${DOCKERHUB_PRIVATE_REPO}~/latest/; else echo "DOCKERHUB_PRIVATE_REPO or DOCKERHUB_AUTH not set!";\
fi

lint: ERRORS:=$(shell find . -name "*.go" ! -path "./vendor/*" | xargs -i golint {})
lint: fail-on-errors

Expand Down

0 comments on commit 531324e

Please sign in to comment.