Я создаю Makefile
для установки boto3
и загружаю файл с локального компьютера с MacOS в Travis CI.
Это то, что я написал в Makefile:
language: python
python:
- "3.5"
- "3.6"
clean:
rm -fr ./public
install:
- pip install boto3
- upload_file.py
travis-ci: install
.PHONY: all \
clean \
Это мой upload_file.py
файл:
import os.path
import boto3
s3 = boto3.resource('s3')
s3.meta.client.upload_file('Key', 'bucket name', 'Key')
и мой .travis.yml
файл:
sudo: required
dist: trusty
language: python
script:
- make travis-ci
deploy:
- provider: s3
on:
branch: master
region: us-west-2
local_dir: public
bucket: bucketname
skip_cleanup: true
acl: public_read
access_key_id: xxxx
secret_access_key:
secure: xxxx
Когда я запускаю git push
, я получаю эту ошибку:
File "./upload_file.py", line 3, in <module>
import boto3
ImportError: No module named 'boto3'
make: [install] Error 1 (ignored)The command "make travis-ci" exited with 0.
Deploying application
/home/travis/.rvm/gems/ruby-2.2.6/gems/dpl-s3-1.10.0/lib/dpl/provider/s3.rb:56:in `chdir': No such file or directory @ dir_chdir - public (Errno::ENOENT)
from /home/travis/.rvm/gems/ruby-2.2.6/gems/dpl-s3-1.10.0/lib/dpl/provider/s3.rb:56:in `push_app'
from /home/travis/.rvm/gems/ruby-2.2.6/gems/dpl-1.10.0/lib/dpl/provider.rb:196:in `block in deploy'
from /home/travis/.rvm/gems/ruby-2.2.6/gems/dpl-1.10.0/lib/dpl/cli.rb:41:in `fold'
from /home/travis/.rvm/gems/ruby-2.2.6/gems/dpl-1.10.0/lib/dpl/provider.rb:196:in `deploy'
from /home/travis/.rvm/gems/ruby-2.2.6/gems/dpl-s3-1.10.0/lib/dpl/provider/s3.rb:109:in `deploy'
from /home/travis/.rvm/gems/ruby-2.2.6/gems/dpl-1.10.0/lib/dpl/cli.rb:32:in `run'
from /home/travis/.rvm/gems/ruby-2.2.6/gems/dpl-1.10.0/lib/dpl/cli.rb:7:in `run'
from /home/travis/.rvm/gems/ruby-2.2.6/gems/dpl-1.10.0/bin/dpl:5:in `<top (required)>'
from /home/travis/.rvm/gems/ruby-2.2.6/bin/dpl:23:in `load'
from /home/travis/.rvm/gems/ruby-2.2.6/bin/dpl:23:in `<main>'
failed to deploy