Skip to content

CI: Move PyPI deployment to Circle #2587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ _build_main_image_py36: &build_main_image_py36
--tag nipype/nipype:py36 \
--build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
--build-arg VCS_REF="$(git rev-parse --short HEAD)" \
--build-arg VERSION="${CIRCLE_TAG}" /home/circleci/nipype \
--build-arg VERSION="${CIRCLE_TAG}" /home/circleci/nipype

_build_main_image_py27: &build_main_image_py27
name: Build main image (py27)
Expand All @@ -68,7 +68,7 @@ _build_main_image_py27: &build_main_image_py27
--build-arg PYTHON_VERSION_MINOR=7 \
--build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
--build-arg VCS_REF="$(git rev-parse --short HEAD)" \
--build-arg VERSION="${CIRCLE_TAG}-py27" /home/circleci/nipype \
--build-arg VERSION="${CIRCLE_TAG}-py27" /home/circleci/nipype

_download_test_data: &_download_test_data
name: Download test data
Expand Down Expand Up @@ -299,7 +299,7 @@ jobs:
- run: *_run_codecov_smoke
- store_artifacts: *store_artifacts_kwds

deploy:
deploy_dockerhub:
docker:
- image: docker:17.10.0-ce-git
steps:
Expand Down Expand Up @@ -330,6 +330,18 @@ jobs:
- /tmp/docker/cache/Dockerfile.base-pruned
key: dockerfile-cache-v1-{{ .Branch }}-{{ checksum "/tmp/docker/cache/Dockerfile.base-pruned" }}

deploy_pypi:
machine: *machine_kwds
working_directory: /home/circleci/nipype
steps:
- checkout:
path: /home/circleci/nipype
- run:
name: Deploy to PyPI
command: |
pip install twine future wheel
python setup.py sdist bdist_wheel
twine upload dist/*

workflows:
version: 2
Expand All @@ -348,7 +360,7 @@ workflows:
- test_fmri_spm_nested_fsl_feeds:
requires:
- compare_base_dockerfiles
- deploy:
- deploy_dockerhub:
filters:
branches:
only: master
Expand All @@ -357,3 +369,14 @@ workflows:
- test_fmri_spm_nested_fsl_feeds
- test_py3_fmri_fsl_spm
- test_py3_fmri_spm_dartel_multiproc
- deploy_pypi:
filters:
branches:
ignore: /.*/
tags:
only: /.*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for tags - should we only do master?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the goal you're trying to achieve? I assume not to push a package every time master is updated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think i may be misunderstanding how circle bit works - i thought the tags section should look only for tags applied to the master branch, since tags could potentially be applied on any branch. i'll read up on my train ride in a bit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So by default Circle will build on all branches and no tags. In order to restrict it from some branches, you can match with ignore and only, so here I'm saying don't run this on any branches. And then to run on all tags (regardless of branch) we use only: /.*/.

Which is to say, this job will be run iff we have a tag.

requires:
- test_pytest
- test_fmri_spm_nested_fsl_feeds
- test_py3_fmri_fsl_spm
- test_py3_fmri_spm_dartel_multiproc
11 changes: 0 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,5 @@ install:
script:
- py.test -v --cov nipype --cov-config .coveragerc --cov-report xml:cov.xml -c nipype/pytest.ini --doctest-modules nipype

deploy:
provider: pypi
user: satra
password:
secure: OCO0FXb4f+pH4Uw7zWCIRp3qOJ1t7rhky4K8MjNU8tyVCJgd6O/Bv8GJgceS0LktPodlAAjB8SxAhTORPAQZ1D/44PJYy3NQIisvej1zjLpaA9TEGfl6W7MqhDpRyMHW+cnSi/n84SAmdr+Z4vOxScDHdwr13EPmGyOIlHMAGnE=
on:
tags: true
repo: nipy/nipype
branch: master
distributions: "sdist bdist_wheel"

after_script:
- codecov --file cov.xml --flags unittests -e TRAVIS_JOB_NUMBER