You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 28, 2022. It is now read-only.
* Develop a simple microservice that uses Eclipse Codewind on CodeReady Workspaces
15
15
16
16
## Overview
17
-
Use Eclipse Codewind to develop microservice applications from application stacks in an integrated developer environment (IDE).CodeReady Workspaces provides a containerized IDE for cloud native application development on an OpenShift cluster.
17
+
Use Eclipse Codewind to develop microservice applications from application stacks in an integrated developer environment (IDE).CodeReady Workspaces provides a containerized IDE for cloud native application development on an OpenShift cluster.
18
18
19
19
## Developing with CodeReady Workspaces
20
20
CodeReady Workspaces uses Kubernetes and containers to provide a preconfigured environment. Use CodeReady Workspaces to create, build, and test your code in OpenShift containers but feel like you are working on an IDE on your local machine.
21
21
22
22
### Prerequisite
23
23
CodeReady Workspaces require at least two 5Gi ReadWriteOnce (RWO) persistent volumes on the cluster to install and a 5Gi RWO volume for each created workspace.
24
24
25
-
Each Codewind workspace also requires at least on 5Gi ReadWriteMany (RWX) persistent volume.
25
+
Each Codewind workspace also requires at least one 5Gi ReadWriteMany (RWX) persistent volume.
26
26
27
-
Before you can use Codewind with CodeReady Workspaces, apply the Codewind cluster role with `oc apply -f`.
27
+
Before you can use Codewind with CodeReady Workspaces, you must:
28
+
29
+
1. Install an OpenShift cluster.
30
+
2. Apply the Codewind cluster by going to your command line and inputting `oc apply -f`.
28
31
29
32
### Installing CodeReady Workspaces
30
33
1\. Log in to your OpenShift cluster.
@@ -37,12 +40,6 @@ Before you can use Codewind with CodeReady Workspaces, apply the Codewind cluste
37
40
38
41
{:width="900"}.
After you install CodeReady Workspaces, log in and create a Codewind workspace from the Codewind devfile:
102
105
103
-
1\. Log in to Che. Che loads.
106
+
1\. Log in to CodeReady Workspaces.
104
107
105
108
2\. Go to **Workspaces** then click **Add Workspace**.
106
109
107
110
3\. Click **Import Devfile**.
108
111
109
112
4\. From **Source**, click **YAML**.
110
113
111
-
5\. Go to the link, [codewind-che-plugin/0.12.0/devfile.yaml](https://raw.githubusercontent.com/eclipse/codewind-che-plugin/0.12.0/devfiles/0.12.0/devfile.yaml), then copy and paste the contents into the YAML text box in your Codewind workspace.
114
+
5\. Go to the link, [codewind-che-plugin/0.12.0/devfile.yaml](https://raw.githubusercontent.com/eclipse/codewind-che-plugin/0.13.0/devfiles/0.13.0/devfile.yaml), then copy and paste the contents into the YAML text box in your Codewind workspace.
112
115
113
116
6\. Click **Create & Open**.
114
117
115
118
### Setting up Codewind
116
119
Because of its dependency on `buildah`, Codewind needs to run as root and privileged. To enable Codewind, run the following commands:
* `oc adm policy add-scc-to-user anyuid system:serviceaccounts:<namespace where you installed CodeReady Workspaces>:che-workspace`
121
+
* `oc adm policy add-scc-to-user privileged system:serviceaccounts:<namespace where you installed CodeReady Workspaces>:che-workspace`
119
122
120
123
CodeReady Workspaces starts Codewind and installs the Codewind plug-ins. This process might take a couple of minutes for all of the necessary components to be pulled and started.
121
124
122
125
### Configuring Codewind to use application stacks
123
126
Configure Codewind to use Appsody templates so you can focus exclusively on your code. Complete the following steps to select the Appsody templates:
124
127
125
-
1. Under the Explorer pane, select **Codewind**.
126
-
2. Right-click **Local**.
128
+
1. Select **Codewind**.
129
+
2. Right-click **Projects**.
127
130
3. Select **Template Source Manager**.
128
131
4. Enable **Appsody Stacks - incubator** and **Default templates**.
129
132
130
133
After you configured Codewind to use Appsody templates, continue to develop your microservice within Codewind.
131
134
132
-
If your organization uses customized application stacks and gives you a URL that points to an `index.json` file, you can add it to Codewind:
133
-
134
-
1. Return to **Codewind** and right-click **Local**.
135
-
2. Select **Template Source Manager**.
136
-
3. Click **Add New +** to add your URL.
137
-
4. Add your URL in the pop-up window and save your changes.
138
-
139
135
### Creating an Appsody project
140
-
Throughout the application lifestyle, Appsody helps you develop containerized applications and maximize containers curated for your usage. If you want more context about Appsody, see [Appsody welcome page](https://appsody.dev/docs).
136
+
Throughout the application lifestyle, Appsody helps you develop containerized applications and maximize containers curated for your usage.
141
137
142
138
1. Under the Explorer pane, select **Codewind**.
143
139
2. Expand **Codewind** by clicking the drop-down arrow.
@@ -217,9 +213,9 @@ Any changes that you make to your code are automatically built and redeployed by
217
213
### Working with the example calculator microservice
218
214
You now can work with the example calculator microservice.
219
215
220
-
1. Use the port number that you saw when you first opened the application.
216
+
1. Use the URL that you saw when you first opened the application.
221
217
2. Make sure to remove the `< >` symbol in the URL.
@@ -228,8 +224,8 @@ You can add (+), subtract (-), and multiply (*) with this simple calculator.
228
224
229
225
You can also try a few of the sample calculator functions:
230
226
231
-
* `http://127.0.0.1:<port>/starter/calculator/{op}/{a}/{b}`, where you can input one of the available operations `(+, _, *)`, and an integer a, and an integer b.
232
-
* So for `http://127.0.0.1:<port>/starter/calculator/+/10/3` you see: `10+3=13`.
227
+
* `http://127.0.0.1:<url>/starter/calculator/{op}/{a}/{b}`, where you can input one of the available operations `(+, _, *)`, and an integer a, and an integer b.
228
+
* So for `http://127.0.0.1:<url>/starter/calculator/+/10/3` you see: `10+3=13`.
233
229
234
230
## What you have learned
235
231
Now that you have completed this quick guide, you have learned to:
0 commit comments