-1

How can I deploy my webapp created with Yeoman generator-webapp to OpenShift?

The generator-angular-fullstack has a great option for deploying to OpenShift.

Unfortunately the generator-webapp doesn't have an option like this, and all the examples given by OpenShift indicates that I need to git clone from the Openshift repository to my localhost.

SteveC
  • 15,808
  • 23
  • 102
  • 173
Hojendiz
  • 40
  • 6

1 Answers1

0

I've found a way to doing it.

Reading the yeoman's documentation, I've found this help about deploying witch mention the use of git-contrib-subtree (I ran with difficulties installing it, because the make install has problems with my git path).

Then when I first try to push the subtree /dist, it throw me the error:

error: failed to push some refs to '<file>'    
hint: Updates were rejected because the remote contains work that you do    
hint: not have locally. This is usually caused by another repository pushing    
hint: to the same ref. You may want to first merge the remote changes (e.g.,    
hint: 'git pull') before pushing again.    

I tried to force --force but git subtree does't recognize this option, the work around is to perform a nested git

git push origin `git subtree split --prefix dist  master`:master --force

Once I've forced push, I can run without errors:

git subtree push --prefix dist origin master

Because my project also incorporates nodeJS I've had to copy the server.js that came with the OpenShift original code, to my app folder and use it as a template for my node project (be careful with the line self.app = express.createServer(); it's deprecated). Also I've modified the Gruntfile.js to incorporate the server.js and start node

Community
  • 1
  • 1
Hojendiz
  • 40
  • 6