Updated ACA Portal build.gradle [no ci]

Committer: iadgovuser26
This commit is contained in:
iadgovuser26 2023-01-18 16:27:02 +00:00 committed by iadgovuser26
parent dde6acc389
commit eae9e37228
2 changed files with 19 additions and 14 deletions

View File

@ -149,7 +149,7 @@ ospackage {
// /etc/hirs/certificates/private/ files are created by ssl_configure.sh // /etc/hirs/certificates/private/ files are created by ssl_configure.sh
// postInstall file('../package/scripts/common/firewall_configure_tomcat.sh') // postInstall file('../package/scripts/common/firewall_configure_tomcat.sh')
// postInstall file('../package/scripts/common/ssl_configure.sh') // postInstall file('../package/scripts/common/ssl_configure.sh')
// postInstall file('../package/scripts/common/db_create.sh') postInstall file('../package/scripts/common/db_create.sh')
// postInstall file('../package/scripts/aca/certificate_generate.sh') // postInstall file('../package/scripts/aca/certificate_generate.sh')
// postInstall 'if [ selinuxenabled ]; then semodule -i /opt/hirs/extras/aca/tomcat-mysql-hirs.pp; fi' // postInstall 'if [ selinuxenabled ]; then semodule -i /opt/hirs/extras/aca/tomcat-mysql-hirs.pp; fi'
@ -159,6 +159,8 @@ ospackage {
// Copy files to /tmp that package manager will be expecting them there // Copy files to /tmp that package manager will be expecting them there
preUninstall 'mkdir -p /tmp/aca/default-properties/' preUninstall 'mkdir -p /tmp/aca/default-properties/'
preUninstall 'cp /opt/hirs/default-properties/* /tmp/aca/default-properties/.' preUninstall 'cp /opt/hirs/default-properties/* /tmp/aca/default-properties/.'
// postUninstall file(/opt/hirs/scripts/common/db_drop.sql)
buildRpm.dependsOn ':HIRS_AttestationCA:war' buildRpm.dependsOn ':HIRS_AttestationCA:war'

View File

@ -10,22 +10,25 @@ fi
echo "Creating HIRS Database..." echo "Creating HIRS Database..."
if [ $DOCKER_CONTAINER = true ]; then # Check if mysql is already running, if not initialize
# If in Docker container, avoid services that invoke the D-Bus if [[ $(pgrep -c -u mysql mysqld) -eq 0 ]]; then
if [[ $(pgrep -c -u mysql mysqld) -eq 0 ]]; then # Check if running in a container
echo "running in a container..." if [ $DOCKER_CONTAINER = true ]; then
# if in Docker container, avoid services that invoke the D-Bus
echo "ACA is running in a container..."
/usr/bin/mysql_install_db /usr/bin/mysql_install_db
chown -R mysql:mysql /var/lib/mysql chown -R mysql:mysql /var/lib/mysql/
/usr/libexec/mysql-prepare-db-dir > /dev/null 2>&1 chown -R mysql:mysql /var/log/mariadb/
nohup /usr/bin/mysqld_safe > /dev/null 2>&1 & nohup /usr/bin/mysqld_safe > /dev/null 2>&1 &
fi else
else SQL_SERVICE=`/opt/hirs/scripts/common/get_db_service.sh`
SQL_SERVICE=`/opt/hirs/scripts/common/get_db_service.sh` systemctl $SQL_SERVICE enable
systemctl $SQL_SERVICE enable systemctl $SQL_SERVICE start
systemctl $SQL_SERVICE start fi
# Set intial password
mysqladmin -u root password $DB_DEFAULT_PWD
fi fi
# Initialize the hirs_db database
mysqladmin -u root password $DB_DEFAULT_PWD
DB_CREATE_SCRIPT=/opt/hirs/scripts/common/db_create.sql.el7 DB_CREATE_SCRIPT=/opt/hirs/scripts/common/db_create.sql.el7
mysql -u root --password="$DB_DEFAULT_PWD" < $DB_CREATE_SCRIPT mysql -u root --password="$DB_DEFAULT_PWD" < $DB_CREATE_SCRIPT