授权标头在使用TravisCI部署到Amazon S3时格式错误

时间:2016-10-22 11:35:35

标签: amazon-web-services amazon-s3 deployment travis-ci

我正在构建一个简单的React应用程序并尝试将TravisCI实现到项目中。 https://github.com/olegnikitashin/spa_frontend

我阅读了部署S3的Travis指南,我的.travis.yml看起来像这样:

language: node_js
node_js:
  - '6.1'
install:
  - npm install
before_script:
  - webpack --config webpack.production.config.js
deploy:
  provider: s3
  skip_cleanup: true
  access_key_id:
    secure: $ACCESS_ID
  secret_access_key:
    secure: $ACCESS_SECRET
  bucket: $BUCKET
  local-dir: public
  acl: public_read
  region: us-east-1
  on:
    branch: task-eight
    repo: olegnikitashin/spa_frontend

我尝试了各种配置组合,但我在Travis中遇到了同样的问题:

    The authorization header is malformed; 
the authorization component "Credential=ne5S+rxU6NVbPsQtclNA1H/jGaTDqoeEetlTPle+7a9j26HlGuqkZggEuaQpikkjUY/oI03N9DH86EqLAb8SzLzXh6ygtl1YOImiX26hsbcDpE+gdR1ZKbgYc+OjyfBxE6rMqrUQyNR6LZpV4lztb/tMhCEr9NBF8rMaBZ5j67L03IAuXZWJhuF2IwsVN/R0vm4cCPDnIpeFBTCRAtx9NnGtkwVl+vjy9z7VCuqDnKF1cdMGZi3oHA9GzF6ZBPOk8jrXrPU/AYV+NSKP7XJGysRVMz2JhUhsaoAeZOSUhv6cL0ICNIJCbv7iDwR/cbx3BquJ2ox/T2T0dNisnacPgmtgVwseJO5CH0sYc2EBAYGabA+DpeJ4ktxQdpXgI9/zWEXrGKyFoHCdOXqwqxsmULTGJ6KuZVCWJKcWLmjieO4hkf5rcbGF8sI3zdEaHHNBXwG1QO8CBFNm/nuABIIJkewlPccGpfNUXsN8mFiwD5CzeVeYlVCdz4YU7aLB2s0oedbXr3U4z29tm0v+rcNgWFdusBjR5qm2seDv+T3Clp1Cs1adPAKXg57GbmvHvzGju8aJ8uVN8//ArpDAIZtIBfSM5g5RzFfde4QHymli+6kBO+ChI1+jMjoEpfcxiGGZHHIejeI6x+OdZ5HUd9ShPjHGuZQMwp2mEzDLF0H93p4=/20161020/us-east-1/s3/aws4_request" is malformed.
 (Aws::S3::Errors::AuthorizationHeaderMalformed)

这是链接: https://travis-ci.org/olegnikitashin/spa_frontend/builds/169222903

S3的存储分区政策:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Allow Public Access to All Objects",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::spabackendon/*"
        }
    ]
}

授予存储桶的所有权限。 当我使用AWS CLI手动部署时,一切正常!

aws s3 cp public/ s3://spabackendon/ --recursive --region=us-east-1

是否有人通过TravisCI部署此问题?

0 个答案:

没有答案