Skip to content

Commit b861313

Browse files
committed
[WFLY-21081] Add a quickstart showing Jakarta Data
1 parent 0ea81c7 commit b861313

File tree

27 files changed

+3024
-4
lines changed

27 files changed

+3024
-4
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: WildFly todo-jakarta-data Quickstart CI
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
paths:
7+
- 'todo-jakarta-data/**'
8+
- '.github/workflows/quickstart_ci.yml'
9+
jobs:
10+
call-quickstart_ci:
11+
uses: ./.github/workflows/quickstart_ci.yml
12+
with:
13+
QUICKSTART_PATH: todo-jakarta-data
14+
TEST_PROVISIONED_SERVER: true
15+
TEST_OPENSHIFT: true
16+
MATRIX_OS: '"ubuntu-latest"'
17+
EXTRA_RUN_ARGS: '-DPOSTGRESQL_DATABASE=todos -DPOSTGRESQL_SERVICE_HOST=localhost -DPOSTGRESQL_SERVICE_PORT=5432 -DPOSTGRESQL_USER=todos -DPOSTGRESQL_PASSWORD=mysecretpassword -DPOSTGRESQL_DATASOURCE=ToDos'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
docker run --name todo-jakarta-data-db -e POSTGRES_USER=todos -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
postgresql:
2+
primary:
3+
podSecurityContext:
4+
enabled: true
5+
fsGroup: 1001
6+
containerSecurityContext:
7+
enabled: true
8+
runAsUser: 1001
9+
runAsGroup: 0
10+
runAsNonRoot: true
11+
allowPrivilegeEscalation: false
12+
seccompProfile:
13+
type: RuntimeDefault
14+
capabilities:
15+
drop:
16+
- ALL
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
function installPrerequisites()
2+
{
3+
echo "Adding bitnami repository"
4+
helm repo add bitnami https://charts.bitnami.com/bitnami
5+
6+
helm dependency update charts/
7+
}
8+
9+
function helmInstall() {
10+
application="${1}"
11+
helm_set_arguments="$2"
12+
13+
# TODO https://issues.redhat.com/browse/WFLY-18574 remove this when persistence is working
14+
helm_set_arguments="${helm_set_arguments} -f ../.ci/openshift-ci/build-root/scripts/qs-overrides/todo-jakarta-data/ci.yaml"
15+
16+
helm install "${application}" charts/ --wait --timeout="${helm_install_timeout}" ${helm_set_arguments}
17+
echo $?
18+
}
19+
20+
21+
22+
function cleanPrerequisites()
23+
{
24+
helm uninstall "${application}"
25+
helm repo remove bitnami
26+
}
27+
28+
function getHelmSetVariablePrefix() {
29+
echo "wildfly."
30+
}
31+
32+
function helmInstallFailed() {
33+
echo "----> Getting status of all pods"
34+
kubectl get pods
35+
echo "----> Checking logs for postgres pod"
36+
kubectl logs todo-jakarta-data-postgresql-0
37+
echo "----> Checking events"
38+
kubectl get events
39+
}

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@
287287
<module>tasks-jsf</module>
288288
<module>temperature-converter</module>
289289
<module>todo-backend</module>
290+
<module>todo-jakarta-data</module>
290291
<module>thread-racing</module>
291292
<module>websocket-endpoint</module>
292293
<module>websocket-hello</module>

todo-backend/README-source.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ is provided by the `org.jboss.eap:eap-datasources-galleon-pack` feature pack.
116116
endif::[]
117117

118118
By default, it exposes a single datasource.
119-
In the backend, the name of this datasource is `ToDos` and is specified in the `persistence.xml` to configure JPA:
119+
In the backend, the name of this datasource is `ToDoRepository` and is specified in the `persistence.xml` to configure JPA:
120120

121121
[source,xml]
122122
----
@@ -131,7 +131,7 @@ At runtime, we only need a few environment variables to establish the connection
131131
* `POSTGRESQL_SERVICE_HOST` - the host to connect to the database
132132
* `POSTGRESQL_SERVICE_PORT` - The port to connect to the database
133133
* `POSTGRESQL_USER` & `POSTGRESQL_PASSWORD` - the credentials to connect to the database
134-
* `POSTGRESQL_DATASOURCE` - The name of the datasources (as mentioned above, it will be `ToDos`)
134+
* `POSTGRESQL_DATASOURCE` - The name of the datasources (as mentioned above, it will be `ToDoRepository`)
135135

136136
=== Filters for Cross-Origin Resource Sharing (CORS)
137137

todo-backend/README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ is provided by the `org.jboss.eap:eap-datasources-galleon-pack` feature pack.
268268
endif::[]
269269
270270
By default, it exposes a single datasource.
271-
In the backend, the name of this datasource is `ToDos` and is specified in the `persistence.xml` to configure JPA:
271+
In the backend, the name of this datasource is `ToDoRepository` and is specified in the `persistence.xml` to configure JPA:
272272
273273
[source,xml]
274274
----
@@ -283,7 +283,7 @@ At runtime, we only need a few environment variables to establish the connection
283283
* `POSTGRESQL_SERVICE_HOST` - the host to connect to the database
284284
* `POSTGRESQL_SERVICE_PORT` - The port to connect to the database
285285
* `POSTGRESQL_USER` & `POSTGRESQL_PASSWORD` - the credentials to connect to the database
286-
* `POSTGRESQL_DATASOURCE` - The name of the datasources (as mentioned above, it will be `ToDos`)
286+
* `POSTGRESQL_DATASOURCE` - The name of the datasources (as mentioned above, it will be `ToDoRepository`)
287287
288288
=== Filters for Cross-Origin Resource Sharing (CORS)
289289

0 commit comments

Comments
 (0)