瀏覽代碼

Merge pull request #2154 from dnephin/publish_master_builds

Publish master builds to bintray
mnowster 10 年之前
父節點
當前提交
4b845746ef

+ 1 - 0
.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

+ 29 - 0
.travis.yml

@@ -0,0 +1,29 @@
+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
+
+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

+ 10 - 2
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"

+ 7 - 0
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
 

+ 0 - 1
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 .
-

+ 1 - 1
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 \

+ 0 - 1
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

+ 0 - 1
script/build-windows.ps1

@@ -29,7 +29,6 @@
 #        .\script\build-windows.ps1
 
 $ErrorActionPreference = "Stop"
-Set-PSDebug -trace 1
 
 # Remove virtualenv
 if (Test-Path venv) {

+ 1 - 1
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

+ 29 - 0
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
+}

+ 13 - 0
script/travis/build-binary

@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -ex
+
+if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
+    script/build-linux
+    script/build-image master
+    # TODO: requires auth
+    # docker push docker/compose:master
+else
+    script/prepare-osx
+    script/build-osx
+fi

+ 10 - 0
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

+ 9 - 0
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

+ 9 - 0
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),