Skip to content

Commit

Permalink
Merge branch 'norelease/ninja-fix-docker-1'
Browse files Browse the repository at this point in the history
* norelease/ninja-fix-docker-1:
  NORELEASE Ninja-fix Docker build #1
  • Loading branch information
ivanilves committed Jan 19, 2018
2 parents 4418911 + b4859ca commit 7b195bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@
# log & pid files
/*.log
/*.pid

# docker.json [with credentials]
/docker.json
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ language: go
go: 1.8.3

before_install:
- sudo cp -v ci_docker_daemon.json /etc/docker/daemon.json
- sudo ln -nfs /bin/bash /bin/sh
- make prepare

install:
- make dep

before_script:
- sudo cp -v ci_docker_daemon.json /etc/docker/daemon.json
- sudo killall -v dockerd && sudo rm -f /var/run/docker.pid && sudo dockerd 2>&1 | logger -t dockerd &
- docker login -u ${DOCKERHUB_USERNAME} -p ${DOCKERHUB_PASSWORD}
- cp ~/.docker/config.json docker.json
- git remote set-url --push origin https://${GITHUB_TOKEN}@github.com/ivanilves/lstags.git

script:
Expand Down
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: default offline prepare dep test unit-test whitebox-integration-test blackbox-integration-test \
start-local-registry stop-local-registry shell-test-alpine shell-test-wrong-image shell-test-pull-public shell-test-pull-private shell-test-push-local-alpine shell-test-push-local-assumed-tags \
shell-test-docker-socket shell-test-docker-tcp lint vet fail-on-errors docker-image docker-json build xbuild clean changelog release validate-release deploy wrapper install
shell-test-docker-socket shell-test-docker-tcp lint vet fail-on-errors docker-image build xbuild clean changelog release validate-release deploy wrapper install

default: prepare dep test lint vet build

Expand Down Expand Up @@ -57,12 +57,12 @@ 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: docker-json
if [[ -n "${DOCKERHUB_PRIVATE_REPO}" && -n "${DOCKERHUB_AUTH}" ]]; then\
shell-test-pull-private: DOCKER_JSON:=docker.json
shell-test-pull-private:
if [[ -n "${DOCKERHUB_PRIVATE_REPO}" ]]; then\
./lstags -j "${DOCKER_JSON}" --pull ${DOCKERHUB_PRIVATE_REPO}~/latest/; \
else \
echo "DOCKERHUB_PRIVATE_REPO or DOCKERHUB_AUTH not set!"; \
echo "Will not pull from DockerHub private repo: DOCKERHUB_PRIVATE_REPO not set!"; \
fi

shell-test-push-local-alpine: REGISTRY_PORT:=5757
Expand Down Expand Up @@ -113,10 +113,6 @@ docker-image-wait:
@scripts/async-wait.sh docker-image ${TIMEOUT}
@docker image ls ${DOCKER_REPO}:${DOCKER_TAG} | grep -v "^REPOSITORY" | grep .

docker-json:
test -n "${DOCKER_JSON}" && mkdir -p `dirname "${DOCKER_JSON}"` && touch "${DOCKER_JSON}" && chmod 0600 "${DOCKER_JSON}" \
&& echo "{ \"auths\": { \"registry.hub.docker.com\": { \"auth\": \"${DOCKERHUB_AUTH}\" } } }" >${DOCKER_JSON}

build: NAME=$(shell test "${GOOS}" = "windows" && echo 'lstags.exe' || echo 'lstags')
build:
@if [[ -z "${GOOS}" ]]; then go build -ldflags '-d -s -w' -a -tags netgo -installsuffix netgo; fi
Expand Down

0 comments on commit 7b195bc

Please sign in to comment.