Building and pushing to Packagr from TravisCI

If you use Gitlab and Travis-CI, you can easily integrate Packagr into your build process.

The Travis-CI config file

The travis.yml configuration file defines tasks that are executed when you push code to your linked Github repository. You can deploy to Packagr from Travis-CI using Travis-CI's native support for PyPI deployments

In order to do this, once you have linked your Travis-CI account to your Github repository, you can add the following to this config file:

language: python
python:
  - "3.6"
script:
  - python setup.py bdist_wheel
deploy:
  provider: pypi
  user: $PACKAGR_USERNAME
  password: $PACKAGR_PASSWORD
  server: $PACKAGR_REPOSITORY_URL

We've specified 3 environmentals above:

  • $PACKAGR_USERNAME
  • $PACKAGR_PASSWORD
  • $PACKAGR_REPOSITORY_URL

You'll need to define all three of these variables in the Travis-CI settings for your repository. For $PACKAGR_USERNAME, you should use your Packagr email address. You can retrieve your Packagr repository URL from the Packagr interface

There is a more detailed tutorial on how to setup a Github repository with Travis-CI and deploy to Packagr here