How to prevent redeployment of a trawl?

I have travis configured to test using tox (Python 2.7 and 3.5) and deploy to pypi.

Travis tries to deploy the package for each test run, and pypi correctly rejects the second attempt.

I want travis to unfold once only when the current completes successfully. How is this achieved?

Travis configuration: https://github.com/biocommons/biocommons.seqrepo/blob/master/.travis.yml

And a test run: https://travis-ci.org/biocommons/biocommons.seqrepo/builds/157794212 (first finished 68.2 and clicked on pypi. The pypi error is at 68.1.)

A related but obsolete question: Why didn't Travis wait for all the assemblies to complete before deployment?

+4
source share
1 answer

This can now be accomplished using the build steps that are currently in beta. It looks something like this:

stages:  # determines the order everything runs in
- test
- deploy
jobs:  #  specifies the actual job
  include:
    - stage: test
      # configuration for a stage here
    - stage: deploy
      # configuration for the next stage here

Given a .travis.ymlas follows:

language: python
sudo: false
cache: pip
python:
- 2.7
- 3.4
- 3.5
- 3.6
- pypy
install:
- pip install tox-travis
script:
- tox
deploy:
  provider: pypi
  user: stephenfin
  password:
    secure: <key omitted for brevity>
  on:
    tags: true
  distributions: sdist bdist_wheel

You would convert it like this:

language: python
sudo: false
cache: pip
python:
- 2.7
- 3.4
- 3.5
- 3.6
- pypy
install:
- pip install tox-travis
script:
- tox
stages:
- test
- deploy
jobs:
  include:
    - stage: deploy
      python: 3.6
      install: skip  # no tests, no depedencies needed
      script: skip  # we're not running tests
      deploy:
        provider: pypi
        user: stephenfin
        password:
          secure: <key omitted for brevity>
        on:
          tags: true
        distributions: sdist bdist_wheel

: , , , stage. test python, install script. , , . test, . , Travis tox-travis ( 0.10), .

, Travis Gem, travis lint , . .

+1

Source: https://habr.com/ru/post/1653741/


All Articles