Skip to content

Commit

Permalink
ci: split to build stages
Browse files Browse the repository at this point in the history
(closes #433)
  • Loading branch information
jirikuncar committed Mar 1, 2019
1 parent dab7ec3 commit 5db425d
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 65 deletions.
140 changes: 76 additions & 64 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
notifications:
email: false

sudo: required

services:
- docker

git:
depth: false

Expand All @@ -37,37 +32,24 @@ cache:

env:
- REQUIREMENTS=lowest
- REQUIREMENTS=release DEPLOY=true
# - REQUIREMENTS=devel
- REQUIREMENTS=release

python:
# - "2.7"
- "3.5"
- "3.6"

matrix:
include:
- language: generic
os: osx
osx_image: xcode10.1
- language: generic
os: osx
osx_image: xcode9.2
- python: "3.7"
os: linux
dist: xenial
sudo: true
language: python
env:
- REQUIREMENTS=release
stages:
- name: test
- name: publish 🐍 🐳
if: type = push AND (branch = master OR tag IS present)
- name: brew 🍺
if: type = push AND tag IS present

before_install:
- git fetch --tags
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -;
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable";
sudo apt-get update;
sudo apt-get -y install docker-ce shellcheck;
sudo apt-get -y install shellcheck;
travis_retry python -m pip install --upgrade pip setuptools py;
travis_retry python -m pip install twine wheel coveralls requirements-builder;
requirements-builder -e all --level=min setup.py > .travis-lowest-requirements.txt;
Expand Down Expand Up @@ -100,42 +82,72 @@ script:
after_success:
- coveralls

before_deploy:
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
make brew-commit-formula brew-build-bottle brew-commit-bottle;
fi
jobs:
include:
- stage: test
language: generic
sudo: true
os: osx
osx_image: xcode10.1
- language: generic
sudo: true
os: osx
osx_image: xcode9.2
- python: "3.7"
os: linux
dist: xenial
language: python
env:
- REQUIREMENTS=release

deploy:
- &pypi
provider: pypi
user: jirikuncar
password:
secure: "YOHhWCF25Od6HJGhtKtL6/qX/pcIx/0kqGvz3lyTgxWYAkKYk0maQovHgkGukNCPu9FKcWNuKXmNvOsXIW5fm5Aav+yJqkQSQEXpVxmKYmgNWiAtgnDYUomtAQ9uRJnfxV32QFggJ2/d7lThWE7a8/LmEK9z+Nvhr1Y32RUu0ZAmp3FgJJERUONBJyL+G20jLlM/VWVD/XFeC3zQohiNxDFaMpHHb+H23VWjFVwjfqgpj4FSZ1GvtHBgISQFic06EaUv7F20tF/BtS4J7PhH8OwRCy2jLY/LF02lchrfZKomQ7ZkcK5U1DHxHI8SBdTOkIgt1OafvHstWIt8UJZeB43O7iT+W157b8B5K8sKtAhflfY2NqIhBw4LcktsYDH9ZXApgbCuIU6LioFsXKUD8fR+3or2/AB2SRfsiRLejq4ZX/zGo9a9pbXrD4ZAvaJJreHK+HZHcJdn4/2sEU5JrMqUauBB4tvvBINshgjb/7N6AghjV7B7wcWooZZcuGaoSBl3QgUufAAxAwNDoI3N0904ZIzTxfKkd7CEyx5rEhA+HPdc5HzWwvSGNr1xOnH0zgANM7RskS7g3Ab+2EdzvhdskHpE0wxRcR5upcuTMcYBrauA4rZwjD4aefgtFLZM8aE/Se5OQOymFQBBy2+fTrkSJt/T5J1tJBDoIWvcam8="
distributions: "sdist bdist_wheel"
on: &pypi_on
branch: master
python: "3.6"
repo: SwissDataScienceCenter/renku-python
condition: $DEPLOY = true
- <<: *pypi
on:
<<: *pypi_on
tags: true
- provider: script
skip_cleanup: true
script: make docker-login docker-push
on:
all_branches: true
python: "3.6"
repo: SwissDataScienceCenter/renku-python
condition: $DEPLOY = true
- provider: releases
api_key:
secure: eJUA1+x21xPnOLlOt2pyPjFgI3lLus1OOVt0Jot+Hnle8UiOYg4wphDAA8abSalN+8vvNLB1+Z/ODFWZJWs4hGMG+0wEpCmWU6x125ijciF/6WH0bN7yNm1xW9+6ve+/zX+IRuUt00Or19/lg9wv835Ce3x91H/c9byVtTtmUVZ5jjRDeB5GmJaBo+kajfZMZu7WDUGxGSyhvQIqivbnjkjjaBKFuzXU8zdLfJoZE9N8T75E0Ug/qfwmgYCB4XIu/7i1ub/zc9GSOFnV0xEYZb8SF4f+Y9RSj2V4/+Ym6K+L4/nhFj81PKOSn850sfyHSklA31KJ07Fe4k9y/EIwmt5sRuLO9Kr9n4ByTkRVgIXOrbn/8Eym3QzkJsuEmdDpvJV5Lea2zhSzITJYoYtrCqCwjEqDKVP/QxfegbUX+AG+eBmPktClLq3S+PQAQRul2kzsP584gQEg2rb8LhHttUocZEa5F67wnVpNPGBC9V0hVW/2vWnBSboS6zk96g/2G0FMKZRsavxCHWuCVes6nRrQr2L+Py+I3ppv1/sf31Jc2sPGemsFXfKSPVxq8kf8H+cpJn2YJ+fUxPkTFLQr9h/FU88NyhWteSXQhugfTRHwG7Trkcnsh1vijJHqzq6nFVLOCrC0BqHW89R4o0AdOQLuog8PVIYjot9ndwR2zMk=
file_glob: true
file: "*.bottle.*"
skip_cleanup: true
on:
tags: true
repo: SwissDataScienceCenter/renku-python
condition: $TRAVIS_OS_NAME = 'osx'
- stage: publish 🐍 🐳
python: 3.6
script: echo "Publishing on PyPI.io ..."
deploy:
- provider: pypi
user: jirikuncar
password:
secure: "YOHhWCF25Od6HJGhtKtL6/qX/pcIx/0kqGvz3lyTgxWYAkKYk0maQovHgkGukNCPu9FKcWNuKXmNvOsXIW5fm5Aav+yJqkQSQEXpVxmKYmgNWiAtgnDYUomtAQ9uRJnfxV32QFggJ2/d7lThWE7a8/LmEK9z+Nvhr1Y32RUu0ZAmp3FgJJERUONBJyL+G20jLlM/VWVD/XFeC3zQohiNxDFaMpHHb+H23VWjFVwjfqgpj4FSZ1GvtHBgISQFic06EaUv7F20tF/BtS4J7PhH8OwRCy2jLY/LF02lchrfZKomQ7ZkcK5U1DHxHI8SBdTOkIgt1OafvHstWIt8UJZeB43O7iT+W157b8B5K8sKtAhflfY2NqIhBw4LcktsYDH9ZXApgbCuIU6LioFsXKUD8fR+3or2/AB2SRfsiRLejq4ZX/zGo9a9pbXrD4ZAvaJJreHK+HZHcJdn4/2sEU5JrMqUauBB4tvvBINshgjb/7N6AghjV7B7wcWooZZcuGaoSBl3QgUufAAxAwNDoI3N0904ZIzTxfKkd7CEyx5rEhA+HPdc5HzWwvSGNr1xOnH0zgANM7RskS7g3Ab+2EdzvhdskHpE0wxRcR5upcuTMcYBrauA4rZwjD4aefgtFLZM8aE/Se5OQOymFQBBy2+fTrkSJt/T5J1tJBDoIWvcam8="
distributions: "sdist bdist_wheel"
on:
all_branches: true
- # stage: publish
sudo: required
services:
- docker
install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y install docker-ce
script: make docker-login docker-push

- stage: brew 🍺
language: generic
sudo: true
os: osx
osx_image: xcode10.2
before_install: brew install jq
install: python -m pip install requests
script:
- echo PY_BREW_VERSION=$(python setup.py --version)
- make -e PY_BREW_VERSION=$(python setup.py --version) brew-commit-formula brew-build-bottle brew-commit-bottle
deploy:
- provider: releases
api_key:
secure: eJUA1+x21xPnOLlOt2pyPjFgI3lLus1OOVt0Jot+Hnle8UiOYg4wphDAA8abSalN+8vvNLB1+Z/ODFWZJWs4hGMG+0wEpCmWU6x125ijciF/6WH0bN7yNm1xW9+6ve+/zX+IRuUt00Or19/lg9wv835Ce3x91H/c9byVtTtmUVZ5jjRDeB5GmJaBo+kajfZMZu7WDUGxGSyhvQIqivbnjkjjaBKFuzXU8zdLfJoZE9N8T75E0Ug/qfwmgYCB4XIu/7i1ub/zc9GSOFnV0xEYZb8SF4f+Y9RSj2V4/+Ym6K+L4/nhFj81PKOSn850sfyHSklA31KJ07Fe4k9y/EIwmt5sRuLO9Kr9n4ByTkRVgIXOrbn/8Eym3QzkJsuEmdDpvJV5Lea2zhSzITJYoYtrCqCwjEqDKVP/QxfegbUX+AG+eBmPktClLq3S+PQAQRul2kzsP584gQEg2rb8LhHttUocZEa5F67wnVpNPGBC9V0hVW/2vWnBSboS6zk96g/2G0FMKZRsavxCHWuCVes6nRrQr2L+Py+I3ppv1/sf31Jc2sPGemsFXfKSPVxq8kf8H+cpJn2YJ+fUxPkTFLQr9h/FU88NyhWteSXQhugfTRHwG7Trkcnsh1vijJHqzq6nFVLOCrC0BqHW89R4o0AdOQLuog8PVIYjot9ndwR2zMk=
file_glob: true
file: "*.bottle.*"
skip_cleanup: true
on:
all_branches: true
- provider: pages
skip-cleanup: true
# Set in the settings page of your repository, as a secure variable
github-token: $GITHUB_TOKEN
repo: swissdatasciencecenter/homebrew-renku
target-branch: master
keep-history: true
local-dir: /usr/local/Homebrew/Library/Taps/swissdatasciencecenter/homebrew-renku/
on:
all_branches: true
5 changes: 4 additions & 1 deletion brew.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ def find_release(package, releases, dependencies=None):
sys.exit(1)

description = response.json()
version = os.environ.get('PY_BREW_VERSION', get_distribution(NAME).version)
version = os.environ.get('PY_BREW_VERSION')
if version is None:
version = get_distribution(NAME).version

release = find_release(NAME, description['releases'][version])

with open('Pipfile.lock') as f:
Expand Down

0 comments on commit 5db425d

Please sign in to comment.