oc command deployment

upload the war file from local to server

reference link

https://blog.openshift.com/deploying-war-file-openshift-online-3/

Step 1 :

First, create a directory for your project on your local file system. For example, I like to store all of my project in my ~/code directory so I would issue the following command (assuming sample.war is located in my Downloads directory):

mkdir sample
$ cd sample
$ cp ~/Downloads/sample.war .
oc new-app wildfly:latest~. --name mysample

oc new-app jboss-webserver30-tomcat8-openshift:latest~. --name=singsample

OC command deploy WAR (Tomcat)

Reference

https://access.redhat.com/documentation/en-us/reference_architectures/2017/html-single/build_and_deployment_of_java_applications_on_openshift_container_platform_3/index

Step 1

login Openshift

Step 2

Identify the JWS for OpenShift image stream to use for your application with

oc get is -n openshift

oc get is -n openshift | grep ^jboss-webserver | cut -f1 -d ' '

Step 3

Create new build configuration, specifying image stream and application name

oc new-build --binary=true  --image-stream=jboss-webserver31-tomcat8-openshift:1.2 --name=test

Step 4

Start the binary build. Instruct OpenShift to use source directory for the binary input for the OpenShift image build

oc start-build jws-wsch-app --from-file=xxx.war --follow
oc start-build jws-wsch-app --from-dir=./ocp --follow

Step 5

Create a new OpenShift application based on the image

oc new-app test

Step 6

Expose the service to make the application accessible to users:

oc expose svc/test

Deploy the program from source (S2I)

Step 1

login Openshift

Step 2

Identify the JWS for OpenShift image stream to use for your application with

oc get is -n openshift

oc get is -n openshift | grep ^jboss-webserver | cut -f1 -d ' '

Step 3

Create new build configuration, specifying image stream and application name

oc new-app jboss-webserver31-tomcat8-openshift:1.2~https://github.com/singzinc/spring-boot-war.git --context-dir=spring-boot-war/ --name=sing-test-s2i

Step 4

oc start-build sing-test-s2i

Step 5

Expose the service to make the application accessible to users:

oc expose svc/sing-test-s2i

Other,

if you want to update the application, rerun Step 4

results for ""

    No results matching ""