Commit da18f8fb authored by saschaschmidt's avatar saschaschmidt

Merge branch 'install-script' into 'master'

[TASK] Example of install-script

See merge request !37
parents 313db4d6 7d06aaaf
Pipeline #319 passed with stages
in 1 minute and 50 seconds
#!/bin/bash -e
echo "Installing the package ..."
RELEASE_FOLDER = /path/to/web/root/
# Use the typo3console to delete some caches (permission problems)
# If version.txt is there, we assume the system is healthy
if [ -e $RELEASE_FOLDER/web/version.txt ]; then
$RELEASE_FOLDER/vendor/bin/typo3cms cache:flush
fi
# Manually delete the rest of the files
rm -rf $RELEASE_FOLDER/*
# Add Lock-File
mkdir -p ${RELEASE_FOLDER}
touch ${RELEASE_FOLDER}/INSTALLING.lock
function cleanup {
if [ -f ${RELEASE_FOLDER}/INSTALLING.lock ]; then
echo "Cleanup folder $RELEASE_FOLDER"
rm -rf -- "$RELEASE_FOLDER"
mkdir -p $RELEASE_FOLDER/web/
touch $RELEASE_FOLDER/web/index.html
echo '<h1>System not available</h1>' > $RELEASE_FOLDER/web/index.html
fi
}
trap cleanup EXIT
echo "Copying files ..."
cp -Rf files/. $RELEASE_FOLDER
echo "Adapting configuration ..."
sed -i "s/###DB_NAME###/$DB_NAME/" $RELEASE_FOLDER/web/typo3conf/LocalConfiguration.php
sed -i "s/###DB_HOST###/$DB_HOST/" $RELEASE_FOLDER/web/typo3conf/LocalConfiguration.php
sed -i "s/###DB_USER###/$DB_USER/" $RELEASE_FOLDER/web/typo3conf/LocalConfiguration.php
sed -i "s/###DB_PASS###/$DB_PASS/" $RELEASE_FOLDER/web/typo3conf/LocalConfiguration.php
# Make the typo3console executable
chmod +x $RELEASE_FOLDER/vendor/bin/typo3cms
echo "Deploying database ..."
mysql -u${DB_USER} -p${DB_PASS} ${DB_NAME} < database/dump.sql
#$RELEASE_FOLDER/vendor/bin/typo3cms database:import < database/dump.sql
# Activate required packages
echo "Activate packages ..."
$RELEASE_FOLDER/vendor/bin/typo3cms install:generatepackagestates 0 1
echo "Updating database schema ..."
$RELEASE_FOLDER/vendor/bin/typo3cms database:updateschema '*.*'
echo "Setting site name ..."
$RELEASE_FOLDER/vendor/bin/typo3cms configuration:set SYS/sitename 'ter-typo3-org-devbox'
echo "Flushing TYPO3 cache ..."
$RELEASE_FOLDER/vendor/bin/typo3cms cache:flush
# Remove Lock-File
rm ${RELEASE_FOLDER}/INSTALLING.lock
echo "----- DONE ------"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment