Skip to content

Commit

Permalink
Merge pull request #71 from /issues/63/refactor
Browse files Browse the repository at this point in the history
First refactor of L/S tags
  • Loading branch information
ivanilves authored Oct 9, 2017
2 parents 7b48253 + 531324e commit 372b19e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
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
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[![Build Status](https://travis-ci.org/ivanilves/lstags.svg?branch=master)](https://travis-ci.org/ivanilves/lstags)

# lstags
# L/S tags

* *Compare local Docker images with ones present in registry.*
* *Sync your local Docker images with ones from the registry.*
* *Get insights on changes in watched Docker registries, easily.*
* *Facilitate maintenance of your own local "proxy" registries.*

Expand Down Expand Up @@ -47,6 +48,12 @@ My CI server is connected over crappy Internet link and pulling images in advanc

There is also special `UNKNOWN` state, which means `lstags` failed to detect image state for some reason.

## Authentication
You can either:
* rely on `lstags` discovering credentials "automagically" :tophat:
* load credentials from any Docker JSON config file specified
* pass username and password explicitly, via the command line

## Install: Binaries
https://github.com/ivanilves/lstags/releases

Expand Down

0 comments on commit 372b19e

Please sign in to comment.