Skip to content

Commit

Permalink
decoration
Browse files Browse the repository at this point in the history
  • Loading branch information
sivaramsingana committed May 31, 2021
1 parent d633c96 commit 749ba19
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@ Try to run `mvn clean package` to build your code.After this step is completed,
# Deploy your application to RedHat OpenShift
Create new directory and copy jar file from target folder/directory to newly created directory.

`[root@p1299-bastion Mongo-Collections-master]# mkdir -p /home/cecuser/sivaram/mongoapp
```
[root@p1299-bastion Mongo-Collections-master]# mkdir -p /home/cecuser/sivaram/mongoapp
[root@p1299-bastion Mongo-Collections-master]# cp target/demo-0.0.1-SNAPSHOT.jar /home/cecuser/sivaram/mongoapp/
`
```

get list of image streams available in your namespace using below command
`oc get is -n <NAMESPACE>`

Create a new build for you application mongo-collections
`[root@p1299-bastion Mongo-Collections-master]# oc new-build --binary=true --name=mongo-collections --image-stream=openjdk18-openshift
```
[root@p1299-bastion Mongo-Collections-master]# oc new-build --binary=true --name=mongo-collections --image-stream=openjdk18-openshift
--> Found image f726d5b (5 weeks old) in image stream "sivaram/openjdk18-openshift" under tag "latest" for "openjdk18-openshift"
Java Applications
Expand All @@ -48,11 +50,13 @@ get list of image streams available in your namespace using below command
--> Creating resources with label build=mongo-collections ...
imagestream.image.openshift.io "mongo-collections" created
buildconfig.build.openshift.io "mongo-collections" created
--> Success `
--> Success
```

After creating build, Start your build

`[root@p1299-bastion Mongo-Collections-master]# oc start-build mongo-collections --from-dir=/home/cecuser/sivaram/mongoapp --follow

```
[root@p1299-bastion Mongo-Collections-master]# oc start-build mongo-collections --from-dir=/home/cecuser/sivaram/mongoapp --follow
Uploading directory "/home/cecuser/sivaram/mongoapp" as binary input for the build ...
.
Uploading finished
Expand Down Expand Up @@ -105,11 +109,13 @@ Copying config sha256:e174f8adc5dfefba3e23e97e78d20173fde6cd0822a427ca571a751079
Writing manifest to image destination
Storing signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/sivaram/mongo-collections@sha256:0271e456ae34b2114b313a0e0d18cdf5dfeab18a322c9fb58777403c3aed5a47
Push successful `
Push successful
```

Now create your application

`[root@p1299-bastion Mongo-Collections-master]# oc new-app mongo-collections

```
[root@p1299-bastion Mongo-Collections-master]# oc new-app mongo-collections
--> Found image e174f8a (57 seconds old) in image stream "sivaram/mongo-collections" under tag "latest" for "mongo-collections"
Java Applications
Expand All @@ -125,23 +131,27 @@ Now create your application
--> Success
Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
'oc expose service/mongo-collections'
Run 'oc status' to view your app. `
Run 'oc status' to view your app.
```

Now check if pod is created

`[root@p1299-bastion Mongo-Collections-master]# oc get pods
```
[root@p1299-bastion Mongo-Collections-master]# oc get pods
NAME READY STATUS RESTARTS AGE
helm-mongo-ibm-mongodb-enterprise-helm-deployment-bfc946b88lnlt 1/1 Running 0 11d
mongo-collections-1-build 0/1 Completed 0 3m3s
mongo-collections-5f778dbbb8-5pd9x 1/1 Running 0 76s `
mongo-collections-5f778dbbb8-5pd9x 1/1 Running 0 76s
```
Now check your service for mongo-collections app and expose your service

`[root@p1299-bastion Mongo-Collections-master]# oc get svc -o name
service/helm-mongo-ibm-mongodb-enterprise-helm-service
service/mongo-collections
[root@p1299-bastion Mongo-Collections-master]# oc expose svc/mongo-collections
route.route.openshift.io/mongo-collections exposed `
```
Expand Down

0 comments on commit 749ba19

Please sign in to comment.