eclipse/Git in openshift v3 - openshift

I have been using eclipse (with openshift plugin) for my Openshift v2 project. Now, I have to migrate.
In Openshift v2, I run local git repositories. Each repository branch has a correpsonding remote (I assume in Openshift V2). I can push/pull etc between local and remote branches. I rarely use rhc nor did I use git command line on my local machine.
In Openshift v3, it seems that I cannot interact with remote Git repositories in Openshift from Eclipse: everything goes through https://github.com. After going through several "migration guidelines", I suspect this will be how to use Eclipse with Openshift V3:
Develop code (mine is JavaEE + Springframework + Mysql) on Eclipse and local git repositories;
Push the code to Github.com repositories (if I don't want to open my code to public, I pay for a private repository at https://github.com);
Use oc command line to get code from github.com into my Openshift V3 project.
Do I get this right?
In Openshift V3, is it possible I can do push code into Openshift project from eclipse directly, without going through github.com?

Correct. To keep that same workflow, you need an external git repo in v3. You don't have to use a paid GitHub.com to get private repos. Sign up for a free account on GitLab.com or Bitbucket.com - both include free private repos.
Then, check out this blog post series on best practices for using private git repos with OpenShift v3, which links to several guides on the subject: https://blog.openshift.com/private-git-repositories-part-1-best-practices/
Note: I prefer just sticking with an external private git repo, but if you don't want to go that route, you can use binary builds, as outlined here: https://stackoverflow.com/a/45892603/663541

Related

Is it possible to deploy to openshift using Circle CI?

Currently learning about CI CD for an upcoming project. Currently our project is being hosted on bitbucket and thus can't use Travis CI. Was thinking of using Circle CI in this case. Searched through the internet for examples of how to configure circle CI to deploy to openshift. Does anyone have experience with this?
In this case you do not want to use automatic webhook based build triggering in Openshift based on accepted pull requests in GitHub, but just simply trigger a build by CircleCI via e.g. the Openshift (oc start-build <buildconfig_name> --follow) CLI tool.

Redeploy Openshift Application when Docker Hub Image Changes?

Is there a way to trigger a re-deploy when I push an image to docker hub? I used S2I to build an image, put it up on docker hub, and did a deployment from there. How can I trigger a new deployment when I push a new image to docker hub?
Perhaps there is a better way? I created a wildfly image with the changes to the standalone.xml I needed. Then I used S2I to build my local source into a runnable wildfly application image, which is what I pushed and deployed. I'm trying to get around having to go through a github repository.
I'm thinking I could create an application with the customer wildfly image that I created and use the direct from IDE option to the application, but what if I want to use the command line?
You can set a scheduled flag on the image stream to have a remote registry periodically polled. This will only work though if the OpenShift cluster has been configured globally to allow that. If using OpenShift Online I don't believe that feature is enabled.
https://docs.openshift.com/container-platform/latest/dev_guide/managing_images.html#importing-tag-and-image-metadata
If you want to avoid using a Git repository, you can use a binary input build instead. This allows you to push files direct from your local computer. This means you can compile binary artifacts locally and push them into the S2I build done by OpenShift.
https://docs.openshift.com/container-platform/latest/dev_guide/builds/build_inputs.html#binary-source

Can I modify my openshift git repo using ssh shell?

I have working app on OpenShift server. My question is - how to update openshift's git repo of my application, if I make some changes using ssh acsess to openshift? I mean not using all this stuff with pull/push to my local mashine.
If I understand you correctly, you would like to modify source code without using git. I am not sure why you would want that. All that stuff with pull/push gives you a version control flexibility which can save you a lot of time when you screw up one thing. For example, you push brand new UI to production, which turns out to be buggy. With git, you have flexibility to revert back to previous version, and work on different branch to fix the bug on UI.
OpenShift follows conventional app structure. Git for source control, maven for build, jbosseap(for example) for app server, jenkins for continuous integration, etc. So, when you push using git, OpenShift will automatically build using maven, then deploy to the server.
If you would like to disregard all that advantages that OpenShift has to offer, use rhc ssh appname to directly work on the server.

Getting started with an existing github project for nitrous

I followed the directions on "Connecting to Github" article, and my github account has the nitrous keys.
I'm not able to find a way to connect an Nitrous box to an existing github repo. I have a rails project on github that I'd like to use with Nitrous.
I then tried downloading the Nitrous Desktop for Mac. I enabled File Sync. From the command line, I navigated to ~/Nitrous/BOX and I did a git clone from the github repo. The Nitrous web IDE does not show any of the synced files.
Update: The "workspace" folder does not automatically open up. Be sure to click on the triangle =)
I'm guessing this a feature that is just rolling out and maybe I'm trying to use Github integration too soon?
Ps. The documentation here http://help.nitrous.io/faq-adding-project/ on cloning from Git needs updating.
I use the command line tools git to perform a git repository synchronization in Nitrous.IO.
I use BitBucket but it's exactly the same thing with GitHub.
In GitHub I found this documentation : GitHub fork repository
All these actions need to be performed into the Consol windows from Nitrous.IO.
Might be a bit late to answer this question but you need to Add the SSH key to your Github account.
Nitrous leave quite good instructions here
http://help.nitrous.io/github-add-key/

Defining a Jenkins Build Job Based on a Kiln Mercurial Repository

I have a Jenkins instance with the Mercurial plugin installed on a Windows 2008 R2 machine. I am trying to define a build job for a Maven project on my KilnHQ repository. The HG clone step fails to retrieve code due to authentication failure.
I've read Kiln documentation and they only support HTTPS. There is no SSH support. However, the Jenkin's hg plugin does not allow me to enter a username/password.
How can I successfully wake my build work through Jenkins?
With (all) http(s):// URLs it's legal to put the username and password directly in the URL. Mercurial supports that. If The Mercurial plugin for Jenkins doesn't break it then you can probably do that:
https://user:pass#kilnhost.com/path/to/repo
If that doesn't work you can probably put the authentication information in the Jenkin's user's home directory's Mercurial.ini file's [auth] section: http://www.selenic.com/mercurial/hgrc.5.html#auth