您好,我目前尝试通过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发出的消息:
以0退出命令“ docker run -e CI = true sample:dev npm run test---coverage”。
dpl_0
1.27s $ rvm $(travis_internal_ruby)--fuzzy do ruby -S gem install dpl
dpl.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:在call': 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
通话中
来自/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 {{1} }呼叫'
来自/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 {{1} }呼叫'
来自/home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/param_converter.rb:20:in {{1} }呼叫'
来自/home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/seahorse/client/request.rb:70: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
中的(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: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-resources-2.11.471/lib/aws-sdk-resources/operation_methods.rb:19:in 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/dpl-elastic_beanstalk-1.10.15/lib/dpl/provider/elastic_beanstalk.rb:49:in 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
在部署中阻止”
来自/home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/cli.rb:41:在call'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-resources-2.11.471/lib/aws-sdk-resources/operations.rb:41:in
部署中
来自/home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/cli.rb:32:in block 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
run'
从/home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/bin/dpl:5:在push_app'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/provider.rb:199:in
中加载
来自/home/travis/.rvm/gems/ruby-2.4.5/bin/dpl:23:in`'
部署失败
答案 0 :(得分:1)
基于Travis CI的新版本,下面几行代码,您需要更新
secret_access_key:
secure: "$AWS_SECRET_KEY"
将其更改为:
secret_access_key: "$AWS_SECRET_KEY"
还需要在部署下添加“ skip_cleanup:true”:
因为Travis CI现在认为默认变量是安全的。
答案 1 :(得分:0)
查看输出中的第一个错误:
size
我遇到了相同的错误,这是由于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>