From b5dd760aa4ba361edbcf3e641a2f64dfda27b19e Mon Sep 17 00:00:00 2001 From: villadalmine Date: Tue, 13 Sep 2016 20:16:58 -0300 Subject: [PATCH 01/16] Added more control for configure shib and httpd. Changed the variable for fqdn comanage in shibboleth2.xml --- container_files/bin/configure_httpd.sh | 7 ++++++- container_files/bin/configure_shibd.sh | 13 ++++++++++--- container_files/etc/shibboleth/shibboleth2.xml | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/container_files/bin/configure_httpd.sh b/container_files/bin/configure_httpd.sh index c864f20..3f025b7 100755 --- a/container_files/bin/configure_httpd.sh +++ b/container_files/bin/configure_httpd.sh @@ -3,16 +3,21 @@ log="/tmp/httpd.log" date >> $log echo "Configuring httpd: " >> $log - +echo "Parsing COMANAGE_SERVER_FQDN to $COMANAGE_SERVER_FQDN in virtualhost 80 and 443" >> $log sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/httpd/conf.d/virtual_host_80.conf >> $log sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log +echo "virtualhost parsed" >> $log if [[ $CHANGE_TO_SSL_HTTPD_KEY && ${CHANGE_TO_SSL_HTTPD_KEY-x} ]]; then + echo "Parsing CHANGE_TO_SSL_HTTPD_KEY to $CHANGE_TO_SSL_HTTPD_KEY in virtual host 443" >> $log sed -i "s|CHANGE_TO_SSL_HTTPD_KEY|$CHANGE_TO_SSL_HTTPD_KEY|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log + echo "key parsed in virtualhost 443" >> $log else echo "CHANGE_TO_SSL_HTTPD_KEY variable is not used" >> $log fi if [[ $CHANGE_TO_SSL_HTTPD_CERT && ${CHANGE_TO_SSL_HTTPD_CERT-x} ]]; then + echo "Parsing CHANGE_TO_SSL_HTTPD_CERT to $CHANGE_TO_SSL_HTTPD_CERT in virtualhost 443" >> $log sed -i "s|CHANGE_TO_SSL_HTTPD_CERT|$CHANGE_TO_SSL_HTTPD_CERT|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log + echo "httpd cert parsed in virtualhost 443" >> $log else echo "CHANGE_TO_SSL_HTTPD_CERT variable is not used" >> $log fi diff --git a/container_files/bin/configure_shibd.sh b/container_files/bin/configure_shibd.sh index fa698f4..b886c25 100755 --- a/container_files/bin/configure_shibd.sh +++ b/container_files/bin/configure_shibd.sh @@ -1,7 +1,14 @@ #!/bin/bash log="/tmp/shibd.log" - +date >> $log echo "Configuring shibd: " > $log - - +if [[ $COMANAGE_SERVER_FQDN && ${COMANAGE_SERVER_FQDN-x} ]]; then + echo "Parsing COMANAGE_SERVER_FQDN to $COMANAGE_SERVER_FQDN in /etc/opt/shibboleth/shibboleth2.xml" >> $log + sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/shibboleth/shibboleth2.xml + echo "shibboleth2.xml parsed" >> $log +else + echo "Variable COMANAGE_SERVER_FQDN not found" +fi +echo "Shibboleth xml parsing finish" +date >> $log diff --git a/container_files/etc/shibboleth/shibboleth2.xml b/container_files/etc/shibboleth/shibboleth2.xml index ab4445c..3dd9a9b 100644 --- a/container_files/etc/shibboleth/shibboleth2.xml +++ b/container_files/etc/shibboleth/shibboleth2.xml @@ -5,13 +5,13 @@ xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" clockSkew="180"> - - + SAML2 From 8bb5c9553f96a3a2e9fc80b27b96cb94c58a6890 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Tue, 13 Sep 2016 20:32:37 -0300 Subject: [PATCH 02/16] Added main.sh if comanage were composed --- container_files/bin/start.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh index c778966..174489a 100755 --- a/container_files/bin/start.sh +++ b/container_files/bin/start.sh @@ -43,7 +43,19 @@ else echo "Database Connection with $MYSQL_USER to database $MYSQL_DATABASE was completed without any error" >> $log echo "Database Connection with $MYSQL_USER to database $MYSQL_DATABASE was completed without any error" date >> $log - echo "Starting apache and shibd" >>$log - echo "Starting apache shibd" - /usr/local/bin/httpd-shib-foreground + /opt/bin/main.sh + laststatus="$?" + echo "main.sh last status: $laststatus" + if [ "$laststatus" != "0" ]; then + echo "composed non-zero exit status: $laststatus" >> $log + echo "composed non-zero exit status: $laststatus" + exit 1 + else + date >> $log + echo "COmanage was configured" >>$log + echo "COmanage was configured" + echo "Starting apache and shibd" >>$log + echo "Starting apache shibd" + /usr/local/bin/httpd-shib-foreground + fi fi From 1be79b79ae13de250c6621933b8d1e06e1cb3f42 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Tue, 13 Sep 2016 20:34:37 -0300 Subject: [PATCH 03/16] Added log to correct place --- container_files/bin/configure_shibd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/container_files/bin/configure_shibd.sh b/container_files/bin/configure_shibd.sh index b886c25..a76961f 100755 --- a/container_files/bin/configure_shibd.sh +++ b/container_files/bin/configure_shibd.sh @@ -8,7 +8,7 @@ if [[ $COMANAGE_SERVER_FQDN && ${COMANAGE_SERVER_FQDN-x} ]]; then sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/shibboleth/shibboleth2.xml echo "shibboleth2.xml parsed" >> $log else - echo "Variable COMANAGE_SERVER_FQDN not found" + echo "Variable COMANAGE_SERVER_FQDN not found" >> $log fi -echo "Shibboleth xml parsing finish" +echo "Shibboleth xml parsing finish" >> $log date >> $log From ba60abe3b256d08878ba1d311a91ca6991da1ad3 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 08:37:15 -0300 Subject: [PATCH 04/16] Added test commit --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index abdae5e..ce71a31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -100,6 +100,7 @@ RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf RUN ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf RUN ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf + # Port EXPOSE 80 443 From 56a1cfa33bf4996f149a55852c4585a30a54ea50 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 08:55:11 -0300 Subject: [PATCH 05/16] Added cleanup.sh remove firsttimerunning --- container_files/bin/cleanup.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/container_files/bin/cleanup.sh b/container_files/bin/cleanup.sh index a9bf588..183ddb4 100755 --- a/container_files/bin/cleanup.sh +++ b/container_files/bin/cleanup.sh @@ -1 +1,11 @@ #!/bin/bash + +log=/tmp/cleanup.log + +date >> $log + +echo "Cleaning firsttimerunning" >> $log + +rm /tmp/firsttimerunning + + From ade81b5bfb5187eb7e7a96cd6d7d30fe3ebe54c9 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 09:33:25 -0300 Subject: [PATCH 06/16] Added files in Dockerfile in order to add php config files --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index ce71a31..af7747f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -100,6 +100,12 @@ RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf RUN ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf RUN ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf +#Add php Configuration +RUN ln -s /opt/etc/php/EmailSheel.php /opt/comanage/comanage-registry-$version/app/Console/Command/EmailSheel.php +RUN ln -s /opt/etc/php/database.php /opt/comanage/comanage-registry-$version/local/Config/database.php +RUN rm -f /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/database.php /opt/comanage/comanage-registry-$version/app/Config/database.php +RUN ln -s /opt/etc/php/email.php /opt/comanage/comanage-registry-$version/local/Config/email.php +RUN rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php && ln -s /opt/etc/php/email.php /opt/comanage/comanage-registry-$version/app/Config/email.php # Port EXPOSE 80 443 From c91f3f74518f5ee98eb0cca312f927b73b7120e1 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 09:45:14 -0300 Subject: [PATCH 07/16] Change order of configure.sh --- container_files/bin/configure.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/container_files/bin/configure.sh b/container_files/bin/configure.sh index afc0de0..1192411 100755 --- a/container_files/bin/configure.sh +++ b/container_files/bin/configure.sh @@ -2,8 +2,9 @@ /opt/bin/configure_httpd.sh +/opt/bin/configure_shibd.sh + /opt/bin/configure_php.sh -/opt/bin/configure_shibd.sh From 35e2d7b002b4d720dba4ad7ec1551d4dca69a44d Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 16:02:15 -0300 Subject: [PATCH 08/16] Added first variables values --- container_files/bin/configure_php.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh index 0a8ecd1..3bfa32f 100755 --- a/container_files/bin/configure_php.sh +++ b/container_files/bin/configure_php.sh @@ -1,7 +1,23 @@ #!/bin/bash log="/tmp/php.log" +date >> $log +echo "Configuring php: " >> $log -echo "Configuring php: " > $log +echo " " >> $log +echo "Checking variables before configuring config files " >> $log +if [[ $MYSQL_HOST && ${MYSQL_HOST-x} ]] && [[ $MYSQL_USER && ${MYSQL_USER-x} ]] && [[ $MYSQL_PASSWORD && ${MYSQL_PASSWORD-x} ]] && [[ $MYSQL_DATABASE && ${MYSQL_DATABASE-x} ]] && [[ $COMANAGE_MAIL_FROM && ${COMANAGE_MAIL_FROM-x} ]] && [[ $COMANAGE_MAIL_HOST && ${COMANAGE_MAIL_HOST-x} ]] && [[ $COMANAGE_MAIL_PORT && ${COMANAGE_MAIL_PORT-x} ]] && [[ $COMANAGE_MAIL_USER && ${COMANAGE_MAIL_USER-x} ]] && [[ $COMANAGE_MAIL_PASS && ${COMANAGE_MAIL_PASS-x} ]]; then + sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_HOST|g" /opt/etc/php/database.php + sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_USER|g" /opt/etc/php/database.php + sed -i "s|CHANGE_TO_ENV_MYSQL_PASSWORD|$MYSQL_PASSWORD/g" /opt/etc/php/database.php + sed -i "s|CHANGE_TO_ENV_MYSQL_TABLE|$MYSQL_DATABASE/g" /opt/etc/php/database.php + sed -i "s|CHANGE_TO_COMANAGE_MAIL_FROM|$COMANAGE_MAIL_FROM|g" /opt/etc/php/email.php + sed -i "s|CHANGE_TO_COMANAGE_MAIL_HOST|$COMANAGE_MAIL_HOST|g" /opt/etc/php/email.php + sed -i "s|CHANGE_TO_COMANAGE_MAIL_PORT|$COMANAGE_MAIL_PORT|g" /opt/etc/php/email.php + sed -i "s|CHANGE_TO_COMANAGE_MAIL_USER|$COMANAGE_MAIL_USER|g" /opt/etc/php/email.php + sed -i "s|CHANGE_TO_COMANAGE_MAIL_PASS|$COMANAGE_MAIL_PASS|g" /opt/etc/php/email.php +else + echo "Variables are not totally filled so no configuration was performed" >> $log +fi From 96401057bf8ea48f17736f44f3e97d05dec396fa Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 16:10:17 -0300 Subject: [PATCH 09/16] Added more log --- container_files/bin/configure_php.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh index 3bfa32f..6540767 100755 --- a/container_files/bin/configure_php.sh +++ b/container_files/bin/configure_php.sh @@ -17,7 +17,9 @@ if [[ $MYSQL_HOST && ${MYSQL_HOST-x} ]] && [[ $MYSQL_USER && ${MYSQL_USER-x} ] sed -i "s|CHANGE_TO_COMANAGE_MAIL_PORT|$COMANAGE_MAIL_PORT|g" /opt/etc/php/email.php sed -i "s|CHANGE_TO_COMANAGE_MAIL_USER|$COMANAGE_MAIL_USER|g" /opt/etc/php/email.php sed -i "s|CHANGE_TO_COMANAGE_MAIL_PASS|$COMANAGE_MAIL_PASS|g" /opt/etc/php/email.php + echo "Variables process was completed without any error" >> $log else echo "Variables are not totally filled so no configuration was performed" >> $log fi +date >> $log From dd1dc62eb4ee12c71d9802b146d34a758110fc0c Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 16:27:10 -0300 Subject: [PATCH 10/16] typo in sed --- container_files/bin/configure_php.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh index 6540767..b0ed008 100755 --- a/container_files/bin/configure_php.sh +++ b/container_files/bin/configure_php.sh @@ -10,8 +10,8 @@ echo "Checking variables before configuring config files " >> $log if [[ $MYSQL_HOST && ${MYSQL_HOST-x} ]] && [[ $MYSQL_USER && ${MYSQL_USER-x} ]] && [[ $MYSQL_PASSWORD && ${MYSQL_PASSWORD-x} ]] && [[ $MYSQL_DATABASE && ${MYSQL_DATABASE-x} ]] && [[ $COMANAGE_MAIL_FROM && ${COMANAGE_MAIL_FROM-x} ]] && [[ $COMANAGE_MAIL_HOST && ${COMANAGE_MAIL_HOST-x} ]] && [[ $COMANAGE_MAIL_PORT && ${COMANAGE_MAIL_PORT-x} ]] && [[ $COMANAGE_MAIL_USER && ${COMANAGE_MAIL_USER-x} ]] && [[ $COMANAGE_MAIL_PASS && ${COMANAGE_MAIL_PASS-x} ]]; then sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_HOST|g" /opt/etc/php/database.php sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_USER|g" /opt/etc/php/database.php - sed -i "s|CHANGE_TO_ENV_MYSQL_PASSWORD|$MYSQL_PASSWORD/g" /opt/etc/php/database.php - sed -i "s|CHANGE_TO_ENV_MYSQL_TABLE|$MYSQL_DATABASE/g" /opt/etc/php/database.php + sed -i "s|CHANGE_TO_ENV_MYSQL_PASSWORD|$MYSQL_PASSWORD|g" /opt/etc/php/database.php + sed -i "s|CHANGE_TO_ENV_MYSQL_TABLE|$MYSQL_DATABASE|g" /opt/etc/php/database.php sed -i "s|CHANGE_TO_COMANAGE_MAIL_FROM|$COMANAGE_MAIL_FROM|g" /opt/etc/php/email.php sed -i "s|CHANGE_TO_COMANAGE_MAIL_HOST|$COMANAGE_MAIL_HOST|g" /opt/etc/php/email.php sed -i "s|CHANGE_TO_COMANAGE_MAIL_PORT|$COMANAGE_MAIL_PORT|g" /opt/etc/php/email.php From 3c3569385b606f3b80c1f0c9c0aa37d76897fbb7 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 16:29:07 -0300 Subject: [PATCH 11/16] Changed variable --- container_files/bin/configure_php.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh index b0ed008..6a5ab89 100755 --- a/container_files/bin/configure_php.sh +++ b/container_files/bin/configure_php.sh @@ -9,7 +9,7 @@ echo "Checking variables before configuring config files " >> $log if [[ $MYSQL_HOST && ${MYSQL_HOST-x} ]] && [[ $MYSQL_USER && ${MYSQL_USER-x} ]] && [[ $MYSQL_PASSWORD && ${MYSQL_PASSWORD-x} ]] && [[ $MYSQL_DATABASE && ${MYSQL_DATABASE-x} ]] && [[ $COMANAGE_MAIL_FROM && ${COMANAGE_MAIL_FROM-x} ]] && [[ $COMANAGE_MAIL_HOST && ${COMANAGE_MAIL_HOST-x} ]] && [[ $COMANAGE_MAIL_PORT && ${COMANAGE_MAIL_PORT-x} ]] && [[ $COMANAGE_MAIL_USER && ${COMANAGE_MAIL_USER-x} ]] && [[ $COMANAGE_MAIL_PASS && ${COMANAGE_MAIL_PASS-x} ]]; then sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_HOST|g" /opt/etc/php/database.php - sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_USER|g" /opt/etc/php/database.php + sed -i "s|CHANGE_TO_ENV_MYSQL_USERNAME|$MYSQL_USER|g" /opt/etc/php/database.php sed -i "s|CHANGE_TO_ENV_MYSQL_PASSWORD|$MYSQL_PASSWORD|g" /opt/etc/php/database.php sed -i "s|CHANGE_TO_ENV_MYSQL_TABLE|$MYSQL_DATABASE|g" /opt/etc/php/database.php sed -i "s|CHANGE_TO_COMANAGE_MAIL_FROM|$COMANAGE_MAIL_FROM|g" /opt/etc/php/email.php From 30e1a89d9342f6207c7504b1f52e3f66850736bb Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 17:36:04 -0300 Subject: [PATCH 12/16] ADded other script to use variables --- Dockerfile | 3 ++ container_files/bin/configure_php.sh | 37 +++++++++++++++++++++++ container_files/bin/configure_php_user.sh | 7 +++++ 3 files changed, 47 insertions(+) create mode 100755 container_files/bin/configure_php_user.sh diff --git a/Dockerfile b/Dockerfile index af7747f..b1527f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -85,6 +85,9 @@ ENV MYSQL_HOST "i2mariadb" ENV MYSQL_DATABASE "registry" ENV MYSQL_USER "registry_user" ENV MYSQL_PASSWORD "WJzesbe3poNZ91qIbmR7" +ENV ADMIN_FAMILY "admin" +ENV ADMIN_USERNAME "admin" +ENV ADMIN_NAME "admin" ENV TERM "testterm" # How long will we wait for MariaDB to start up? ENV WAIT_TIME 60 diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh index 6a5ab89..6a88987 100755 --- a/container_files/bin/configure_php.sh +++ b/container_files/bin/configure_php.sh @@ -23,3 +23,40 @@ else fi date >> $log +if [ -z ${COMPOSE+x} ];then + echo "Comanage is not composed no database configuration will be perform" >> $log +else + echo "Comanage is composed. Checking variables to Configure first database data" >> $log + if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] & [[ $version && ${version-x} ]]; then + echo "Variables are ok" >> $log + echo "Doing first configuration in database data" >> $log + cd /opt/comanage/comanage-registry-$version/app + ./Console/cake database >> $log + laststatus=$? + echo "Composed status: $laststatus" >> $log + if [ "$laststatus" != "0" ]; then + echo "Not composed non-zero exit status: $laststatus" >> $log + echo "Console cake database script failed" >> $log + exit 1 + fi + date >> $log + echo "First database input was completed whithout any error" >> $log + echo "Doing variable parsing" >> $log + sed -i "s|ADMIN_NAME|$ADMIN_NAME|g" /opt/bin/configure_php_user.sh + sed -i "s|ADMIN_FAMILY|$ADMIN_FAMILY|g" /opt/bin/configure_php_user.sh + sed -i "s|ADMIN_USERNAME|$ADMIN_USERNAME|g" /opt/bin/configure_php_user.sh + /opt/bin/configure_php_user.sh + laststatus=$? + if [ "$laststatus" != "0" ]; then + echo "Not composed non-zero exit status: $laststatus" >> $log + echo "Console cake database setup script failed" >> $log + exit 1 + fi + date >> $log + echo "Configuration of database was completed" >> $log + else + echo "Variables were not provided . Configuration of database is not possible" >> $log + date >> $log + fi + +fi diff --git a/container_files/bin/configure_php_user.sh b/container_files/bin/configure_php_user.sh new file mode 100755 index 0000000..2fb0f75 --- /dev/null +++ b/container_files/bin/configure_php_user.sh @@ -0,0 +1,7 @@ +log=/tmp/php-user.sh + +date >> $log +cd /opt/comanage/comanage-registry-$version/app +echo "Performing database user setup" >> $log +./Console/cake setup --admin-given-name ADMIN_NAME --admin-family-name ADMIN_FAMILY --admin-username ADMIN_USERNAME --enable-pooling=No --force >> $log + From 7dd2a3da8e6a202291b4dfcdc930ccc27be8f7bc Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 17:45:36 -0300 Subject: [PATCH 13/16] Fixed typo --- container_files/bin/configure_php.sh | 2 +- container_files/bin/start.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh index 6a88987..b3118f8 100755 --- a/container_files/bin/configure_php.sh +++ b/container_files/bin/configure_php.sh @@ -27,7 +27,7 @@ if [ -z ${COMPOSE+x} ];then echo "Comanage is not composed no database configuration will be perform" >> $log else echo "Comanage is composed. Checking variables to Configure first database data" >> $log - if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] & [[ $version && ${version-x} ]]; then + if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] && [[ $version && ${version-x} ]]; then echo "Variables are ok" >> $log echo "Doing first configuration in database data" >> $log cd /opt/comanage/comanage-registry-$version/app diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh index 174489a..e505c85 100755 --- a/container_files/bin/start.sh +++ b/container_files/bin/start.sh @@ -1,7 +1,7 @@ #!/bin/bash - log="/tmp/start-starting.log" date >> $log + if [ -z ${COMPOSE+x} ] then echo "Not composed so not waiting for MariaDB: " > $log From 1d4a801ac87ea0a7e5732e4265d4fb07703a746a Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 17:51:24 -0300 Subject: [PATCH 14/16] Added version in uppercase --- container_files/bin/configure_php.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh index b3118f8..5d01d81 100755 --- a/container_files/bin/configure_php.sh +++ b/container_files/bin/configure_php.sh @@ -27,7 +27,7 @@ if [ -z ${COMPOSE+x} ];then echo "Comanage is not composed no database configuration will be perform" >> $log else echo "Comanage is composed. Checking variables to Configure first database data" >> $log - if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] && [[ $version && ${version-x} ]]; then + if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] && [[ $VERSION && ${VERSION-x} ]]; then echo "Variables are ok" >> $log echo "Doing first configuration in database data" >> $log cd /opt/comanage/comanage-registry-$version/app From dfa7ff42b030057dd5fa49d3b8cebb1c64ff9575 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 17:52:59 -0300 Subject: [PATCH 15/16] Changed version to VERSION --- container_files/bin/configure_php_user.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container_files/bin/configure_php_user.sh b/container_files/bin/configure_php_user.sh index 2fb0f75..b92f170 100755 --- a/container_files/bin/configure_php_user.sh +++ b/container_files/bin/configure_php_user.sh @@ -1,7 +1,7 @@ log=/tmp/php-user.sh date >> $log -cd /opt/comanage/comanage-registry-$version/app +cd /opt/comanage/comanage-registry-$VERSION/app echo "Performing database user setup" >> $log ./Console/cake setup --admin-given-name ADMIN_NAME --admin-family-name ADMIN_FAMILY --admin-username ADMIN_USERNAME --enable-pooling=No --force >> $log From 0cd065225c08fb98cd971efeed1a176cd34cd4b4 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 14 Sep 2016 17:58:05 -0300 Subject: [PATCH 16/16] Changed version to Version --- container_files/bin/configure_php.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh index 5d01d81..874a785 100755 --- a/container_files/bin/configure_php.sh +++ b/container_files/bin/configure_php.sh @@ -30,7 +30,7 @@ else if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] && [[ $VERSION && ${VERSION-x} ]]; then echo "Variables are ok" >> $log echo "Doing first configuration in database data" >> $log - cd /opt/comanage/comanage-registry-$version/app + cd /opt/comanage/comanage-registry-$VERSION/app ./Console/cake database >> $log laststatus=$? echo "Composed status: $laststatus" >> $log