Search code examples
gitopenshiftjboss-tools

Openshift Existing Build Configs is not shown with jboss tools


I am testing wildfly deployment on openshift v3 with JBoss Tools. This reference site is https://access.redhat.com/documentation/en-us/red_hat_jboss_developer_studio/10.1/html/getting_started_with_container_and_cloud-based_development/developing_for_the_cloud_with_openshift_3#build_logs

Generating Wildfly pod is successful. And Git source is set with this url, https://github.com/gladiator67/test-openshift.git and windows folder. This is my folder image.

enter image description here

enter image description here

The problems is Import an Existing OpenShift 3 Application into the IDE. I try to import Application. But Existing Build Configs is not shown. I can not import any source project into Openshift explorer.

enter image description here


Solution

  • OK. Now I see what you want to do. OpenShift 3 has slightly different concept. What you want to read about is something called Source to Image (S2I). It's basically builder image, which clones your git repository, builds it, creates an docker image and pushes it into openshift docker registry.

    In devstudio, you will do something like this:

    1) Have OpenShift connection, create project, create new application

    2) On the first page of New OpenShift Application wizard, select builder image you want (I used jboss-eap70-openshift:1:4) enter image description here

    3) On the second page, fill out your git repo URL, your branch and context dir: enter image description here 4) The rest of pages should be OK with default settings.

    After hitting Finish, the build pod should start. It will clone your repository, build it (using maven) and create docker image with your application. After this image is pushed to openshift's internal registry, the build pod is terminated and new pod should be created (this is your app).

    One last step is missing. When app is being build, it uses maven "openshift" profile, so add it to your pom.xml: https://github.com/rhopp/openshift-test-helloworld/commit/f32c6a87163374a85009b9148338a82ac150a422

    Now there are two options:

    1) Every time you commit something into your repository you can start new build by hand or

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

    And for faster development there is third option: Using Server adapter, which just rsync the build classes directly into pods without need to commit and push your changes and waiting for the buid to finish: https://tools.jboss.org/documentation/howto/os3_startusing.html#deploy_app

    If you want something, you can catch me (or the JBoss Tools developers) on #jbosstools irc channel on freenode. Radim