Skip to content

Commit 251caf8

Browse files
Merge pull request #263927 from majguo/format-tabs
Format tabs to correctly render
2 parents 9e756b0 + f7128a4 commit 251caf8

File tree

1 file changed

+41
-42
lines changed

1 file changed

+41
-42
lines changed

articles/aks/howto-deploy-java-liberty-app.md

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ If you navigated away from the **Deployment is in progress** page, the following
8888
* `cmdToConnectToCluster`
8989
* `appDeploymentTemplateYaml` if you select **No** to **Deploy an application?** when deploying the Marketplace offer; or `appDeploymentYaml` if you select **yes** to **Deploy an application?**.
9090

91-
### [Bash](#tab/in-bash)
91+
# [Bash](#tab/in-bash)
9292

93-
Paste the value of `appDeploymentTemplateYaml` or `appDeploymentYaml` into a Bash shell, append `| grep secretName`, and execute. This command will output the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for `secretName` from the output.
93+
Paste the value of `appDeploymentTemplateYaml` or `appDeploymentYaml` into a Bash shell, append `| grep secretName`, and execute. This command will output the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for `secretName` from the output.
9494

95-
### [PowerShell](#tab/in-powershell)
95+
# [PowerShell](#tab/in-powershell)
9696

97-
Paste the quoted string in `appDeploymentTemplateYaml` or `appDeploymentYaml` into a PowerShell, append `| ForEach-Object { [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_)) } | Select-String "secretName"`, and execute. This command will output the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for `secretName` from the output.
97+
Paste the quoted string in `appDeploymentTemplateYaml` or `appDeploymentYaml` into a PowerShell, append `| ForEach-Object { [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_)) } | Select-String "secretName"`, and execute. This command will output the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for `secretName` from the output.
9898

99-
---
99+
---
100100

101101
These values will be used later in this article. Note that several other useful commands are listed in the outputs.
102102

@@ -170,7 +170,7 @@ In directory *liberty/config*, the *server.xml* file is used to configure the DB
170170

171171
Now that you've gathered the necessary properties, you can build the application. The POM file for the project reads many variables from the environment. As part of the Maven build, these variables are used to populate values in the YAML files located in *src/main/aks*. You can do something similar for your application outside Maven if you prefer.
172172

173-
### [Bash](#tab/in-bash)
173+
# [Bash](#tab/in-bash)
174174

175175
```bash
176176
cd <path-to-your-repo>/java-app
@@ -189,7 +189,7 @@ export INGRESS_TLS_SECRET=<ingress-TLS-secret-name>
189189
mvn clean install
190190
```
191191

192-
### [PowerShell](#tab/in-powershell)
192+
# [PowerShell](#tab/in-powershell)
193193

194194
```powershell
195195
cd <path-to-your-repo>/java-app
@@ -206,7 +206,6 @@ $Env:DB_PASSWORD=<server-admin-password>
206206
$Env:INGRESS_TLS_SECRET=<ingress-TLS-secret-name>
207207
208208
mvn clean install
209-
210209
```
211210

212211
---
@@ -242,29 +241,29 @@ You can now use the following steps to test the Docker image locally before depl
242241

243242
1. Run the image using the following command. Note we're using the environment variables defined previously.
244243

245-
### [Bash](#tab/in-bash)
244+
# [Bash](#tab/in-bash)
246245

247-
```bash
248-
docker run -it --rm -p 9080:9080 \
249-
-e DB_SERVER_NAME=${DB_SERVER_NAME} \
250-
-e DB_NAME=${DB_NAME} \
251-
-e DB_USER=${DB_USER} \
252-
-e DB_PASSWORD=${DB_PASSWORD} \
253-
javaee-cafe:v1
254-
```
246+
```bash
247+
docker run -it --rm -p 9080:9080 \
248+
-e DB_SERVER_NAME=${DB_SERVER_NAME} \
249+
-e DB_NAME=${DB_NAME} \
250+
-e DB_USER=${DB_USER} \
251+
-e DB_PASSWORD=${DB_PASSWORD} \
252+
javaee-cafe:v1
253+
```
255254

256-
### [PowerShell](#tab/in-powershell)
255+
# [PowerShell](#tab/in-powershell)
257256

258-
```powershell
259-
docker run -it --rm -p 9080:9080 `
260-
-e DB_SERVER_NAME=${Env:DB_SERVER_NAME} `
261-
-e DB_NAME=${Env:DB_NAME} `
262-
-e DB_USER=${Env:DB_USER} `
263-
-e DB_PASSWORD=${Env:DB_PASSWORD} `
264-
javaee-cafe:v1
265-
```
257+
```powershell
258+
docker run -it --rm -p 9080:9080 `
259+
-e DB_SERVER_NAME=${Env:DB_SERVER_NAME} `
260+
-e DB_NAME=${Env:DB_NAME} `
261+
-e DB_USER=${Env:DB_USER} `
262+
-e DB_PASSWORD=${Env:DB_PASSWORD} `
263+
javaee-cafe:v1
264+
```
266265

267-
---
266+
---
268267

269268
1. Once the container starts, go to `http://localhost:9080/` in your browser to access the application.
270269

@@ -274,15 +273,15 @@ You can now use the following steps to test the Docker image locally before depl
274273

275274
Upload the built image to the ACR created in the offer.
276275

277-
### [Bash](#tab/in-bash)
276+
# [Bash](#tab/in-bash)
278277

279278
```bash
280279
docker tag javaee-cafe:v1 ${LOGIN_SERVER}/javaee-cafe:v1
281280
docker login -u ${USER_NAME} -p ${PASSWORD} ${LOGIN_SERVER}
282281
docker push ${LOGIN_SERVER}/javaee-cafe:v1
283282
```
284283

285-
### [PowerShell](#tab/in-powershell)
284+
# [PowerShell](#tab/in-powershell)
286285

287286
```powershell
288287
docker tag javaee-cafe:v1 ${Env:LOGIN_SERVER}/javaee-cafe:v1
@@ -342,36 +341,36 @@ Use the following steps to deploy and test the application:
342341
343342
1. Go to `https://<ADDRESS>` to test the application. For your convenience, this shell command will create an environment variable whose value you can paste straight into the browser.
344343
345-
### [Bash](#tab/in-bash)
344+
# [Bash](#tab/in-bash)
346345
347-
```bash
348-
export APP_URL=https://$(kubectl get ingress | grep javaee-cafe-cluster-agic-ingress | cut -d " " -f14)/
349-
echo $APP_URL
350-
```
346+
```bash
347+
export APP_URL=https://$(kubectl get ingress | grep javaee-cafe-cluster-agic-ingress | cut -d " " -f14)/
348+
echo $APP_URL
349+
```
351350
352-
### [PowerShell](#tab/in-powershell)
351+
# [PowerShell](#tab/in-powershell)
353352
354-
```powershell
355-
$APP_URL = "https://$(kubectl get ingress | Select-String 'javaee-cafe-cluster-agic-ingress' | ForEach-Object { $_.Line.Split(' ')[13] })/"
356-
$APP_URL
357-
```
353+
```powershell
354+
$APP_URL = "https://$(kubectl get ingress | Select-String 'javaee-cafe-cluster-agic-ingress' | ForEach-Object { $_.Line.Split(' ')[13] })/"
355+
$APP_URL
356+
```
358357
359-
---
358+
---
360359
361360
If the web page doesn't render correctly or returns a `502 Bad Gateway` error, that's because the app is still starting in the background. Wait for a few minutes and then try again.
362361
363362
## Clean up resources
364363
365364
To avoid Azure charges, you should clean up unnecessary resources. When the cluster is no longer needed, use the [az group delete](/cli/azure/group#az-group-delete) command to remove the resource group, container service, container registry, and all related resources.
366365
367-
### [Bash](#tab/in-bash)
366+
# [Bash](#tab/in-bash)
368367
369368
```bash
370369
az group delete --name $RESOURCE_GROUP_NAME --yes --no-wait
371370
az group delete --name <db-resource-group> --yes --no-wait
372371
```
373372
374-
### [PowerShell](#tab/in-powershell)
373+
# [PowerShell](#tab/in-powershell)
375374
376375
```powershell
377376
az group delete --name $Env:RESOURCE_GROUP_NAME --yes --no-wait

0 commit comments

Comments
 (0)