diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..11239e25f --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,62 @@ +version: 2 +jobs: + test: + macos: + xcode: "8.3.3" + steps: + - checkout +# - run: +# name: install python3 +# command: brew install python3 + - run: + name: install tox + command: sudo pip install --upgrade tox==2.1.1 + - run: + name: unit tests + command: tox -e py27 -- tests/unit + + build-osx-binary: + macos: + xcode: "8.3.3" + steps: + - checkout + - run: + name: upgrade python tools + command: sudo pip install --upgrade pip virtualenv + - run: + name: setup script + command: ./script/setup/osx + - run: + name: build script + command: ./script/build/osx + - store_artifacts: + path: dist/docker-compose-Darwin-x86_64 + destination: docker-compose-Darwin-x86_64 + - deploy: + name: Deploy binary to bintray + command: | + OS_NAME=Darwin PKG_NAME=osx ./script/circle/bintray-deploy.sh + + + build-linux-binary: + machine: + enabled: true + steps: + - checkout + - run: + name: build Linux binary + command: ./script/build/linux + - store_artifacts: + path: dist/docker-compose-Linux-x86_64 + destination: docker-compose-Linux-x86_64 + - deploy: + name: Deploy binary to bintray + command: | + OS_NAME=Linux PKG_NAME=linux ./script/circle/bintray-deploy.sh +workflows: + version: 2 + all: + jobs: + - test + - build-linux-binary + - build-osx-binary diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8fef7ed1b..000000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -sudo: required - -language: python - -matrix: - include: - - os: linux - services: - - docker - - os: osx - osx_image: xcode7.3 - 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 - on: - all_branches: true diff --git a/script/circle/bintray-deploy.sh b/script/circle/bintray-deploy.sh new file mode 100755 index 000000000..d508da365 --- /dev/null +++ b/script/circle/bintray-deploy.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +curl -f -u$BINTRAY_USERNAME:$BINTRAY_API_KEY -X GET \ + https://api.bintray.com/repos/docker-compose/${CIRCLE_BRANCH} + +if test $? -ne 0; then + echo "Bintray repository ${CIRCLE_BRANCH} does not exist ; abandoning upload attempt" + exit 0 +fi + +curl -u$BINTRAY_USERNAME:$BINTRAY_API_KEY -X POST \ + -d "{\ + \"name\": \"${PKG_NAME}\", \"desc\": \"auto\", \"licenses\": [\"Apache-2.0\"], \ + \"vcs_url\": \"${CIRCLE_REPOSITORY_URL}\" \ + }" -H "Content-Type: application/json" \ + https://api.bintray.com/packages/docker-compose/${CIRCLE_BRANCH} + +curl -u$BINTRAY_USERNAME:$BINTRAY_API_KEY -X POST -d "{\ + \"name\": \"$CIRCLE_BRANCH\", \ + \"desc\": \"Automated build of the ${CIRCLE_BRANCH} branch.\", \ + }" -H "Content-Type: application/json" \ + https://api.bintray.com/packages/docker-compose/${CIRCLE_BRANCH}/${PKG_NAME}/versions + +curl -f -T dist/docker-compose-${OS_NAME}-x86_64 -u$BINTRAY_USERNAME:$BINTRAY_API_KEY \ + -H "X-Bintray-Package: ${PKG_NAME}" -H "X-Bintray-Version: $CIRCLE_BRANCH" \ + -H "X-Bintray-Override: 1" -H "X-Bintray-Publish: 1" -X PUT \ + https://api.bintray.com/content/docker-compose/${CIRCLE_BRANCH}/docker-compose-${OS_NAME}-x86_64 || exit 1 diff --git a/script/setup/osx b/script/setup/osx index e0c2bd0a2..407524cba 100755 --- a/script/setup/osx +++ b/script/setup/osx @@ -10,40 +10,6 @@ openssl_version() { python -c "import ssl; print ssl.OPENSSL_VERSION" } -desired_python_version="2.7.12" -desired_python_brew_version="2.7.12" -python_formula="https://raw.githubusercontent.com/Homebrew/homebrew-core/737a2e34a89b213c1f0a2a24fc1a3c06635eed04/Formula/python.rb" - -desired_openssl_version="1.0.2j" -desired_openssl_brew_version="1.0.2j" -openssl_formula="https://raw.githubusercontent.com/Homebrew/homebrew-core/30d3766453347f6e22b3ed6c74bb926d6def2eb5/Formula/openssl.rb" - -PATH="/usr/local/bin:$PATH" - -if !(which brew); then - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -fi - -brew update > /dev/null - -if !(python_version | grep "$desired_python_version"); then - if brew list | grep python; then - brew unlink python - fi - - brew install "$python_formula" - brew switch python "$desired_python_brew_version" -fi - -if !(openssl_version | grep "$desired_openssl_version"); then - if brew list | grep openssl; then - brew unlink openssl - fi - - brew install "$openssl_formula" - brew switch openssl "$desired_openssl_brew_version" -fi - echo "*** Using $(python_version)" echo "*** Using $(openssl_version)" diff --git a/script/travis/bintray.json.tmpl b/script/travis/bintray.json.tmpl deleted file mode 100644 index f9728558a..000000000 --- a/script/travis/bintray.json.tmpl +++ /dev/null @@ -1,29 +0,0 @@ -{ - "package": { - "name": "${TRAVIS_OS_NAME}", - "repo": "${TRAVIS_BRANCH}", - "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": "${TRAVIS_BRANCH}", - "desc": "Automated build of the ${TRAVIS_BRANCH} 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 deleted file mode 100755 index 7707a1eee..000000000 --- a/script/travis/build-binary +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -ex - -if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - script/build/linux - # TODO: requires auth to push, so disable for now - # script/build/image master - # docker push docker/compose:master -else - script/setup/osx - script/build/osx -fi diff --git a/script/travis/ci b/script/travis/ci deleted file mode 100755 index cd4fcc6d1..000000000 --- a/script/travis/ci +++ /dev/null @@ -1,10 +0,0 @@ -#!/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 - tox -e py27 -- tests/unit -fi diff --git a/script/travis/install b/script/travis/install deleted file mode 100755 index d4b34786c..000000000 --- a/script/travis/install +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -ex - -if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - pip install tox==2.1.1 -else - sudo pip install --upgrade pip tox==2.1.1 virtualenv - pip --version -fi diff --git a/script/travis/render-bintray-config.py b/script/travis/render-bintray-config.py deleted file mode 100755 index b5364a0b6..000000000 --- a/script/travis/render-bintray-config.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - -import datetime -import os.path -import sys - -os.environ['DATE'] = str(datetime.date.today()) - -for line in sys.stdin: - print(os.path.expandvars(line), end='')