From ad96e10938d98cefbbbe1a17774802f36f8b8ad8 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 6 Oct 2015 16:32:59 -0400 Subject: [PATCH 1/4] Add travis.yml for building binaries. Signed-off-by: Daniel Nephin --- .travis.yml | 19 +++++++++++++++++++ script/build-osx | 1 - script/prepare-osx | 2 +- script/travis/build-binary | 11 +++++++++++ script/travis/ci | 10 ++++++++++ script/travis/install | 9 +++++++++ 6 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .travis.yml create mode 100755 script/travis/build-binary create mode 100755 script/travis/ci create mode 100755 script/travis/install diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..0f966f9da --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +sudo: required + +language: python + +services: + - docker + +matrix: + include: + - os: linux + - os: osx + language: generic + + +install: ./script/travis/install + +script: + - ./script/travis/ci + - ./script/travis/build-binary diff --git a/script/build-osx b/script/build-osx index 15a7bbc54..042964e4b 100755 --- a/script/build-osx +++ b/script/build-osx @@ -3,7 +3,6 @@ set -ex PATH="/usr/local/bin:$PATH" -./script/clean rm -rf venv virtualenv -p /usr/local/bin/python venv diff --git a/script/prepare-osx b/script/prepare-osx index ca2776b64..10bbbecc3 100755 --- a/script/prepare-osx +++ b/script/prepare-osx @@ -24,7 +24,7 @@ if !(which brew); then ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" fi -brew update +brew update > /dev/null if !(python_version | grep "$desired_python_version"); then if brew list | grep python; then diff --git a/script/travis/build-binary b/script/travis/build-binary new file mode 100755 index 000000000..b3b7b925b --- /dev/null +++ b/script/travis/build-binary @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + script/build-linux + # TODO: add script/build-image +else + script/prepare-osx + script/build-osx +fi diff --git a/script/travis/ci b/script/travis/ci new file mode 100755 index 000000000..4cce1bc84 --- /dev/null +++ b/script/travis/ci @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + tox -e py27,py34 -- tests/unit +else + # TODO: we could also install py34 and test against it + python -m tox -e py27 -- tests/unit +fi diff --git a/script/travis/install b/script/travis/install new file mode 100755 index 000000000..a23667bff --- /dev/null +++ b/script/travis/install @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + pip install tox==2.1.1 +else + pip install --user tox==2.1.1 +fi From 9ce18849254b29111bfe08bf844e35122b0854e4 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 6 Oct 2015 20:50:40 -0400 Subject: [PATCH 2/4] Add upload to bintray from travis. Signed-off-by: Daniel Nephin --- .pre-commit-config.yaml | 1 + .travis.yml | 10 +++++++++ script/build-image | 1 - script/build-linux | 2 +- script/travis/bintray.json.tmpl | 29 ++++++++++++++++++++++++++ script/travis/build-binary | 6 ++++-- script/travis/render-bintray-config.py | 9 ++++++++ 7 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 script/travis/bintray.json.tmpl create mode 100755 script/travis/render-bintray-config.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8913a05fd..3fad8ddcb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ - id: check-docstring-first - id: check-merge-conflict - id: check-yaml + - id: check-json - id: debug-statements - id: end-of-file-fixer - id: flake8 diff --git a/.travis.yml b/.travis.yml index 0f966f9da..3310e2ad9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,3 +17,13 @@ install: ./script/travis/install script: - ./script/travis/ci - ./script/travis/build-binary + +before_deploy: + - "./script/travis/render-bintray-config.py < ./script/travis/bintray.json.tmpl > ./bintray.json" + +deploy: + provider: bintray + user: docker-compose-roleuser + key: '$BINTRAY_API_KEY' + file: ./bintray.json + skip_cleanup: true diff --git a/script/build-image b/script/build-image index d9faddc7b..3ac9729b4 100755 --- a/script/build-image +++ b/script/build-image @@ -13,4 +13,3 @@ VERSION="$(python setup.py --version)" python setup.py sdist cp dist/docker-compose-$VERSION.tar.gz dist/docker-compose-release.tar.gz docker build -t docker/compose:$TAG -f Dockerfile.run . - diff --git a/script/build-linux b/script/build-linux index 4b8696216..ade18bc53 100755 --- a/script/build-linux +++ b/script/build-linux @@ -5,7 +5,7 @@ set -ex ./script/clean TAG="docker-compose" -docker build -t "$TAG" . +docker build -t "$TAG" . | tail -n 200 docker run \ --rm --entrypoint="script/build-linux-inner" \ -v $(pwd)/dist:/code/dist \ diff --git a/script/travis/bintray.json.tmpl b/script/travis/bintray.json.tmpl new file mode 100644 index 000000000..7d0adbebc --- /dev/null +++ b/script/travis/bintray.json.tmpl @@ -0,0 +1,29 @@ +{ + "package": { + "name": "${TRAVIS_OS_NAME}", + "repo": "master", + "subject": "docker-compose", + "desc": "Automated build of master branch from travis ci.", + "website_url": "https://github.com/docker/compose", + "issue_tracker_url": "https://github.com/docker/compose/issues", + "vcs_url": "https://github.com/docker/compose.git", + "licenses": ["Apache-2.0"] + }, + + "version": { + "name": "master", + "desc": "Automated build of the master branch.", + "released": "${DATE}", + "vcs_tag": "master" + }, + + "files": [ + { + "includePattern": "dist/(.*)", + "excludePattern": ".*\.tar.gz", + "uploadPattern": "$1", + "matrixParams": { "override": 1 } + } + ], + "publish": true +} diff --git a/script/travis/build-binary b/script/travis/build-binary index b3b7b925b..0becee7f6 100755 --- a/script/travis/build-binary +++ b/script/travis/build-binary @@ -1,10 +1,12 @@ #!/bin/bash -set -e +set -ex if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then script/build-linux - # TODO: add script/build-image + script/build-image master + # TODO: requires auth + # docker push docker/compose:master else script/prepare-osx script/build-osx diff --git a/script/travis/render-bintray-config.py b/script/travis/render-bintray-config.py new file mode 100755 index 000000000..6aa468d6d --- /dev/null +++ b/script/travis/render-bintray-config.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +import datetime +import os.path +import sys + +os.environ['DATE'] = str(datetime.date.today()) + +for line in sys.stdin: + print os.path.expandvars(line), From 0e9ec8aa74a57170251b0d0bc6e861218d2bbf67 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Wed, 7 Oct 2015 16:47:27 -0400 Subject: [PATCH 3/4] Add publish to bintray step to appveyor.yml Remove Set-PSDebug -trace to prevent the 9000+ lines of debug output from spamming the logs on appveyor. Signed-off-by: Daniel Nephin --- appveyor.yml | 12 ++++++++++-- script/build-windows.ps1 | 1 - 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index acf8bff34..b162db1e3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,12 +9,20 @@ install: # Build the binary after tests build: false +environment: + BINTRAY_USER: "docker-compose-roleuser" + BINTRAY_PATH: "docker-compose/master/windows/master/docker-compose-Windows-x86_64.exe" + test_script: - "tox -e py27,py34 -- tests/unit" - -after_test: - ps: ".\\script\\build-windows.ps1" +deploy_script: + - "curl -sS + -u \"%BINTRAY_USER%:%BINTRAY_API_KEY%\" + -X PUT \"https://api.bintray.com/content/%BINTRAY_PATH%?override=1&publish=1\" + --data-binary @dist\\docker-compose-Windows-x86_64.exe" + artifacts: - path: .\dist\docker-compose-Windows-x86_64.exe name: "Compose Windows binary" diff --git a/script/build-windows.ps1 b/script/build-windows.ps1 index f7fd15897..b35fad6f1 100644 --- a/script/build-windows.ps1 +++ b/script/build-windows.ps1 @@ -29,7 +29,6 @@ # .\script\build-windows.ps1 $ErrorActionPreference = "Stop" -Set-PSDebug -trace 1 # Remove virtualenv if (Test-Path venv) { From 6e838b5de17873957ede7068182b620b197d80e7 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 8 Oct 2015 10:50:15 -0400 Subject: [PATCH 4/4] Add link to master builds from install docs. Signed-off-by: Daniel Nephin --- docs/install.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/install.md b/docs/install.md index be6a6b26a..4e541b8c3 100644 --- a/docs/install.md +++ b/docs/install.md @@ -71,6 +71,13 @@ To install compose as a container run: $ curl -L https://github.com/docker/compose/releases/download/1.5.0/run.sh > /usr/local/bin/docker-compose $ chmod +x /usr/local/bin/docker-compose +## Master builds + +If you're interested in trying out a pre-release build you can download a +binary from https://dl.bintray.com/docker-compose/master/. Pre-release +builds allow you to try out new features before they are released, but may +be less stable. + ## Upgrading