Skip to content

4.4.1 #9

Merged
merged 17 commits into from Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 0 additions & 19 deletions Dockerfile
Expand Up @@ -45,7 +45,6 @@ RUN cp /dev/null /etc/httpd/conf.d/ssl.conf \

# Build arguments

ARG MP_VERSION=4.0.1
ARG MP_DIST_FILE=midpoint-dist.tar.gz

ENV MP_DIR /opt/midpoint
Expand All @@ -62,31 +61,13 @@ RUN echo 'Extracting midPoint archive...' \
# TODO: consider all the consequences
#VOLUME ${MP_DIR}/var

# Repository parameters

ENV REPO_DATABASE_TYPE mariadb
ENV REPO_JDBC_URL default
ENV REPO_HOST midpoint_data
ENV REPO_PORT default
ENV REPO_DATABASE registry
ENV REPO_USER registry_user
ENV REPO_PASSWORD_FILE /run/secrets/mp_database_password.txt
ENV REPO_MISSING_SCHEMA_ACTION create
ENV REPO_UPGRADEABLE_SCHEMA_ACTION stop

# Logging parameters

ENV ENV demo
ENV USERTOKEN ""

# Authentication/web

ENV AJP_ENABLED true
ENV AJP_PORT 9090

# Other parameters

ENV MP_KEYSTORE_PASSWORD_FILE /run/secrets/mp_keystore_password.txt
ENV MP_MEM_MAX 2048m
ENV MP_MEM_INIT 1024m
ENV TIMEZONE UTC
Expand Down
20 changes: 12 additions & 8 deletions Jenkinsfile
Expand Up @@ -11,11 +11,7 @@ pipeline {
script {
maintainer = maintain()
imagename = imagename()
if (env.BRANCH_NAME == "master") {
tag = "latest"
} else {
tag = env.BRANCH_NAME
}
tag = tag()
if (!imagename) {
echo "You must define imagename in common.bash"
currentBuild.result = 'FAILURE'
Expand Down Expand Up @@ -60,7 +56,6 @@ pipeline {

sh '(cd demo/simple ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
sh '(cd demo/shibboleth ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
sh '(cd demo/postgresql ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
sh '(cd demo/grouper ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
} catch (error) {
def error_details = readFile('./debug')
Expand All @@ -74,9 +69,13 @@ pipeline {
stage ('Push') {
steps {
script {
docker.withRegistry('https://registry.hub.docker.com/', "dockerhub-$maintainer") {
def baseImg = docker.build("$maintainer/$imagename")
docker.withRegistry('https://registry.hub.docker.com/', "dockerhub-tier") {
def baseImg = docker.image("$maintainer/$imagename:$tag")
baseImg.push("$tag")

if (env.BRANCH_NAME == "master") {
baseImg.push("latest")
}
}
}
}
Expand Down Expand Up @@ -110,6 +109,11 @@ def imagename() {
matcher ? matcher[0][1] : null
}

def tag() {
def matcher = readFile('common.bash') =~ 'tag="(.+)"'
matcher ? matcher[0][1] : latest
}

def handleError(String message) {
echo "${message}"
currentBuild.setResult("FAILED")
Expand Down
4 changes: 2 additions & 2 deletions common.bash
@@ -1,3 +1,3 @@
maintainer="tier"
maintainer="i2incommon"
imagename="midpoint"
tag="latest"
tag="4.4.1"
40 changes: 7 additions & 33 deletions container_files/usr-local-bin/start-midpoint.sh
Expand Up @@ -25,37 +25,11 @@ done
check MP_MEM_MAX
check MP_MEM_INIT
check MP_DIR
check REPO_DATABASE_TYPE
check REPO_USER
check REPO_PASSWORD_FILE
check REPO_MISSING_SCHEMA_ACTION
check REPO_UPGRADEABLE_SCHEMA_ACTION
check MP_KEYSTORE_PASSWORD_FILE
check AJP_ENABLED
check AJP_PORT

java -Xmx$MP_MEM_MAX -Xms$MP_MEM_INIT -Dfile.encoding=UTF8 \
-Dmidpoint.home=$MP_DIR/var \
-Dmidpoint.repository.database=$REPO_DATABASE_TYPE \
-Dmidpoint.repository.jdbcUsername=$REPO_USER \
-Dmidpoint.repository.jdbcPassword_FILE=$REPO_PASSWORD_FILE \
-Dmidpoint.repository.jdbcUrl="`$MP_DIR/repository-url`" \
-Dmidpoint.repository.hibernateHbm2ddl=none \
-Dmidpoint.repository.missingSchemaAction=$REPO_MISSING_SCHEMA_ACTION \
-Dmidpoint.repository.upgradeableSchemaAction=$REPO_UPGRADEABLE_SCHEMA_ACTION \
$(if [ -n "$REPO_SCHEMA_VERSION_IF_MISSING" ]; then echo "-Dmidpoint.repository.schemaVersionIfMissing=$REPO_SCHEMA_VERSION_IF_MISSING"; fi) \
$(if [ -n "$REPO_SCHEMA_VARIANT" ]; then echo "-Dmidpoint.repository.schemaVariant=$REPO_SCHEMA_VARIANT"; fi) \
-Dmidpoint.repository.initializationFailTimeout=60000 \
-Dmidpoint.keystore.keyStorePassword_FILE=$MP_KEYSTORE_PASSWORD_FILE \
-Dmidpoint.logging.alt.enabled=true \
-Dmidpoint.logging.alt.filename=/tmp/logmidpoint \
-Dspring.profiles.active="`$MP_DIR/active-spring-profiles`" \
-Dserver.tomcat.ajp.enabled=$AJP_ENABLED \
-Dserver.tomcat.ajp.port=$AJP_PORT \
-Dserver.tomcat.ajp.secret=s3cr3t \
-Dlogging.path=/tmp/logtomcat \
-cp $MP_DIR/lib/midpoint.war \
-Dloader.path="WEB-INF/classes,WEB-INF/lib,WEB-INF/lib-provided,$MP_DIR/var/lib" \
org.springframework.boot.loader.PropertiesLauncher \
$MP_JAVA_OPTS \
-jar $MP_DIR/lib/midpoint.war &>/tmp/logmidpoint-console

export MP_SET_midpoint_logging_alt_enabled=true
export MP_SET_midpoint_logging_alt_filename=/tmp/logmidpoint
export MP_SET_spring_profiles_active="`$MP_DIR/active-spring-profiles`"
export MP_SET_logging_path=/tmp/logtomcat

/opt/midpoint/bin/midpoint.sh 'container' &>/tmp/logmidpoint-console
10 changes: 0 additions & 10 deletions demo/extrepo/.env

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions demo/extrepo/configs-and-secrets/midpoint/httpd/host-cert.pem

This file was deleted.

28 changes: 0 additions & 28 deletions demo/extrepo/configs-and-secrets/midpoint/httpd/host-key.pem

This file was deleted.

54 changes: 0 additions & 54 deletions demo/extrepo/docker-compose.yml

This file was deleted.

8 changes: 0 additions & 8 deletions demo/grouper/.env
@@ -1,12 +1,4 @@
ENV=demo
REPO_DATABASE_TYPE=mariadb
REPO_JDBC_URL=default
REPO_HOST=midpoint_data
REPO_PORT=default
REPO_DATABASE=registry
REPO_USER=registry_user
REPO_MISSING_SCHEMA_ACTION=create
REPO_UPGRADEABLE_SCHEMA_ACTION=stop
MP_MEM_MAX=2048m
MP_MEM_INIT=1024m
TIMEZONE=UTC

This file was deleted.

This file was deleted.