{"id":241,"date":"2016-06-28T16:23:11","date_gmt":"2016-06-28T08:23:11","guid":{"rendered":"https:\/\/vinta.ws\/code\/?p=241"},"modified":"2026-02-18T01:20:36","modified_gmt":"2026-02-17T17:20:36","slug":"upload-files-to-amazon-s3-when-travis-ci-builds-pass","status":"publish","type":"post","link":"https:\/\/vinta.ws\/code\/upload-files-to-amazon-s3-when-travis-ci-builds-pass.html","title":{"rendered":"Upload files to Amazon S3 when Travis CI builds pass"},"content":{"rendered":"<p>Assume that you want to upload a <code>xxx.whl<\/code> file generated by <code>pip wheel<\/code> to Amazon S3 so that you will be able to run <code>pip install https:\/\/url\/to\/s3\/bucket\/xxx.whl<\/code>.<\/p>\n<p>CAUTION! By default, only master branch's builds could trigger deployments in Travis CI.<\/p>\n<h2>Configuration<\/h2>\n<pre class=\"line-numbers\"><code class=\"language-yaml\">before_install:\n  - pip install -U pip\n  - pip install wheel\n\nscript:\n  - python setup.py test\n\nbefore_deploy:\n  - pip wheel --wheel-dir=wheelhouse .\n\ndeploy:\n  provider: s3\n  access_key_id: \"YOUR_KEY\"\n  secret_access_key: \"YOUR_SECRET\"\n  bucket: YOUR_BUCKET\n  acl: public_read\n  local_dir: wheelhouse\n  upload_dir: wheels\n  skip_cleanup: true<\/code><\/pre>\n<pre class=\"line-numbers\"><code class=\"language-bash\"># install from an URL directly\n$ pip install https:\/\/url\/to\/s3\/bucket\/wheels\/xxx.whl<\/code><\/pre>\n<p>ref:<br \/>\n<a href=\"https:\/\/docs.travis-ci.com\/user\/deployment\/s3\">https:\/\/docs.travis-ci.com\/user\/deployment\/s3<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CAUTION! By default, only master branch's builds could trigger deployments in Travis CI.<\/p>\n","protected":false},"author":1,"featured_media":762,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,4,116],"tags":[16,17,128,2],"class_list":["post-241","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-about-devops","category-about-python","category-about-web-development","tag-amazon-web-services","tag-aws-s3","tag-ci","tag-python"],"_links":{"self":[{"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/comments?post=241"}],"version-history":[{"count":0,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/media\/762"}],"wp:attachment":[{"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}