Skip to content

Commit

Permalink
fix(circleCI): split deploy build into Docker and Pypi #801
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban committed Jul 30, 2019
1 parent 8e2d9b7 commit 3d360e4
Showing 1 changed file with 55 additions and 33 deletions.
88 changes: 55 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,37 @@ jobs:
- store_artifacts:
path: /tmp/bold/test

update_changes:
machine:
image: circleci/classic:201711-01
working_directory: /tmp/src/mriqc
steps:
- attach_workspace:
at: /tmp

- checkout:
path: /tmp/src/mriqc

- add_ssh_keys:
fingerprints:
- "39:23:4c:9c:3e:29:c1:44:45:f2:bb:e5:cb:b7:65:c2"

- run:
name: Checkout origin/master
command: |
git config user.email "${GITHUB_EMAIL}"
git config user.name "CircleCI Deploy"
git fetch origin
git checkout -f origin/master
- run:
name: Update CHANGES if this is a merge commit
command: |
if (( $( git cat-file -p HEAD | sed -n '/^parent [0-9a-f]*$/p' | wc -l ) > 1 )); then
bash update_changes.sh
git add CHANGES.txt
git commit -m "auto: Update CHANGES [skip ci]"
git push origin HEAD:master
fi
test_package:
machine:
Expand All @@ -493,46 +524,35 @@ jobs:
- run:
name: Validate version
command: |
if [[ "${CIRCLE_TAG}" != "" ]]; then
echo "${CIRCLE_TAG}" > mriqc/VERSION
fi
THISVERSION=$( python3 -c "from versioneer import get_version; print(get_version())" )
python3 -m pip install dist/*.tar.gz
mkdir empty
cd empty
INSTALLED=$( python3 -c 'import mriqc; print(mriqc.__version__)' )
test "${CIRCLE_TAG:-$THISVERSION}" == "$INSTALLED"
update_changes:
deploy_pypi:
machine:
image: circleci/classic:201711-01
working_directory: /tmp/src/mriqc
steps:
- attach_workspace:
at: /tmp

- checkout:
path: /tmp/src/mriqc

- add_ssh_keys:
fingerprints:
- "39:23:4c:9c:3e:29:c1:44:45:f2:bb:e5:cb:b7:65:c2"

- checkout
- run: pyenv local 3.5.2
- run:
name: Checkout origin/master
command: |
git config user.email "${GITHUB_EMAIL}"
git config user.name "CircleCI Deploy"
git fetch origin
git checkout -f origin/master
name: Install build depends
command: python3 -m pip install "setuptools>=30.3.0" "pip>=10.0.1" twine docutils
- run:
name: Update CHANGES if this is a merge commit
name: Deploy to PyPi
command: |
if (( $( git cat-file -p HEAD | sed -n '/^parent [0-9a-f]*$/p' | wc -l ) > 1 )); then
bash update_changes.sh
git add CHANGES.txt
git commit -m "auto: Update CHANGES [skip ci]"
git push origin HEAD:master
fi
echo "${CIRCLE_TAG}" > mriqc/VERSION
python3 setup.py sdist
python3 -m twine check dist/*
python3 -m twine upload dist/*
deploy:
deploy_docker:
machine:
image: circleci/classic:201711-01
working_directory: /tmp/src/mriqc
Expand Down Expand Up @@ -560,13 +580,6 @@ jobs:
docker tag poldracklab/mriqc poldracklab/mriqc:$CIRCLE_TAG
docker push poldracklab/mriqc:$CIRCLE_TAG
fi
- run:
name: Deploy to PyPi
command: |
python3 -m pip install "setuptools>=30.3.0" "pip>=10.0.1" twine docutils
echo "${CIRCLE_TAG}" > mriqc/VERSION
python setup.py sdist
twine upload dist/*
workflows:
version: 2
Expand Down Expand Up @@ -641,7 +654,7 @@ workflows:
tags:
ignore: /.*/

- deploy:
- deploy_docker:
requires:
- build
- test_pytest
Expand All @@ -654,3 +667,12 @@ workflows:
ignore: /.*/
tags:
only: /.*/

- deploy_pypi:
requires:
- deploy_docker
filters:
branches:
ignore: /.*/
tags:
only: /.*/

0 comments on commit 3d360e4

Please sign in to comment.