From 3d360e41bd5d5b79412c02166031b855299a206a Mon Sep 17 00:00:00 2001 From: oesteban Date: Tue, 30 Jul 2019 09:34:35 -0700 Subject: [PATCH] fix(circleCI): split deploy build into Docker and Pypi #801 --- .circleci/config.yml | 88 +++++++++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 18bf337a2..687568295 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -493,6 +524,9 @@ 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 @@ -500,39 +534,25 @@ jobs: 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 @@ -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 @@ -641,7 +654,7 @@ workflows: tags: ignore: /.*/ - - deploy: + - deploy_docker: requires: - build - test_pytest @@ -654,3 +667,12 @@ workflows: ignore: /.*/ tags: only: /.*/ + + - deploy_pypi: + requires: + - deploy_docker + filters: + branches: + ignore: /.*/ + tags: + only: /.*/ \ No newline at end of file