Skip to content

Commit

Permalink
US-568873-Changes for certs manager to support custom keystore name (#…
Browse files Browse the repository at this point in the history
…205)

 US-568873-Changes for certs manager to support custom keystore name
  • Loading branch information
Saurabh-16 authored Jan 10, 2024
1 parent 704772a commit 1964fe6
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 3 deletions.
18 changes: 15 additions & 3 deletions scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,20 @@ do
fi
done

#tomcat ssl certs
tomcat_keystore_password_file="${tls_cert_root}/TOMCAT_KEYSTORE_PASSWORD"
tomcat_keystore_file="${tls_cert_root}/TOMCAT_KEYSTORE_CONTENT"
# tomcat ssl certs
if [ -n "$EXTERNAL_KEYSTORE_NAME" ]; then
echo "External custom keystore name key found"
tomcat_keystore_file="${tls_cert_root}/$EXTERNAL_KEYSTORE_NAME"
else
tomcat_keystore_file="${tls_cert_root}/TOMCAT_KEYSTORE_CONTENT"
fi

if [ -n "$EXTERNAL_KEYSTORE_PASSWORD" ]; then
echo "External custom keystore password key found"
tomcat_keystore_password_file="${tls_cert_root}/$EXTERNAL_KEYSTORE_PASSWORD"
else
tomcat_keystore_password_file="${tls_cert_root}/TOMCAT_KEYSTORE_PASSWORD"
fi

if [ -e "$tomcat_keystore_password_file" ]; then
TOMCAT_KEYSTORE_PASSWORD=$(<${tomcat_keystore_password_file})
Expand All @@ -99,6 +110,7 @@ if [ -e "$tomcat_keystore_file" ]; then
else
echo "TLS certificate does not exist"
fi
export TOMCAT_KEYSTORE_CONTENT=$tomcat_keystore_file

# Define the JDBC_URL variable based on inputs
if [ "$JDBC_URL" == "" ]; then
Expand Down
50 changes: 50 additions & 0 deletions tests/pega-web-ready-testcases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2338,3 +2338,53 @@ commandTests:
if [ "$(ls /opt/pega/config | wc -l)" -ne "$(ls /opt/pega/decompressedconfig | wc -l)" ]; then echo "missing files in file_list variable"; fi
exitCode: 0
excludedOutput: [ "missing files in file_list variable" ]

# Verify external custom tomcat keystore
- name: "External Custom Tomcat Keystore files"
envVars:
- key: "JDBC_URL"
value: "jdbc:postgresql://localhost:5432/pegadb"
- key: "JDBC_CLASS"
value: "org.postgresql.Driver"
- key: "DB_USERNAME"
value: "postgres"
- key: "DB_PASSWORD"
value: "postgres"
- key: "RULES_SCHEMA"
value: "rules"
- key: "DATA_SCHEMA"
value: "data"
- key: "EXTERNAL_KEYSTORE_NAME"
value: "keystore.jks"
command: "bash"
args:
- -c
- |
bash -c './scripts/docker-entrypoint.sh'
exitCode: 0
expectedOutput: [ "External custom keystore name key found" ]

# Verify external custom tomcat keystore password key
- name: "External Custom Tomcat Keystore files"
envVars:
- key: "JDBC_URL"
value: "jdbc:postgresql://localhost:5432/pegadb"
- key: "JDBC_CLASS"
value: "org.postgresql.Driver"
- key: "DB_USERNAME"
value: "postgres"
- key: "DB_PASSWORD"
value: "postgres"
- key: "RULES_SCHEMA"
value: "rules"
- key: "DATA_SCHEMA"
value: "data"
- key: "EXTERNAL_KEYSTORE_PASSWORD"
value: "password"
command: "bash"
args:
- -c
- |
bash -c './scripts/docker-entrypoint.sh'
exitCode: 0
expectedOutput: [ "External custom keystore password key found" ]

0 comments on commit 1964fe6

Please sign in to comment.