Skip to content

Instantly share code, notes, and snippets.

@maximegaillard
Created January 21, 2014 16:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximegaillard/8543581 to your computer and use it in GitHub Desktop.
Save maximegaillard/8543581 to your computer and use it in GitHub Desktop.
Travis configuration to publish your Pelican site/blog to S3 from TravisCI
language: python
python:
- 2.7
virtualenv:
system_site_packages: true
env:
global:
- your_secure_BLOG_KEY_variable
- your_secure_BLOG_ACCESS_KEY_variable
install:
- pip install -r requirements.txt
before_script:
- source travis_before.sh
script:
- echo "Hello"
after_success:
- python travis_addS3ID.py
- cd www
- ../travis_deploy.sh
branches:
only:
- master
prod() {
export AWS_ACCESS_KEY_ID=$BLOG_KEY
export AWS_SECRET_ACCESS_KEY=$BLOG_ACCESS_KEY
}
if [[ $TRAVIS_PULL_REQUEST != 'false' ]]; then
echo "This is a pull request. No before script will be done."
elif [[ $TRAVIS_BRANCH == 'master' ]]; then
prod
else
echo "Nothing to do..."
fi
deployprod() {
make html
s3cmd sync output/ s3://bucket_name -c ../.s3cfg --acl-public --delete-removed
}
if [[ $TRAVIS_PULL_REQUEST != 'false' ]]; then
echo "This is a pull request. No deployment will be done."
elif [[ $TRAVIS_BRANCH == 'master' ]]; then
echo "Going to deploy on master..."
deployprod
else
echo "Nothing to do..."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment