Travis CI's caching archives all directories listed in the configuration and uploads them to Amazon S3. Cached contents are available to any build on the repository, including Pull Requests. For Python and Node.js projects, you could cache both
node_modules directories in every Travis CI build.
Here is an example of
- pip install -U pip
- pip install -r requirements.txt
- pip install coverage --ignore-installed
- npm install
- coverage run manage.py test
In the case of mine, after applying these changes, the installation time of
npm reduces from 180 seconds to 5 seconds.
One thing should be mentioned here: Since we didn't specify any
bin folder in the configuration (and I don't think that's necessary), any execution file that being installed by
pip such as
django-admin.py will not exist in subsequent builds. If you need those commands, you could just force install them by adding
pip install some_package --ignore-installed.
Assume that you want to upload a
xxx.whl file generated by
pip wheel to Amazon S3 so that you will be able to run
pip install https://url/to/s3/bucket/xxx.whl.
CAUTION! By default, only master branch's builds could trigger deployments in Travis CI.
- pip install -U pip
- pip install wheel
- python setup.py test
- pip wheel --wheel-dir=wheelhouse .
# install from an URL directly
$ pip install https://url/to/s3/bucket/wheels/xxx.whl
MkDocs is a static site generator that builds modern webpages based on your Markdown documents and a simple YAML file.
Here is the website which is generated by MkDocs in this post:
$ pip install mkdocs
site_name: Awesome Python
site_description: A curated list of awesome Python frameworks, libraries and software
site_author: Vinta Chen
- type: github
- type: twitter
- type: linkedin
- "Life is short, you need Python.": "index.md"
There are more themes:
pip install -r requirements.txt
ln -sf $(CURDIR)/README.md $(CURDIR)/docs/index.md
mkdocs gh-deploy --clean
Custom Domain for GitHub Pages
After deploying your GitHub Page, just pointing your domain to following IPs with DNS A records:
Automatic Deployment Via Travis CI
You need to
- cp README.md docs/index.md
- mkdocs build
# 多個 env 要寫在同一行
- DPS_ENV=test OTHER_ENV=whatever
- DPS_ENV=development OTHER_ENV=whatever
- sudo apt-get update -qq
- sudo apt-get install -qq libxml2-dev libxslt1-dev
- pip install -r requirements_test.txt --use-mirrors
- coverage run --source=haul setup.py test
- [email protected]
要注意的是多個 environment variables 要寫在同一行
如果是 public repo 的話，不需要特別設定什麼