Skip to content
This repository was archived by the owner on Feb 3, 2019. It is now read-only.

Latest commit

 

History

History
97 lines (62 loc) · 3.47 KB

File metadata and controls

97 lines (62 loc) · 3.47 KB

This is a reminder on how to grant travis the rights to deploy your site on github pages, python package to pypi and release files to github

PREREQUISITE

Get access to a linux machine

The following does not work on windows as explained here

Install travis commandline

You have to be outside of the proxy for everything to work correctly, otherwise you will get strange errors mentioning ipaddr... either here or later in the process.

Install ruby using RVM : (DO NOT USE su OR sudo)

> \curl -sSL https://get.rvm.io | bash -s stable --ruby
> source /home/ubuntu/.rvm/scripts/rvm
> rvm install ruby (this installs to /home/ubuntu/.rvm/src/ruby...)

Then install travis commandline:

> gem install travis

source:

Optional: setup a shared folder between your development machine and the linux machine

If possible the shared folder should be the git folder, so that travis automatically detects the git project.

Generating the access keys for travis

To deploy a site on gh-pages using mkdocs gh-deploy (or for any git push operation)

Generate an asymetric security key (public + private):

  • On windows: open git bash (not windows cmd)
  • Execute the following but DO NOT provide any passphrase when prompted (simply press )
ssh-keygen -t rsa -b 4096 -C "<your_github_email_address>" -f ci_tools/github_travis_rsa

On the github repository page, Settings > Deploy Keys > Add deploy key > add the PUBLIC generated key (the file ci_tools/github_travis_rsa.pub)

Use travis CLI to encrypt your PRIVATE key:

> cd to the shared folder (/media/...)
> source /home/ubuntu/.rvm/scripts/rvm
> travis login
> travis encrypt-file -r <git-username>/<repo-name> ci_tools/github_travis_rsa   (DO NOT USE --add option since it will remove all comments in your travis.yml file!)

Follow the instructions on screen :

  • copy the line starting with openssl ... to your travis.yml file.
  • modify the relative path to the generated file by adding 'ci_tools/' in front of 'github_travis_rsa_...enc'.
  • git add the generated file 'github_travis_rsa_...enc' but DO NOT ADD the private key

source:

To deploy python wheels on PyPi

Similar procedure to encrypt the PyPi password for deployments:

> (cd, source, travis login)
> travis encrypt -r <git-username>/<repo-name> <pypi_password>

Copy the resulting string in the travis.yml file under deploy > provider: pypi > password > secure

source: https://docs.travis-ci.com/user/deployment/pypi/

To deploy file releases on github

Similar procedure to encrypt the OAuth password for github releases. WARNING unlike 'travis encrypt', this WILL modify your travis.yml file. Therefore you should make a backup of it beforehand, and then execute this command with the '--force' option.

> (cd, source, travis login)
> travis login
> travis setup releases

Copy the string in the travis.yml file under deploy > provider: releases > api-key > secure

source: https://docs.travis-ci.com/user/deployment/releases/