Tag Archives: OSE

Setup Gitlab for automatic builds

Webhook triggers allow you to trigger a new build by sending a request to the OpenShift API endpoint. This can be done automatically with gitlab after you have pushed code changes.

Step-by-step guide

  1. Each Build Configuration has two Trigger Urls. One for Github and the other for generic git triggers. With gitlab you have to use the generic trigger url.
    You can find the Url in your project -> browse -> builds

    triggerurls

  2. Another way to obtain the trigger url is via the commandline. Just replace test with the name of your build config. 
    user@workstation:~$ oc describe bc test
    ...
    Webhook GitHub: https://master4.tsi-af.de:8443/oapi/v1/namespaces/test/buildconfigs/test/webhooks/3bd0cf0835e4b8ed/github
    Webhook Generic: https://master4.tsi-af.de:8443/oapi/v1/namespaces/test/buildconfigs/test/webhooks/980b8feafc60d8d7/generic
    ...
  3. Now you have to set the webhook in your gitlab repository.
    You can adjust this url in your repostiroy, tab settings -> web hooks.    webhookgitlab
  4. To test your web hook either change your code and push it to the repository or use the test button in the gitlab webintefacewebhookgitlabtest
    If there aren’t any issues you the information “Hook succesfully executed” wil be shown. If you now take a look over to the
    openshift webinterface you can see the build running in a newly created pod.

    testbuild_running

Related links:

https://docs.openshift.com/enterprise/3.0/dev_guide/builds.html#webhook-triggers

 

Setup Eclipse for Openshift

This guide helps to install Eclipse for Windows in order to access Openshift 3 and to develop Applications for the PaaS.

Prerequisites

check network connecti0ns and make sure the configuration of eclipse includes a proxy.

see Window->Preferences->General->Network Connection

image2015-6-22-11-40-17

Step-by-step guide

  1. Download and install Eclipse Mars from https://eclipse.org/downloads/packages/eclipse-ide-java-and-dsl-developers/marsm4
  2. Add the update site
      1. Click from the toolbar ‘Help > Install New Sofware’
      2. Click the ‘Add’ button and a dialog appears
      3. Enter a value for the name
      4. Enter ‘http://download.jboss.org/jbosstools/updates/nightly/mars/‘ for the location. Note: Alternative updates are available from the JBoss Tools Downloads. The various releases and code freeze dates are listed on the JBoss JIRA site
      5. Click ‘OK’ to add the update site
  3. Type ‘OpenShift’ in the text input box to filter the choices
  4. Check ‘JBoss OpenShift v3 Tools’ and click ‘Next’
  5. Click ‘Next’ again, accept the license agreement, and click ‘Finish’

 

Connecting to the Server

Your Eclipse Network settings should be configured as follows to work fine behind the coporate proxy. With this settings it was possible to establish a connection to the openshift master.

image2015-6-23-7-50-44

  1. Click ‘New Connection Wizard’ and a dialog appears (see below)
  2. Select a v3 connection type
  3. Uncheck default server
  4. Enter the URL to the OpenShift server instance (e.g. https://master1.tsi-af.de:8443)
  5. Enter the username and password for the connection (e.g. joe / redhat)

image2015-6-23-7-53-3

 

A successful connection will allow you to expand the OpenShift explorer tree and browse the projects associated with the account and the resources associated with each project.

bildschirmfoto-2015-06-23-um-14-13-26

Right now (OSE 3, Drop 4) it is not possible to create a new Application with this plugin.

bildschirmfoto-2015-06-23-um-14-13-11

 

OpenShift Ecosystem: Microsoft Visual Studio , OpenShift and .NET with Click2Cloud

Found a very useful description to use configurte Microsoft Visual Studio with openShift on RedHats openShift BLOG.

I made a copy to make that step-by-step description available.


Red Hat OpenShift 3 provides an API, Web Console and CLI for interfacing with the environment. However, learning these tools and remembering additional commands can become one more hurdle for a developer, which can slow adoption.

Ideally,  a developer can work  from their favorite IDE without having to use a different tool. This is what drove us at Click2Cloud to create the OpenShift 3, Docker Container and Kubernetes based Dev-Ops Extension for Microsoft Visual Studio 2015. This solution from Click2Cloud allows developers to connect to multiple OpenShift environments and deploy applications with ease from an environment they know and love.

How to Install the Click2Cloud Extension and Deploy a .NET Application in 5 Steps

Step 1 – Download and install the extension from the Microsoft Visual Studio Gallery.

image00

Step 2 – Launch the extension and Sign-in to OpenShift 3 environment

image02

Step 3 – Create Project, .NET application from custom templates or open existing project

image01    image04

Step 4 – View Webhook URL for the newly created application or for a running one and trigger a new build by sending a request to OpenShift API endpoint.

image03

image06

Step 5 – View Pod, Build Logs from OpenShift 3 and Start Build

image05

image07

Please Note: Users can use Click2Cloud’s ASP.NET 5.0 Docker builder image to create a .NET based application in OpenShift.

 

In addition to the Visual Studio plugin, we also provide a Docker Explorer plugin that can be used in tandem for a complete view of your development artifacts — see it it action here. We are just scratching the surface of what are providing to enhance the developer experience with OpenShift for Windows users. If you want to learn more, then  check us out at http://click2cloud.net today!

 

Author

This OpenShift Ecosystem post was created by Prashanth Mishra, VP, Business Dev. at Click2Cloud Inc.

Do not hesitate to connect with Prashanth if you want to learn more about Click2Cloud:

Twitter – https://twitter.com/TWIT2PM

Facebook – https://www.facebook.com/writetoprashant

LinkedIn – https://www.linkedin.com/in/mishrap