[嗨,我目前尝试通过travis CI将我的react应用程序部署到AWS Elastic Bean Stalk。但是它失败了..我应该在travis yml中更改哪些内容?
这是我的.travis.yml
sudo: required
services:
- docker
before_install:
- docker build -t sample:dev .
script:
- docker run -e CI=true sample:dev npm run test -- --coverage
deploy:
provider: elasticbeanstalk
region: "us-west-1"
app: "my-app"
env: "MyApp-env"
bucket_name: "xxxx"
bucket_path: "xxx"
on:
branch: master
access_key_id: $AWS_ACCESS_KEY
secret_access_key:
secure: "$AWS_SECRET_KEY"
但是我无法将其部署在aws弹性豆秆中。这是travis ci发出的消息:
命令“ docker run -e CI = true sample:dev npm run test---coverage”以0退出。dpl_01.27s $ rvm $(travis_internal_ruby)--fuzzy do ruby -S gem install dpldpl.1安装部署依赖项成功安装了jmespath-1.4.0成功安装了aws-eventstream-1.0.3成功安装了aws-sigv4-1.1.1提供更新的版本:请升级到适用于Ruby V3的AWS开发工具包成功安装aws-sdk-core-2.11.471提供更新的版本:请升级到适用于Ruby V3的AWS开发工具包成功安装aws-sdk-resources-2.11.471提供更新的版本:请升级到适用于Ruby V3的AWS开发工具包成功安装aws-sdk-2.11.471成功安装rubyzip-1.3.0成功安装dpl-elastic_beanstalk-1.10.15已安装8颗宝石!!! AWS Elastic Beanstalk支持是实验性的!dpl.2准备部署用git stash --all
清理git仓库。如果您需要构建构件来进行部署,请设置deploy.skip_cleanup: true
。参见https://docs.travis-ci.com/user/deployment#Uploading-Files-and-skip_cleanup。没有要保存的本地更改提供更新的版本:请升级到适用于Ruby V3的AWS开发工具包dpl.3部署应用找不到隐藏条目。/home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/seahorse/client/plugins/raise_response_errors.rb:15:incall': The request signature we calculated does not match the signature you provided. Check your key and signing method. (Aws::S3::Errors::SignatureDoesNotMatch)
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/s3_sse_cpk.rb:19:in
call'从/home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/s3_dualstack.rb:24:in call'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/s3_accelerate.rb:34:in
调用'从/home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in call'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/idempotency_token.rb:18:in
调用'从/home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/param_converter.rb:20:call'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/seahorse/client/plugins/response_target.rb:21:in
中调用'来自/home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/seahorse/client/request.rb:70:在send_request'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/seahorse/client/base.rb:207:in
块中(2个级别)在define_operation_methods'中来自/home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-resources-2.11.471/lib/aws-sdk-resources/request.rb:24:incall'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-resources-2.11.471/lib/aws-sdk-resources/operations.rb:41:in
call'从/home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-resources-2.11.471/lib/aws-sdk-resources/operation_methods.rb:19:inblock in add_operation'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-elastic_beanstalk-1.10.15/lib/dpl/provider/elastic_beanstalk.rb:131:in
upup'来自/home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-elastic_beanstalk-1.10.15/lib/dpl/provider/elastic_beanstalk.rb:49:inpush_app'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/provider.rb:199:in
block in deploy'来自/home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/cli.rb:41:在fold'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/provider.rb:199:in
deploy'来自/home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/cli.rb:32:inrun'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/cli.rb:7:in
run'来自/home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/bin/dpl:5:in<top (required)>'
from /home/travis/.rvm/gems/ruby-2.4.5/bin/dpl:23:in
load'来自/home/travis/.rvm/gems/ruby-2.4.5/bin/dpl:23:in`'部署失败
查看输出中的第一个错误:
call': The request signature we calculated does not match the signature you provided. Check your key and signing method. (Aws::S3::Errors::SignatureDoesNotMatch)
我遇到相同的错误,这是由于access_key_id
和secret_access_key
的不匹配引起的。我通过运行解决了它:
travis encrypt --add deploy.access_key_id <access_key_id>
travis encrypt --add deploy.secret_access_key <secret_access_key>