Easy way to duplicate openshift application? - openshift

Is there an easy way to duplicate an openshift application? This would not only copy the code, but also the environment variables and other settings?
I have one now that works well for testing, and I want to have another copy of it for production.

There are a couple of very easy ways to copy an OpenShift application.
Backup & Restore (https://developers.openshift.com/en/managing-backing-up-applications.html)
Clone an existing application (https://access.redhat.com/documentation/en-US/OpenShift_Online/2.0/html/User_Guide/Cloning_an_Existing_Application.html)
Both sets of rhc commands should give you the desired copy of the application running on your account.

Related

How to migrate a Project from 'OpenShift Web Console' to '(Next Gen) Web Console'?

Is there a way to migrate a server application (with its repository), to the new Next Gen Console?
I have already a WildFly server in my personal account at URL: https://openshift.redhat.com/app/console/applications
But when I open the Next Gen Console, it's empty, and suggest me to create new project with a new server.
https://console.preview.openshift.com/console/
Is there a way to avoid setting up everything again?
I would like to keep server configurations, git repository, and Jenkins app from my former OpenShift Web Console.
Sorry, there is no direct migration tool. The manner in which the systems works is quite different from an operational standpoint, but you are also potentially going to have to tweak how your application code is organised and configured. I would suggest you create a fresh application in the new version to learn more how they are different and then you can plan what you may need to do to migrate it. I would suggest making using of the Google Group for OpenShift if you have more questions as it provides a better forum for discussion.
https://groups.google.com/forum/#!forum/openshift

How to test openshift action_hooks prior to git push to Openshift server

I have been looking at Openshift docs and on Stack Overflow for a while now and I can't seem to get any answers.
I want to know what the standard pattern is for developing applications for deployment on Openshift? I am especially concerned with testing of action_hooks prior to deployment. I found this particularly troublesome when I was using a DIY cartridge recently where I had to deal with downloading dependencies in my build script prior to starting my application. As my application kept failing to start every time I made a change and pushed it (I only did this as an initial test of the Openshift service, I would never develop like this). I ended up having to ssh onto my instance and resolve the issue by trial and error (not really ideal).
I appreciate any help anyone can offer.
Thanks
The only way that I am aware of to test action hooks on OpenShift is to ssh into an application and run them manually from the command line. This way you can quickly debug & update them. Then copy them to your git repository and do a git push to deploy the new code.
The only other way I can think of would be to run OpenShift Origin (v2) locally and use that to test with.

Is it possible to use OpenShift without using rhc?

I am trying to get an application running on OpenShift but after trying to create an ssh key on Ubuntu using ssh-keygen I ran into permissions problems. This is because I find I have no need for the rhc client if it only automates this process but bloats my computer (laptop) with a ruby installation.
I find that it would be best to have an alternative for Ubuntu (Linux) users. Is it possible to make this happen or do I have to go the rhc way?
You get a long way without the rhc command line tool. Obviously you can create your ssh key yourself and add/mange it via the OpenShift website. You can also create your application there and add cartridges. When it comes to starting the app, you can usually do that by jsut pushing your git repository. Last but not least, you can ssh onto your OpenShift gear and do a lot from there, for example view the log files.
That said, the rhc client is your one stop client for all this (and more). So even if you might not need it right now and some task are in fact done easier without it, I would still recommend to install it. A lot of information/tutorials are using rhc and w/o enough experience you will not know how to achieve a certain task in a different way.

Sincronize databases with git deployment

So I own a VPS server running CentOS, and decided to use git for deployment. Man! That's fun. Push, done!
I'm really happier than i was with the old ftp approach.
But I wish I could go further, today it deploys automagically all my files, but it doesn't even touch my db. And if I change it in the mods, I have to update it manually. So i was thinking about using some git hooks to do this also automatically.
By now I'm using one git hook at the server, it's a post-receive hook and basically copies files to the production directory when pushed to master.
The prerequisites for the DB deployment are:
It needs to go both ways, if i pull from db, and it's different from my local it should update my local db.
It should be based on modifications and patchs and not the dump of the whole db, this way i can work with the team without compromising other guys work.
I was thinking about keeping a db.sql on the version control, and make a script to analyze it on post-receive (on server) and post-merge(on local), so it can take the mods and apply, and i would keep a database of which mods were applied already (the script should run in both, client and server).
Any of you guys have already done something similar to this? What would you recommend?
Thank you very much already,

Development environment Sinatra & MySQL in 2 computers

I'm developing a Sinatra and MySQL application. I'm using as development environment a Macbook Air and an iMac. The server runs on a FreeBSD VPS running unicorn behind nginx.
I'd like to somehow automate the whole procedure, I develop in both iMac and MBA. Depends on time I have free in the office (MBA) or time I spend writing code at home (iMac). I have setup MySQL on both macs.
I manually dump and restore the database in order to be able to test my application locally before making any change to the server.
I'd like to automate the process of: Syncing the MySQL database if possible, keep the code up-to-date to all locations without using cloud storage if possible.
Best Regards,
I think there are many ways to solve this problem.
So this is just on idea how to achieve this.
Create a git repo on your server and write a small shell script which sync your db from somewhere. This script can you trigger by a git hook http://git-scm.com/book/en/Customizing-Git-Git-Hooks#Client-Side-Hooks
For your syncing script you may have a look at this -> https://github.com/xssnark/mysql-db-sync or I'm sure you find something.