Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

Commit

Permalink
add docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ahelal committed Jun 7, 2017
1 parent a43e68e commit 2ea0984
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.6

ENV CIBULLY_VERSION 0.0.1-rc.3
ENV CIBULLY_CHECKSUM c2e299cf781b6e79648f9f54b24441b3aba4897a6ed0295b38f3c6ca488bd101

ADD https://github.com/ahelal/ci-bully/releases/download/v${CIBULLY_VERSION}/ci-bully_${CIBULLY_VERSION}_linux_amd64 /usr/bin/cibully
RUN set -ex \
&& echo "${CIBULLY_CHECKSUM} /usr/bin/cibully" | sha256sum -c \
&& chmod +x /usr/bin/cibully \
&& mkdir /config \
&& apk add --update-cache --no-cache ca-certificates \
&& rm -rf /var/cache/apk/*
VOLUME /config
WORKDIR /config

CMD [ "/bin/sh", "-c", "echo You need to run dockers with cibuly ARGS" ]
47 changes: 47 additions & 0 deletions Makefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
MAKEFLAGS += --warn-undefined-variables
.DEFAULT_GOAL := build
PHONY: all build test push push_latest clean clean_all

M = $(shell printf "\033[34;1m▶\033[0m")

NAME := "quay.io/ahelal/cibully"
VERSION := $(shell cat .VERSION)
BUILD_ARGS := --build-arg VERSION=${VERSION}


docker: dbuild dpush dpush_latest

dbuild:
$(info $(M) Building ${NAME}:${VERSION}…)
@#docker build ${BUILD_ARGS} --no-cache=True -t ${NAME}:${VERSION} -f Dockerfile .
docker build ${BUILD_ARGS} -t ${NAME}:${VERSION} -f Dockerfile .

dtests:
@if ! docker images $(NAME) | awk '{print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME) version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@docker tag $(NAME):$(VERSION) $(NAME):dev
@./test/run_tests.sh tests

dtests-debug:
@if ! docker images $(NAME) | awk '{print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME) version $(VERSION) is not yet built. Please run 'make build'"; false; fi
@docker tag $(NAME):$(VERSION) $(NAME):dev
@./test/run_tests.sh tests-debug

dpush:
@echo ${VERSION}
@if ! docker images $(NAME) | awk '{print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME) version $(VERSION) is not yet built. Please run 'make build'"; false; fi
$(info $(M) Pushing ${NAME}:${VERSION}…)
@docker push "${NAME}:${VERSION}"

dpush_latest:
$(info $(M) Linking latest and pushing ${NAME}:${VERSION}…)
docker tag $(NAME):$(VERSION) $(NAME):latest
docker push "${NAME}:latest"

dclean:
@if docker images $(NAME) | awk '{print $$2 }' | grep -q -F $(VERSION); then echo "*** Cleaning ${NAME}:${VERSION} ***"; docker rmi "${NAME}:${VERSION}"; else echo "*** No image ${NAME}:${VERSION} ***"; fi


dclean_all: clean
$(info $(M) Cleaning all…)
@#@if docker images $(NAME) | awk '{print $$2 }'; then echo "*** Cleaning ${NAME} ***"; docker rmi "${NAME}"; fi
docker system prune -f

0 comments on commit 2ea0984

Please sign in to comment.