Created
January 21, 2014 16:49
-
-
Save maximegaillard/8543581 to your computer and use it in GitHub Desktop.
Travis configuration to publish your Pelican site/blog to S3 from TravisCI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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