node.js - Travis + Openshift 未部署到 openshift

标签 node.js continuous-integration openshift travis-ci

我们在部署到 openshift 时遇到问题。部署过程会运行,但实际上不会将任何新代码部署到我们的设备中。

这是我的 travis 文件:

language: node_js

node_js:
  - '0.10'

before_script:
  - npm install -g bower grunt-cli
  - gem install sass
  - bower install

services: mongodb

before_deploy:
  - rm -rf .sass-cache .tmp client e2e node_modules server styleguide *.*
  - mv dist/* ./
  - rm -rf dist
  - ls

notifications:
  slack: REMOVED

deploy:
  - provider: heroku
    api_key: REMOVED
    skip_cleanup: true
    buildpack: https://github.com/ddollar/heroku-buildpack-multi.git
    app:
      qa: snd-onair-webclient-qa
      production: snd-onair-webclient-production
  - provider: openshift
    user: rbrookfield@352inc.com
    password:
      secure: REMOVED
    skip_cleanup: true
    clean_up: false
    domain: onairtest
    app:
      staging: snd

branches:
  only:
    - dev
    - staging
    - qa
    - production

这是我的 travis 部署的尾部:

authenticated as rbrookfield@352inc.com
found app snd
Generating public/private rsa key pair.
Your identification has been saved in .dpl/id_rsa.
Your public key has been saved in .dpl/id_rsa.pub.
The key fingerprint is:
1d:0f:07:49:08:90:f3:1a:2f:b7:c3:9a:c4:19:bd:c7 testing-worker-linux-4554f670-1-8413-linux-2-14078509
The key's randomart image is:
+--[ RSA 2048]----+
|    .o.. oo.     |
|    o   . ..     |
|     o    o .    |
|    ...  . =     |
|    .+. S . .    |
|   .oooo         |
|    ++..E        |
|   . .+.         |
|    o. .         |
+-----------------+
dpl.3
Deploying application
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
  git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
  git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
Warning: Permanently added 'snd-onairtest.rhcloud.com' (RSA) to the list of known hosts.
Everything up-to-date
Done. Your build exited with 0.

我还在我的 openshift gears 上设置了一个 ssh key ,因为这是一个私有(private)存储库,我可以从实例访问它。我不确定这里发生了什么。

最佳答案

似乎是一个常见问题。您需要在 travis.yml 文件中进行提交,以便反射(reflect)更新。这是我的代码中我在测试后进行提交的部分:

after_success:
- git config --global user.email "travis@localhost.localdomain"
- git config --global user.name "Travis CI"
- git add --all
- git commit -am "Travis change"

还值得注意的是,用户可以通过执行如下操作来执行构建操作并仅部署工件:

after_success:
- grunt build
- cd dist
- git init
- git config --global user.email "travis@localhost.localdomain"
- git config --global user.name "Travis CI"
- git add --all
- git commit -am "Travis change"

关于node.js - Travis + Openshift 未部署到 openshift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28706304/

相关文章:

node.js - CALL_NON_FUNCTION_AS_CONSTRUCTOR( native )

node.js - 如何使用 Nodejs 在 Express-validator 中验证 multipart/form-data

github - 为 GitHub 拉取请求触发 Visual Studio Team Services 构建

TFS2015 构建在所有命令行命令上失败, 'file not found'

postgresql - OpenShift 容器如何学习其镜像 ID?

javascript - 在 Openshift 上部署 sails.js

javascript - 安装 Node.js

javascript - 如何点击具有特定宽度的元素 puppeteer

多模块项目上的 Maven 站点无法解决依赖关系

docker - 如何在Docker容器中设置openshift文档?