当前位置:  开发笔记 > 编程语言 > 正文

travis-ci中的Yeoman项目未能将dist目录部署到S3

如何解决《travis-ci中的Yeoman项目未能将dist目录部署到S3》经验,为你挑选了1个好方法。

我有一个yeoman项目(webapp生成器),以及下面的travis-ci配置:

language: node_js  
node_js:
- '4.1'
before_script:
- gem install compass
- npm install
- npm install bower
- bower install
- npm install grunt-cli
- grunt build
deploy:
  provider: s3
  access_key_id: AKIAIOVIOPLVOEVHJUQA
secret_access_key:
secure: HhLo08go5z+PBZkimdgLoTBBXQPzw0B1P2WHWmqtZ/H9RzGc7IUFE/6ubnewlyqy6Baa3mumcQ2A24lm98/ZZt8GZ+usI8dDF9maGVCFq2R53G1Rir+HleDVtkm/xGrxpvtLn/x+4QNselt2F6oODGNpmgGumaqMiabMm59ABw4CV3TULvWz1CKg/BC/YTVz58Equ0MhIZIk6igjc1PgOEiXfsKlBGVI5///MqjsuYB/6dtlrhzxPSpdGucnU0lmW+0TDzkX9WyEJPeDjTVLYNiviZmKIPw0fofc3BGCZs6QEibAFkJ40JF8CCzC3JdcV0vj7PFe5LEtWd+LGW+gew5HjVGcPkOtGwi8npTmHOlTZJRgrFySdJe6fy8N3we2Ht194GqPnJx8/D/F0p1fNq8/KujxQZX6L5BJNfO5a9iYgyD3q/cWBbxj2VIbYkrZAKK8LtnXrzXY+owmQYLiENB47atiwtJBg2ZoSsBw8ANR1RWSlyymdbwvoBxKUoZ324MO2l3yrAndheS1S4hauRs6bk52obcPUKMFkW+1/sDbxf15JcMhi48RN1jcDGSpHKqm7zHlfd2BfJC3U+tCRchD0gLYmgZBNhsL4sVyil4/0/lWALm10En1eDD8tvssCadnRRllbVIqIyx3UcKJC+JwymvtUatwHBW61ZzQyfA=
    bucket: www.raeprojects.org
    local-dir: dist
    acl: public_read
    on:
      repo: raeprojects/www-raeprojects-org

我正在尝试将dist目录(由grunt build任务创建)部署到S3.除了在部署阶段,travis ci无法找到dist目录并返回此错误消息:

Deploying application
Already up-to-date!
# HEAD detached at 114e66f
nothing to commit, working directory clean
Dropped refs/stash@{0} (7986ed431f2b3467e1369af81ef95256d352c571)
/home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-        1.8.11/lib/dpl/provider/s3.rb:47:in `chdir': No such file or directory - dist (Errno::ENOENT)
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.11/lib/dpl/provider/s3.rb:47:in `push_app'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.11/lib/dpl/provider.rb:145:in `block in deploy'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.11/lib/dpl/cli.rb:41:in `fold'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.11/lib/dpl/provider.rb:145:in `deploy'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.11/lib/dpl/provider/s3.rb:73:in `deploy'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.11/lib/dpl/cli.rb:32:in `run'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.11/lib/dpl/cli.rb:7:in `run'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.11/bin/dpl:5:in `'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:in `load'
    from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:in `
'

无法部署

我对gulp-webapp生成器生成的不同项目也有同样的问题.这是该项目的.travis.yml的spinet:

 . . . . . . 
 before_script:
 - npm install
 - npm install -g bower
 - bower install
 - gulp build
 . . . . . . . 

有人可以帮忙吗?



1> ambes..:

最后我想通了默认情况下travis-cidist/在运行后清理工作区(删除目录)npm test.我找到了一个选项来指示travis-ci no清理工作区.我加入 skip_cleanup: true.travis.yml并且工作正常.这是我编辑的.travis.yml文件:

deploy:
   . . . . . . .
  bucket: www.raeprojects.org
  local-dir: dist 
  skip_cleanup: true  // insures dist/ dir not to be deleted after npm test
  acl: public_read
  . . . . . 

推荐阅读
小妖694_807
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有