Skip to content

Commit 9b042f5

Browse files
authored
Merge pull request #20992 from boczkowska/fixCreateAModules
Moved the commands to appropriate modules.
2 parents 9881f3e + 5eea6da commit 9b042f5

4 files changed

+88
-47
lines changed

modules/openshift-developer-cli-creating-a-project-in-odo.adoc

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
[id="creating-a-project_{context}"]
88
= Creating a project
99

10+
Create a project to keep your source code, tests, and libraries organized in a separate single unit.
11+
1012
.Procedure
1113

1214
. Log in to an {product-title} cluster:
@@ -15,48 +17,10 @@
1517
$ odo login -u developer -p developer
1618
----
1719

18-
. Create a new directory for your components:
19-
+
20-
----
21-
$ mkdir my_components
22-
$ cd my_components
23-
----
24-
25-
ifeval::["{context}" == "creating-a-single-component-application-with-odo"]
26-
27-
. Download the example Node.js application:
28-
+
29-
----
30-
$ git clone https://github.com/openshift/nodejs-ex
31-
----
32-
33-
endif::[]
34-
35-
ifeval::["{context}" == "creating-a-multicomponent-application-with-odo"]
36-
37-
. Download the example back-end and front-end applications:
38-
+
39-
----
40-
$ git clone https://github.com/openshift-evangelists/Wild-West-Backend backend
41-
$ git clone https://github.com/openshift-evangelists/Wild-West-Frontend frontend
42-
----
43-
44-
endif::[]
45-
46-
ifeval::["{context}" == "creating-an-application-with-a-database"]
47-
48-
. Download the example front-end application:
49-
+
50-
----
51-
$ git clone https://github.com/openshift/nodejs-ex
52-
----
53-
54-
endif::[]
55-
56-
. Create a new project:
20+
. Create a project:
5721
+
5822
----
5923
$ odo project create myproject
6024
✓ Project 'myproject' is ready for use
6125
✓ New project created and now using project : myproject
62-
----
26+
----

modules/openshift-developer-cli-creating-and-deploying-a-nodejs-application-with-odo.adoc

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,50 @@
22
//
33
// * cli_reference/openshift_developer_cli/creating-a-single-component-application-with-odo
44
// * cli_reference/openshift_developer_cli/using-odo-in-a-restricted-environment/creating-and-deploying-a-component-to-the-restricted-cluster
5+
ifeval::["{context}" == "creating-a-single-component-application-with-odo"]
6+
:single:
7+
endif::[]
8+
ifeval::["{context}" == "creating-a-multicomponent-application-with-odo"]
9+
:multi:
10+
endif::[]
511

612
[id="creating-a-nodejs-application-with-odo_{context}"]
713
= Creating a Node.js application with {odo-title}
814

15+
To create a Node.js component, download the Node.js application and push the source code to your cluster with `{odo-title}`.
16+
917
.Procedure
1018

11-
. Change the current directory to the front-end directory:
19+
ifdef::single[]
20+
21+
. Create a directory for your components:
22+
+
23+
----
24+
$ mkdir my_components $$ cd my_components
25+
----
26+
27+
. Download the example Node.js application:
28+
+
29+
----
30+
$ git clone https://github.com/openshift/nodejs-ex
31+
----
32+
endif::single[]
33+
34+
ifdef::multi[]
35+
36+
. Download the example front-end application:
1237
+
1338
----
14-
$ cd <directory-name>
39+
$ git clone https://github.com/openshift-evangelists/Wild-West-Frontend frontend
40+
----
41+
42+
endif::multi[]
43+
44+
45+
. Change the current directory to the directory with your application:
46+
+
47+
----
48+
$ cd <directory name>
1549
----
1650

1751
. Add a component of the type Node.js to your application:
@@ -53,3 +87,10 @@ $ odo url list
5387
----
5488
$ curl <URL>
5589
----
90+
91+
ifeval::["{context}" == "creating-a-single-component-application-with-odo"]
92+
:!single:
93+
endif::[]
94+
ifeval::["{context}" == "creating-a-multicomponent-application-with-odo"]
95+
:!multi:
96+
endif::[]

modules/openshift-developer-cli-deploying-the-back-end-component.adoc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
= Deploying the back-end component
88

9+
To create a Java component, import the Java builder image, download the Java application and push the source code to your cluster with `{odo-title}`.
10+
911
.Procedure
1012

1113
. Import `openjdk18` into the cluster:
@@ -15,7 +17,7 @@ $ oc import-image openjdk18 \
1517
--from=registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift --confirm
1618
----
1719

18-
. Tag the image as `builder` to make it accesible for {odo-title}:
20+
. Tag the image as `builder` to make it accessible for {odo-title}:
1921
+
2022
----
2123
$ oc annotate istag/openjdk18:latest tags=builder
@@ -31,10 +33,22 @@ nodejs openshift 10,8,8-RHOAR,latest
3133
openjdk18 myproject latest
3234
----
3335

36+
. Create a directory for your components:
37+
+
38+
----
39+
$ mkdir my_components $$ cd my_components
40+
----
41+
42+
. Download the example back-end application:
43+
+
44+
----
45+
$ git clone https://github.com/openshift-evangelists/Wild-West-Backend backend
46+
----
47+
3448
. Change directory to the back-end source directory and check that you have the correct files in the directory:
3549
+
3650
----
37-
$ cd <directory-name>
51+
$ cd backend
3852
$ ls
3953
debug.sh pom.xml src
4054
----

modules/openshift-developer-cli-deploying-the-front-end-component.adoc

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,27 @@
33
// * cli_reference/openshift_developer_cli/creating-a-multicomponent-application-with-odo.adoc
44
// * cli_reference/openshift_developer_cli/creating-an-application-with-a-database.adoc
55

6+
ifeval::["{context}" == "creating-a-multicomponent-application-with-odo"]
7+
:multi:
8+
endif::[]
9+
ifeval::["{context}" == "creating-an-application-with-a-database"]
10+
:database:
11+
endif::[]
12+
613
[id="deploying-the-front-end-component_{context}"]
714

815
= Deploying the front-end component
916

17+
To create and deploy a front-end component, download the Node.js application and push the source code to your cluster with `{odo-title}`.
18+
1019
.Procedure
1120

21+
. Download the example front-end application:
22+
+
23+
----
24+
$ git clone https://github.com/openshift/nodejs-ex
25+
----
26+
1227
. Change the current directory to the front-end directory:
1328
+
1429
----
@@ -35,7 +50,7 @@ $ odo create nodejs frontend
3550
Please use `odo push` command to create the component with source deployed
3651
----
3752

38-
ifeval::["{context}" == "creating-an-application-with-a-database"]
53+
ifdef::database[]
3954
. Create a URL to access the frontend interface.
4055
+
4156
----
@@ -64,9 +79,9 @@ Validation
6479
✓ Building component [7s]
6580
✓ Changes successfully pushed to component
6681
----
67-
endif::[]
82+
endif::database[]
6883

69-
ifeval::["{context}" == "creating-a-multicomponent-application-with-odo"]
84+
ifdef::multi[]
7085
. Push the component to a running container.
7186
+
7287
----
@@ -85,4 +100,11 @@ Pushing to component frontend of type local
85100
✓ Building component [18s]
86101
✓ Changes successfully pushed to component
87102
----
103+
endif::multi[]
104+
105+
ifeval::["{context}" == "creating-a-multicomponent-application-with-odo"]
106+
:!multi:
107+
endif::[]
108+
ifeval::["{context}" == "creating-an-application-with-a-database"]
109+
:!database:
88110
endif::[]

0 commit comments

Comments
 (0)