Skip to content

Commit

Permalink
Merge pull request #827 from emmartins/todo-rework
Browse files Browse the repository at this point in the history
WFLY-18512: todo-backend Quickstart Common Enhancements CY2023Q3
  • Loading branch information
emmartins authored Dec 20, 2023
2 parents 5f4f77c + fea3081 commit 34ce31f
Show file tree
Hide file tree
Showing 15 changed files with 198 additions and 745 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
postgresql:
primary:
podSecurityContext:
enabled: true
fsGroup: 1001
containerSecurityContext:
enabled: true
runAsUser: 1001
runAsGroup: 0
runAsNonRoot: true
allowPrivilegeEscalation: false
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ function installPrerequisites()
echo "Adding bitnami repository"
helm repo add bitnami https://charts.bitnami.com/bitnami

helm dependency update todo-backend-chart/
helm dependency update charts/
}

function helmInstall() {
application="${1}"
helm_set_arguments="$2"

# TODO https://issues.redhat.com/browse/WFLY-18574 remove this when persistence is working
helm_set_arguments="${helm_set_arguments} --set postgresql.primary.persistence.enabled=false"
helm_set_arguments="${helm_set_arguments} -f .ci/openshift-ci/build-root/scripts/qs-overrides/todo-backend/ci.yaml"

# Don't quote ${helm_set_arguments} as it breaks the command when empty, and seems to work without
helm install "${application}" todo-backend-chart/ --wait --timeout="${helm_install_timeout}" ${helm_set_arguments}
Expand All @@ -22,8 +22,7 @@ function helmInstall() {

function cleanPrerequisites()
{
oc delete all -l template=postgresql-ephemeral-template
oc delete secret todo-backend-db
helm uninstall "${application}"
helm repo remove bitnami
}

Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/quickstart_todo-backend_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: WildFly Todo Backend Quickstart CI

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'todo-backend/**'
- '.github/workflows/quickstart_ci.yml'
jobs:
call-quickstart_ci:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: todo-backend
TEST_PROVISIONED_SERVER: true
TEST_OPENSHIFT: true
MATRIX_OS: "ubuntu-latest"
2 changes: 2 additions & 0 deletions .github/workflows/quickstart_todo-backend_ci_before.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
docker run --name todo-backend-db -e POSTGRES_USER=todos -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 postgres
6 changes: 4 additions & 2 deletions shared-doc/run-integration-tests-with-provisioned-server.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ ifndef::server_provisioning_server_host[]
:server_provisioning_server_host: http://localhost:8080
endif::server_provisioning_server_host[]

ifndef::extraStartParams[:extraStartParams: ]

The integration tests included with this quickstart, which verify that the quickstart runs correctly, may also be run with a provisioned server.

Follow these steps to run the integration tests.
Expand Down Expand Up @@ -62,13 +64,13 @@ endif::[]
ifndef::deploymentDir[]
[source,subs="attributes+",options="nowrap"]
----
$ mvn wildfly:start -DjbossHome=target/server
$ mvn wildfly:start -DjbossHome=target/server {extraStartParams}
----
endif::[]
ifdef::deploymentDir[]
[source,subs="attributes+",options="nowrap"]
----
$ mvn -f {deploymentDir}/pom.xml wildfly:start -DjbossHome={deploymentDir}/target/server
$ mvn -f {deploymentDir}/pom.xml wildfly:start -DjbossHome={deploymentDir}/target/server {extraStartParams}
----
endif::[]

Expand Down
Loading

0 comments on commit 34ce31f

Please sign in to comment.