|
@@ -1,6 +1,6 @@
|
|
|
#!/bin/bash
|
|
|
|
|
|
-source bin/functions.sh
|
|
|
+source bin/utils/functions.sh
|
|
|
|
|
|
if [ -f bin/install.cfg ]; then
|
|
|
echo "File install.cfg already exists"
|
|
@@ -34,26 +34,6 @@ fi
|
|
|
|
|
|
source bin/install.cfg
|
|
|
|
|
|
-# Function to check if a repository exists and perform git pull or git clone
|
|
|
-update_repository() {
|
|
|
- local repo_url="$1"
|
|
|
- local repo_dir="$2"
|
|
|
- local repo_branch="$3"
|
|
|
-
|
|
|
- if [ -d "$repo_dir" ]; then
|
|
|
- # If the directory exists, then do a git pull
|
|
|
- echo_warning "Updating $repo_dir..."
|
|
|
- cd "$repo_dir" || exit
|
|
|
- git checkout $repo_branch
|
|
|
- git pull
|
|
|
- cd - || exit
|
|
|
- else
|
|
|
- # If the directory does not exist, then do a git clone
|
|
|
- echo_warning "Cloning $repo_url into $repo_dir..."
|
|
|
- git clone -b "$repo_branch" "$repo_url" "$repo_dir"
|
|
|
- fi
|
|
|
-}
|
|
|
-
|
|
|
# Update repositories
|
|
|
update_repository "$TICKETS" "tickets" "$TICKETS_BRANCH"
|
|
|
update_repository "$BACKEND" "dbsynce" "$BACKEND_BRANCH"
|
|
@@ -72,14 +52,14 @@ source venv/bin/activate
|
|
|
pip install --upgrade pip
|
|
|
pip install -r requirements.txt
|
|
|
|
|
|
-# Checking for core/settings_vars.py
|
|
|
-if [ -f core/settings_vars.py ]; then
|
|
|
- echo "File settings_vars.py already exists"
|
|
|
+# Checking for .env
|
|
|
+if [ -f .env ]; then
|
|
|
+ echo "File .env already exists"
|
|
|
else
|
|
|
- cp core/_settings_vars.py core/settings_vars.py
|
|
|
- echo "File settings_vars.py was successfully created"
|
|
|
- echo "Write the connection settings for the PostgreSQL database."
|
|
|
- echo "Restart install.sh script after editing."
|
|
|
+ cp .env.example .env
|
|
|
+ echo_success "File .env was successfully created"
|
|
|
+ echo_warning "Write the connection settings for the PostgreSQL database."
|
|
|
+ echo_warning "Restart install.sh script after editing."
|
|
|
exit
|
|
|
fi
|
|
|
|
|
@@ -95,19 +75,6 @@ if (($GENERATE_TEST_USERS)); then
|
|
|
python manage.py create_metaservice_test_users
|
|
|
fi
|
|
|
|
|
|
-echo_warning "Recreating sharix_open.service"
|
|
|
-\cp conf/sharix_open.service.example conf/sharix_open.service
|
|
|
-sed -i "s|WORKING_DIRECTORY|$(pwd)|g" conf/sharix_open.service
|
|
|
-echo_success "Recreated sharix_open.service"
|
|
|
-
|
|
|
-echo_warning "Copying sharix_open.service to /etc/systemd/system/ folder"
|
|
|
-\cp conf/sharix_open.service /etc/systemd/system/
|
|
|
-echo_success "Copied sharix_open.service to /etc/systemd/system/ folder"
|
|
|
-
|
|
|
-echo_warning "Reloading systemd daemon"
|
|
|
-systemctl daemon-reload
|
|
|
-echo_success "Reloaded systemd daemon"
|
|
|
-
|
|
|
# Checking for webservice_running/handlers/.env
|
|
|
if [ -f webservice_running/handlers/.env ]; then
|
|
|
echo "env file for handlers already exists. "
|
|
@@ -116,6 +83,3 @@ else
|
|
|
cp webservice_running/handlers/.env.example webservice_running/handlers/.env
|
|
|
echo_success "Created env file for handlers."
|
|
|
fi
|
|
|
-
|
|
|
-echo_warning "Installation handlers"
|
|
|
-webservice_running/handlers/conf/bin/install.sh
|