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 |