add circleci

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
This commit is contained in:
Jessica Frazelle 2015-10-22 02:13:39 -07:00
parent e53d64c7af
commit cb791cab29
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3
6 changed files with 61 additions and 2 deletions

View File

@ -1,8 +1,10 @@
## dockerfiles
[![Circle CI](https://circleci.com/gh/jfrazelle/dockerfiles.svg?style=svg)](https://circleci.com/gh/jfrazelle/dockerfiles)
This is a repo to hold various Dockerfiles for images I create.
I try to make sure each has a command at the top for running it,
I try to make sure each has a command at the top for running it,
if a file you are looking at does not have a command, please
pull request it!

7
circle.yml Normal file
View File

@ -0,0 +1,7 @@
machine:
services:
- docker
test:
override:
- ./test.sh

View File

@ -5,6 +5,7 @@
# -p 5050:5050 \
# -v /etc/localtime:/etc/localtime:ro \
# -v /volumes/couchpotato:/data \
# --link transmission:transmission \
# --name couchpotato \
# jess/couchpotato
#

View File

@ -5,6 +5,7 @@
# -p 8081:8081 \
# -v /etc/localtime:/etc/localtime:ro \
# -v /volumes/sickbeard:/data \
# --link transmission:transmission \
# --name sickbeard \
# jess/sickbeard
#

48
test.sh Executable file
View File

@ -0,0 +1,48 @@
#!/bin/bash
set -e
# this is kind of an expensive check, so let's not do this twice if we
# are running more than one validate bundlescript
VALIDATE_REPO='https://github.com/jfrazelle/dockerfiles.git'
VALIDATE_BRANCH='master'
VALIDATE_HEAD="$(git rev-parse --verify HEAD)"
git fetch -q "$VALIDATE_REPO" "refs/heads/$VALIDATE_BRANCH"
VALIDATE_UPSTREAM="$(git rev-parse --verify FETCH_HEAD)"
VALIDATE_COMMIT_DIFF="$VALIDATE_UPSTREAM...$VALIDATE_HEAD"
validate_diff() {
if [ "$VALIDATE_UPSTREAM" != "$VALIDATE_HEAD" ]; then
git diff "$VALIDATE_COMMIT_DIFF" "$@"
else
git diff HEAD~ "$@"
fi
}
# get the dockerfiles changed
IFS=$'\n'
files=( $(validate_diff --name-only -- '*Dockerfile') )
unset IFS
# build the changed dockerfiles
for f in "${files[@]}"; do
image=${f%Dockerfile}
base=${image%%\/*}
suite=${image##*\/}
build_dir=$(dirname $f)
if [[ -z "$suite" ]]; then
suite=latest
fi
(
set -x
docker build -t ${base}:${suite} ${build_dir}
)
echo " --- "
echo "Successfully built ${base}:${suite} with context ${build_dir}"
echo " --- "
done

View File

@ -3,7 +3,7 @@
# docker run -v /tmp/.X11-unix:/tmp/.X11-unix \
# -v /dev/snd:/dev/snd \
# -e DISPLAY=unix$DISPLAY \
# jess/tor-browser
# jess/tor-browser:alpha
#
FROM debian:jessie
MAINTAINER Jessica Frazelle <jess@docker.com>