Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit b2e29087 authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

Update weblogic 12c plan to run without exposing ports

parent 406a9796
No related branches found
No related tags found
No related merge requests found
Pipeline #132562 failed
Showing
with 92 additions and 153 deletions
......@@ -3,7 +3,7 @@ services:
##
## UI Tests
##
testui:
testapi:
image: ${IMAGE_TAG:-edeliverytest}/${IMAGE_SMP_TESTS}:${SMP_VERSION}
environment:
- TEST_PLAN=api
......
version: "3.0"
version: '3.8'
services:
smp-springboot:
image: ${IMAGE_TAG:-edeliverytest}/${IMAGE_SMP_SPRINGBOOT_MYSQL}:${SMP_VERSION}
......
......@@ -7,7 +7,7 @@ initializeVariables
SMP_INIT_DATABASE="${SMP_PROJECT_FOLDER}/smp-webapp/src/main/smp-setup/database-scripts/mysql5innodb.ddl"
#SMP_INIT_DATABASE_DATA="${SMP_PROJECT_FOLDER}/smp-webapp/src/main/smp-setup/database-scripts/mysql5innodb-data.sql"
SMP_INIT_DATABASE_DATA="${SMP_PROJECT_FOLDER}/smp-soapui-tests/groovy/mysql-4.1_integration_test_data.sql"
SMP_INIT_DATABASE_DATA="${SMP_PROJECT_FOLDER}/domismp-tests/domismp-tests-api/groovy/mysql-4.1_integration_test_data.sql"
# READ arguments
while getopts i:v: option
......@@ -16,6 +16,7 @@ do
in
i) SMP_INIT_DATABASE_DATA=${OPTARG};;
v) SMP_VERSION=${OPTARG};;
*) echo "Unknown option [${option}]. Usage: $0 [-i] [-v]"; exit 1;;
esac
done
......
......@@ -7,7 +7,7 @@ initializeVariables
SMP_INIT_DATABASE="${SMP_PROJECT_FOLDER}/smp-webapp/src/main/smp-setup/database-scripts/mysql5innodb.ddl"
#SMP_INIT_DATABASE_DATA="${SMP_PROJECT_FOLDER}/smp-webapp/src/main/smp-setup/database-scripts/mysql5innodb-data.sql"
SMP_INIT_DATABASE_DATA="${SMP_PROJECT_FOLDER}/smp-soapui-tests/groovy/mysql-4.1_integration_test_data.sql"
SMP_INIT_DATABASE_DATA="${SMP_PROJECT_FOLDER}/domismp-tests/domismp-tests-api/groovy/mysql-4.1_integration_test_data.sql"
# READ arguments
while getopts i:v: option
do
......@@ -15,6 +15,7 @@ do
in
i) SMP_INIT_DATABASE_DATA=${OPTARG};;
v) SMP_VERSION=${OPTARG};;
*) echo "Unknown option [${option}]. Usage: $0 [-i] [-v]"; exit 1;;
esac
done
......
.gitignore is excluded when sharing artifacts on bamboo
http://ant.apache.org/manual/dirtasks.html
And we want this folder to be shared in order to keep the project structure.
\ No newline at end of file
# Ignore everything in this directory
..
# Except the following
!.gitignore
!.disable_default_excludes
\ No newline at end of file
.gitignore is excluded when sharing artifacts on bamboo
http://ant.apache.org/manual/dirtasks.html
And we want this folder to be shared in order to keep the project structure.
\ No newline at end of file
# Ignore everything in this directory
..
# Except the following
!.gitignore
!.disable_default_excludes
\ No newline at end of file
.gitignore is excluded when sharing artifacts on bamboo
http://ant.apache.org/manual/dirtasks.html
And we want this folder to be shared in order to keep the project structure.
\ No newline at end of file
# Ignore everything in this directory
..
# Except the following
!.gitignore
!.disable_default_excludes
\ No newline at end of file
.gitignore is excluded when sharing artifacts on bamboo
http://ant.apache.org/manual/dirtasks.html
And we want this folder to be shared in order to keep the project structure.
\ No newline at end of file
# Ignore everything in this directory
..
# Except the following
!.gitignore
!.disable_default_excludes
\ No newline at end of file
.gitignore is excluded when sharing artifacts on bamboo
http://ant.apache.org/manual/dirtasks.html
And we want this folder to be shared in order to keep the project structure.
\ No newline at end of file
# Ignore everything in this directory
..
# Except the following
!.gitignore
!.disable_default_excludes
\ No newline at end of file
version: '3.8'
services:
##
## API Tests
##
testapi:
image: ${IMAGE_TAG:-edeliverytest}/${IMAGE_SMP_TESTS}:${SMP_VERSION}
environment:
- TEST_PLAN=api
- TEST_URL=http://smp-httpd/smp/
networks:
- test-network
networks:
test-network:
external:
name: ${DOCKER_NETWORK_NAME:-domismp-tomcat-mysql_default}
version: "3.0"
version: "3.8"
services:
smp-oracle-db:
# image: container-registry.oracle.com/database/express:21.3.0-xe
image: ${IMAGE_TAG:-edeliverytest}/${IMAGE_SMP_DB_ORACLE}-${ORA_VERSION}-${ORA_EDITION}:${SMP_VERSION}
hostname: smp-database.local
hostname: smp-oracle-db
shm_size: '1gb'
environment:
- ORACLE_CHARACTERSET=AL32UTF8 # set database encoding
- NLS_LANG=.AL32UTF8 # set sqlplus encoding for starting up scripts
volumes:
- ./properties/db-scripts:/docker-entrypoint-initdb.d/startup # init script.
- ./status-folder:/u01/status/
ports:
- 1921:1521
shm_size: '1gb'
#ports:
# - 1921:1521
smp-wls-admin:
depends_on:
- smp-oracle-db
command: [bash, -c, "rm -rf /u01/status/wls-admin.started;for i in `seq 150`; do timeout 1 bash -c 'echo \" $$(ls /u01/status/)\"'; if [ -f '/u01/status/database.status' ] && [ \"$$( cat /u01/status/database.status )\" == 'DATABASE IS READY TO USE!' ] ; then break;fi; echo \"$$i. Wait for database!\"; sleep 10; done; /u01/oracle/startAdminServer.sh"]
image: ${IMAGE_TAG:-edeliverytest}/${IMAGE_SMP_WEBLOGIC122}:${SMP_VERSION}
hostname: smp-wls-admin
depends_on:
smp-oracle-db:
condition: service_healthy
environment:
- JAVA_OPTIONS="-Dweblogic.webservice.i18n.charset=utf-8"
- WL_START_ADMIN=true
- WL_PRODUCTION_MODE_ENABLED=true # to enable production deployment
- WL_DEPLOYMENT_TARGET=smp-cluster
ports:
- 7901:7001
volumes:
- ./properties/weblogic-init:/u01/init/
- ./data:/data
- ./status-folder:/u01/status/
# ports:
# - 7901:7001
smp-node-01:
# depend of the startup of the db
image: ${IMAGE_TAG:-edeliverytest}/${IMAGE_SMP_WEBLOGIC122}:${SMP_VERSION}
depends_on:
- smp-wls-admin
command: [bash, -c, "for i in `seq 200`; do timeout 1 bash -c 'echo \" $$(ls /u01/status/)\"'; if [ -f '/u01/status/wls-admin.started' ] ; then break;fi; echo \"$$i. Wait for admin server!\"; sleep 10; done; /u01/oracle/startManagedServer.sh"]
smp-wls-admin:
condition: service_healthy
environment:
- WL_START_ADMIN=false
- WL_ADMIN_HOST=smp-wls-admin
- WL_MANAGED_SERV_NAME=smp-node-1
image: ${IMAGE_TAG:-edeliverytest}/${IMAGE_SMP_WEBLOGIC122}:${SMP_VERSION}
# ports:
# - "18453:8453"
# - "18001:8001"
volumes:
- ./data:/data
- ./status-folder:/u01/status/
# - ./status-folder:/u01/status/
# ports:
# - "19453:8453"
# - "19001:8001"
smp-node-02:
# depend of the startup of the db
image: ${IMAGE_TAG:-edeliverytest}/${IMAGE_SMP_WEBLOGIC122}:${SMP_VERSION}
depends_on:
- smp-wls-admin
command: [bash, -c, "for i in `seq 200`; do timeout 1 bash -c 'echo \" $$(ls /u01/status/)\"'; if [ -f '/u01/status/wls-admin.started' ] ; then break;fi; echo \"$$i. Wait for admin server!\"; sleep 10; done; /u01/oracle/startManagedServer.sh"]
smp-wls-admin:
condition: service_healthy
command: [bash, -c, "/u01/oracle/startServer.sh"]
environment:
- WL_START_ADMIN=false
- WL_ADMIN_HOST=smp-wls-admin
- WL_MANAGED_SERV_NAME=smp-node-2
- WL_DELAY_STARTUP_IN_S=20 # delay startup to allow node 01 to initialize the database, truststore and keystore
image: ${IMAGE_TAG:-edeliverytest}/${IMAGE_SMP_WEBLOGIC122}:${SMP_VERSION}
# ports:
# - "18453:8453"
# - "18001:8001"
volumes:
- ./data:/data
- ./status-folder:/u01/status/
# ports:
# - "19454:8453"
# - "19002:8001"
smp-httpd:
image: ${IMAGE_TAG:-edeliverytest}/smp-httpd:${SMP_VERSION}
depends_on:
- smp-node-01
- smp-node-02
image: ${IMAGE_TAG:-edeliverytest}/smp-httpd:${SMP_VERSION}
environment:
- VHOST_CORNER_HOSTNAME=smp.edelivery.eu
- NODES_COUNT=2
- NODE_HOSTNAMES=smp-node-01,smp-node-02
- NODE_PORT_NUMBERS=8001,8001
- AllowEncodedSlashes=NoDecode
ports:
- "7980:80"
restart: always
#ports:
# - "7980:80"
dsname=eDeliverySmpDs
dsdbname=eDeliverySmpDs
dsjndiname=jdbc/eDeliverySmpDs
dsdriver=oracle.jdbc.OracleDriver
dsurl=jdbc:oracle:thin:@//smp-oracle-db:1521/xe
dsusername=smp
dspassword=test
dstestquery=SQL SELECT 1 FROM DUAL
#!/usr/bin/env bash
#!/bin/bash
# This is build script clean starting the docker compose containers for weblogic and oracle db integration tests.
# The script is used for local development and CI integration testing only.
......@@ -13,9 +13,7 @@ initializeVariables
SMP_INIT_DATABASE="${SMP_PROJECT_FOLDER}/smp-webapp/src/main/smp-setup/database-scripts/oracle10g.ddl"
#SMP_INIT_DATABASE_DATA="${SMP_PROJECT_FOLDER}/smp-webapp/src/main/smp-setup/database-scripts/oracle10g-data.sql"
SMP_INIT_DATABASE_DATA="${SMP_PROJECT_FOLDER}/smp-soapui-tests/groovy/oracle-4.1_integration_test_data.sql"
# soap ui data
SMP_VERSION=
SMP_INIT_DATABASE_DATA="${SMP_PROJECT_FOLDER}/domismp-tests/domismp-tests-api/groovy/oracle-4.1_integration_test_data.sql"
#ORA_VERSION="19.3.0"
......@@ -28,7 +26,10 @@ ORA_SERVICE="xe"
SMP_DB_USERNAME="smp"
SMP_DB_PASSWORD="test"
# this is JDBC URL for SMP application, the hostname must match the one from docker-compose.yml for database service
SMP_JDBC_URL="jdbc:oracle:thin:@//smp-oracle-db:1521/${ORA_SERVICE}"
SMP_DB_SCRIPTS=./properties/db-scripts
SMP_WLS_INIT_SCRIPTS=./properties/weblogic-init
# READ arguments
while getopts i:v: option
......@@ -37,12 +38,10 @@ do
in
i) SMP_INIT_DATABASE_DATA=${OPTARG};;
v) SMP_VERSION=${OPTARG};;
*) echo "Unknown option [${option}].\nUsage: $0 [-i] [-v]"; exit 1;;
*) echo "Unknown option [${option}]. Usage: $0 [-i] [-v]"; exit 1;;
esac
done
discoverApplicationVersion
echo "*************************************************************************"
echo "SMP version: $SMP_VERSION"
echo "Init sql data: ${SMP_INIT_DATABASE_DATA}"
......@@ -50,64 +49,22 @@ echo "Working Directory: ${WORKDIR}"
echo "*************************************************************************"
cd "$WORKDIR" || exit 1
echo "Create folder (if not exist) for database scripts ${SMP_DB_SCRIPTS}"
[ -d ${SMP_DB_SCRIPTS} ] || mkdir -p "${SMP_DB_SCRIPTS}"
function createDatabaseSchemaForUser() {
echo "Clear file [$3] to recreate schema for user creation!"
echo "" > "$3"
echo "Create database schema/user: $1"
if [ -n "$ORACLE_PDB" ]; then
echo "ALTER SESSION SET CONTAINER=$ORACLE_PDB;" >>"$3"
fi
{
# magic with double quotes - first end " then put '"' and then add variable to "$Var" and repeat the stuff :)
echo "CREATE USER $1 IDENTIFIED BY "'"'"$2"'"'" DEFAULT TABLESPACE users QUOTA UNLIMITED ON users; "
echo "GRANT CREATE SESSION TO $1;"
echo "GRANT CREATE TABLE TO $1;"
echo "GRANT CREATE VIEW TO $1;"
echo "GRANT CREATE SEQUENCE TO $1;"
echo "GRANT SELECT ON PENDING_TRANS$ TO $1;"
echo ""
} >>"$3"
}
# clear old containers mounted volume ./data
function clearMoundDataVolume() {
: "${$WORKDIR?"Need to set $WORKDIR non-empty!"}"
: "${WORKDIR?"Need to set $WORKDIR non-empty!"}"
: "${SMP_DB_SCRIPTS?"Need to set SMP_DB_SCRIPTS non-empty!"}"
echo "Clear container data ${WORKDIR}/data/"
rm -rf ${WORKDIR}/data
rm -rf "${WORKDIR}/data"
rm -rf "${SMP_DB_SCRIPTS}"
mkdir -p ${WORKDIR}/data/upload
mkdir -p ${WORKDIR}/data/smp/config
mkdir -p ${WORKDIR}/data/smp/security
mkdir -p ${WORKDIR}/data/weblogic/keystores
# create database init scripts
mkdir -p "${SMP_DB_SCRIPTS}"
}
clearMoundDataVolume
createDatabaseSchemaForUser $SMP_DB_USERNAME $SMP_DB_PASSWORD "${SMP_DB_SCRIPTS}/01_create_user.sql"
# create database init script from
echo "CONNECT ${SMP_DB_USERNAME}/${SMP_DB_PASSWORD}@//localhost:1521/${ORA_SERVICE};" > "${SMP_DB_SCRIPTS}/02_oracle10g.sql"
cat "${SMP_INIT_DATABASE}" >> "${SMP_DB_SCRIPTS}/02_oracle10g.sql"
# copy init database data for SMP
if [ ! -f "${SMP_INIT_DATABASE_DATA}" ]
then
echo "SMP sql init data '${SMP_INIT_DATABASE_DATA} not found!!"
exit 1;
else
# copy artefact to docker build folder
echo "CONNECT ${SMP_DB_USERNAME}/${SMP_DB_PASSWORD}@//localhost:1521/${ORA_SERVICE};" > "${SMP_DB_SCRIPTS}/03_oracle10g-data.sql"
cat "${SMP_INIT_DATABASE_DATA}" >> "${SMP_DB_SCRIPTS}/03_oracle10g-data.sql"
fi
# Because statuses are synchronized through folder: ./status-folder it could contain a state from a previous start.
# Set content of the file database.status to "Database starting"!
echo "Database starting" > ./status-folder/database.status
clearOldContainers
# start
# start
export SMP_VERSION
export ORA_VERSION
export ORA_EDITION
......@@ -115,11 +72,9 @@ export SMP_VERSION
echo "Clear old containers"
stopAndClearTestContainers
clearMoundDataVolume
initOracleDatabaseConfiguration $SMP_DB_USERNAME $SMP_DB_PASSWORD "${SMP_DB_SCRIPTS}" "${SMP_WLS_INIT_SCRIPTS}"
# start "
echo "Start containers"
startTestContainers
# wait until service is up
for i in `seq 200`; do timeout 10 bash -c ' curl --silent --fail http://localhost:7980/smp/'; if [ $? -eq 0 ] ; then break;fi; echo "$i. Wait for weblogic to start!"; sleep 10; done;
#!/bin/bash
# init plan variables
WORKDIR="$(cd -P $(dirname "${BASH_SOURCE[0]}" ) && pwd)"
source "${WORKDIR}/../../functions/run-test.functions"
initializeVariables
RESULT_FOLDER="${WORKDIR}/results"
# clear old results
rm -rf "${RESULT_FOLDER}"
mkdir -p "${RESULT_FOLDER}"
# define network to connect the tests
DOCKER_NETWORK_NAME="${PLAN_PREFIX}_default"
export DOCKER_NETWORK_NAME
# Starting Docker Compose TEST (in specific project to avoid orphan container warning)
docker compose -f docker-compose.test-api.yml -p "run-${PLAN_PREFIX}" up
docker cp "run-${PLAN_PREFIX}-testapi-1:/data/results/soapui-reports" ./results
version: "3.0"
version: "3.8"
services:
smp-oracle-db:
image: ${IMAGE_TAG:-edeliverytest}/${IMAGE_SMP_DB_ORACLE}-${ORA_VERSION}-${ORA_EDITION}:${SMP_VERSION}
......@@ -59,8 +59,8 @@ services:
volumes:
- ./data:/data
# ports:
# - "18453:8453"
# - "18001:8001"
# - "18454:8453"
# - "18002:8001"
smp-httpd:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment