You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.0 KiB
65 lines
2.0 KiB
#!/bin/bash
|
|
|
|
### DO NOT EDIT THIS FILE
|
|
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." &> /dev/null && pwd)/includes/bash_header"
|
|
|
|
function usage {
|
|
echo
|
|
echoMainTitle "Install Sumedia Project Manager"
|
|
echo
|
|
echoSubTitle "Usage:"
|
|
echo
|
|
echo "install-project-manager"
|
|
echo
|
|
echo "--help Prints this message"
|
|
echo
|
|
}
|
|
|
|
help="$(getParameter "--help" false "$@")"
|
|
if [ "$help" == true ]
|
|
then
|
|
usage
|
|
exit
|
|
fi
|
|
|
|
echo
|
|
echoMainTitle "Install Sumedia Project Manager"
|
|
|
|
echo
|
|
echoSubTitle "Please configure Sumedia Project Manager"
|
|
echo
|
|
workspaces_dir="$(readConsole "Workspaces dir" "Invalid selection" true "$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." &> /dev/null && pwd)")"
|
|
local_apache_httpdocs="$(readConsole "Local Apache httpdocs dir (optional)" "Invalid selection" true)"
|
|
sudo_password="$(readConsole "sudo password (optional)" "Invalid selection" true)"
|
|
|
|
if [ ! -f "$project_manager_dir/etc/config" ]
|
|
then
|
|
cat "$project_manager_dir/etc/.project_manager_config_template" | \
|
|
sed "s/project_manager_workspaces_dir=''/project_manager_workspaces_dir='$(sedEscape "$workspaces_dir")'/" | \
|
|
sed "s/project_manager_local_apache_httpdocs=''/project_manager_local_apache_httpdocs='$(sedEscape "$local_apache_httpdocs")'/" \
|
|
sed "s/project_manager_sudo_password=''/project_manager_sudo_password='$(sedEscape "$sudo_password")'/" \
|
|
> "$project_manager_dir/etc/config"
|
|
fi
|
|
|
|
if [ ! -f "$project_manager_dir/etc/projects" ]
|
|
then
|
|
cp "$project_manager_dir/etc/.projects_template" "$project_manager_dir/etc/projects"
|
|
fi
|
|
|
|
if [ ! -f "$project_manager_dir/etc/customers" ]
|
|
then
|
|
cp "$project_manager_dir/etc/.customers_template" "$project_manager_dir/etc/customers"
|
|
fi
|
|
|
|
if [ ! -f "$project_manager_dir/etc/shortnames" ]
|
|
then
|
|
cp "$project_manager_dir/etc/.shortnames_template" "$project_manager_dir/etc/shortnames"
|
|
fi
|
|
|
|
postScript "$project_manager_dir/bin/postscripts/commands/install-project-manager"
|
|
postScript "$workspaces_dir/$customer/$project/bin/postscripts/commands/install-project-manager"
|
|
|
|
echo
|
|
echoSuccess "Project Manager has been installed."
|
|
echo
|