Skip to content

Commit

Permalink
Merge pull request #1202 from aanand/jenkins-script
Browse files Browse the repository at this point in the history
WIP: Jenkins script
  • Loading branch information
aanand committed Mar 27, 2015
2 parents 9d7b54d + db852e1 commit 853ce25
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ RUN set -ex; \
curl https://test.docker.com/builds/Linux/x86_64/docker-1.6.0-rc2 -o /usr/local/bin/docker-1.6.0-rc2; \
chmod +x /usr/local/bin/docker-1.6.0-rc2

# Set the default Docker to be run
RUN ln -s /usr/local/bin/docker-1.3.3 /usr/local/bin/docker

RUN useradd -d /home/user -m -s /bin/bash user
WORKDIR /code/

Expand Down
18 changes: 11 additions & 7 deletions script/build-linux
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/bin/sh
#!/bin/bash

set -ex
mkdir -p `pwd`/dist
chmod 777 `pwd`/dist
docker build -t docker-compose .
docker run -u user -v `pwd`/dist:/code/dist --rm --entrypoint pyinstaller docker-compose -F bin/docker-compose
mv dist/docker-compose dist/docker-compose-Linux-x86_64
docker run -u user -v `pwd`/dist:/code/dist --rm --entrypoint dist/docker-compose-Linux-x86_64 docker-compose --version

TAG="docker-compose"
docker build -t "$TAG" .
docker run \
--rm \
--user=user \
--volume="$(pwd):/code" \
--entrypoint="script/build-linux-inner" \
"$TAG"
10 changes: 10 additions & 0 deletions script/build-linux-inner
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -ex

mkdir -p `pwd`/dist
chmod 777 `pwd`/dist

pyinstaller -F bin/docker-compose
mv dist/docker-compose dist/docker-compose-Linux-x86_64
dist/docker-compose-Linux-x86_64 --version
18 changes: 18 additions & 0 deletions script/ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# This should be run inside a container built from the Dockerfile
# at the root of the repo:
#
# $ TAG="docker-compose:$(git rev-parse --short HEAD)"
# $ docker build -t "$TAG" .
# $ docker run --rm --volume="/var/run/docker.sock:/var/run/docker.sock" --volume="$(pwd)/.git:/code/.git" -e "TAG=$TAG" --entrypoint="script/ci" "$TAG"

set -e

>&2 echo "Validating DCO"
script/validate-dco

export DOCKER_VERSIONS=all
. script/test-versions

>&2 echo "Building Linux binary"
su -c script/build-linux-inner user
5 changes: 1 addition & 4 deletions script/test-versions
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

set -e

>&2 echo "Validating DCO"
script/validate-dco

>&2 echo "Running lint checks"
flake8 compose tests setup.py

Expand All @@ -18,7 +15,7 @@ fi

for version in $DOCKER_VERSIONS; do
>&2 echo "Running tests against Docker $version"
docker-1.5.0 run \
docker run \
--rm \
--privileged \
--volume="/var/lib/docker" \
Expand Down
2 changes: 1 addition & 1 deletion script/wrapdocker
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [ "$DOCKER_VERSION" == "" ]; then
DOCKER_VERSION="1.5.0"
fi

ln -s "/usr/local/bin/docker-$DOCKER_VERSION" "/usr/local/bin/docker"
ln -fs "/usr/local/bin/docker-$DOCKER_VERSION" "/usr/local/bin/docker"

# If a pidfile is still around (for example after a container restart),
# delete it so that docker can start.
Expand Down

0 comments on commit 853ce25

Please sign in to comment.