This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Comanagephp #9
Merged
+119
−12
Merged
Comanagephp #9
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b5dd760
Added more control for configure shib and httpd.
8bb5c95
Added main.sh if comanage were composed
1be79b7
Added log to correct place
ba60abe
Added test commit
56a1cfa
Added cleanup.sh remove firsttimerunning
ade81b5
Added files in Dockerfile in order to add php config files
c91f3f7
Change order of configure.sh
35e2d7b
Added first variables values
9640105
Added more log
dd1dc62
typo in sed
3c35693
Changed variable
30e1a89
ADded other script to use variables
7dd2a3d
Fixed typo
1d4a801
Added version in uppercase
dfa7ff4
Changed version to VERSION
0cd0652
Changed version to Version
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
#!/bin/bash | ||
|
||
log=/tmp/cleanup.log | ||
|
||
date >> $log | ||
|
||
echo "Cleaning firsttimerunning" >> $log | ||
|
||
rm /tmp/firsttimerunning | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,9 @@ | |
|
||
/opt/bin/configure_httpd.sh | ||
|
||
/opt/bin/configure_shibd.sh | ||
|
||
/opt/bin/configure_php.sh | ||
|
||
/opt/bin/configure_shibd.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,62 @@ | ||
#!/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_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 | ||
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 | ||
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 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" >> $log | ||
fi | ||
echo "Shibboleth xml parsing finish" >> $log | ||
date >> $log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each RUN command creates a new layer. Can you chain these together with && ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done