瀏覽代碼

Add upload to bintray from travis.

Signed-off-by: Daniel Nephin <[email protected]>
Daniel Nephin 10 年之前
父節點
當前提交
9ce1884925

+ 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

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

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

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

+ 4 - 2
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

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