Show
Consider the following scenario:
Clone the Java S2I quickstart:
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml $ git clone https: //github.com/jboss-openshift/openshift-quickstarts.git
Configure the Red Hat JBoss Middleware Maven repository
Build the Java S2I undertow-servlet locally:
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml $ cd openshift-quickstarts/undertow-servlet/
$ mvn install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.openshift.quickstarts.undertow:servlet:jar:1.0.0.Final
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ line 80, column 29
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-shade-plugin is missing. @ line 68, column 29
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Undertow Servlet Example 1.0.0.Final
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources ( default -resources) @ servlet ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile ( default -compile) @ servlet ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 2 source files to /tmp/github/openshift-quickstarts/undertow-servlet/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources ( default -testResources) @ servlet ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /tmp/github/openshift-quickstarts/undertow-servlet/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile ( default -testCompile) @ servlet ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test ( default -test) @ servlet ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar ( default -jar) @ servlet ---
[INFO] Building jar: /tmp/github/openshift-quickstarts/undertow-servlet/target/undertow-servlet.jar
[INFO]
[INFO] --- maven-shade-plugin:3.0.0:shade ( default ) @ servlet ---
[INFO] Including io.undertow:undertow-core:jar:1.3.25.Final-redhat-1 in the shaded jar.
[INFO] Including org.jboss.logging:jboss-logging:jar:3.2.1.Final in the shaded jar.
[INFO] Including org.jboss.xnio:xnio-api:jar:3.3.6.Final in the shaded jar.
[INFO] Including org.jboss.xnio:xnio-nio:jar:3.3.6.Final in the shaded jar.
[INFO] Including io.undertow:undertow-servlet:jar:1.3.25.Final-redhat-1 in the shaded jar.
[INFO] Including org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec:jar:1.0.0.Final in the shaded jar.
[INFO] Including org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:jar:1.0.0.Final in the shaded jar.
[INFO] Including org.jboss.logmanager:jboss-logmanager:jar:2.0.3.Final-redhat-1 in the shaded jar.
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing /tmp/github/openshift-quickstarts/undertow-servlet/target/undertow-servlet.jar with /tmp/github/openshift-quickstarts/undertow-servlet/target/servlet-1.0.0.Final-shaded.jar
[INFO] Dependency-reduced POM written at: /tmp/github/openshift-quickstarts/undertow-servlet/dependency-reduced-pom.xml
[INFO]
[INFO] --- maven-install-plugin:2.4:install ( default -install) @ servlet ---
[INFO] Installing /tmp/github/openshift-quickstarts/undertow-servlet/target/undertow-servlet.jar to /home/iankko/.m2/repository/org/openshift/quickstarts/undertow/servlet/1.0.0.Final/servlet-1.0.0.Final.jar
[INFO] Installing /tmp/github/openshift-quickstarts/undertow-servlet/dependency-reduced-pom.xml to /home/iankko/.m2/repository/org/openshift/quickstarts/undertow/servlet/1.0.0.Final/servlet-1.0.0.Final.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.103 s
[INFO] Finished at: 2017-04-13T11:16:32+02:00
[INFO] Final Memory: 27M/202M
[INFO] ------------------------------------------------------------------------
Prepare the directory structure for the ARTIFACT_DIR variable. Copy the produced *.jar file into the /tmp/binary_builds/custarts folder:
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml $ mkdir -p /tmp/binary_builds/custarts
$ cp target/undertow-servlet.jar /tmp/binary_builds/custarts/
Run binary build in OCP setting custom ARTIFACT_DIR value:
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml $ oc login
$ oc new -project jdk-bin-demo
$ oc get is -n openshift | grep '^redhat-openjdk' | cut -f1 -d ' '
redhat-openjdk-18
$ oc new -build --binary= true --name=jdk-us-app --image-stream=redhat-openjdk-18 -e ARTIFACT_DIR=custarts
--> Found image bc310f6 (8 weeks old) in image stream "redhat-openjdk-18" in project "openshift" under tag "latest" for "redhat-openjdk-18"
Java Applications
-----------------
Platform for building and running plain Java applications (fat-jar and flat classpath)
Tags: builder, java
* A source build using binary input will be created
* The resulting image will be pushed to image stream "jdk-us-app:latest"
* Use 'start-build --from-dir=DIR|--from-repo=DIR|--from-file=FILE' to trigger a new build
* WARNING: a binary build was created, you must specify one of --from-dir|--from-file|--from-repo when starting builds
--> Creating resources with label build=jdk-us-app ...
imagestream "jdk-us-app" created
buildconfig "jdk-us-app" created
--> Success
$ oc start-build jdk-us-app --from-dir=/tmp/binary_builds/ --follow
Uploading directory "/tmp/binary_builds" as binary input for the build ...
build "jdk-us-app-1" started
Receiving source from STDIN as archive ...
==================================================================
Starting S2I Java Build .....
S2I source build with plain binaries detected
Copying binaries from custarts to /deployments ...
cp: cannot stat 'custarts/*' : No such file or directory
Aborting due to error code 1 for copying custarts to /deployments
error: build error: non-zero (13) exit code from registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift@sha256:8a322fc64cae2b2977fa39fed5912c9aeb8ba2391a90cd5356053bce98b63b66
Current result:
oc start-build for binary type build when ARTIFACT_DIR variable is set shows:
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml Starting S2I Java Build .....
S2I source build with plain binaries detected
Copying binaries from custarts to /deployments ...
cp: cannot stat 'custarts/*' : No such file or directory
Aborting due to error code 1 for copying custarts to /deployments
and the binary build doesn't start correctly.
Expected result:
Binary build with custom value of ARTIFACT_DIR is executed properly.