mirror of https://github.com/samply/bridgehead.git
Fixed merge conflicts
This commit is contained in:
parent
ef7b96372b
commit
8c982c939e
|
@ -2,20 +2,11 @@
|
||||||
|
|
||||||
exitIfNotRoot() {
|
exitIfNotRoot() {
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ "$EUID" -ne 0 ]; then
|
||||||
<<<<<<< HEAD
|
|
||||||
echo "Please run as root"
|
|
||||||
=======
|
|
||||||
log "ERROR" "Please run as root"
|
log "ERROR" "Please run as root"
|
||||||
>>>>>>> version-1
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
log() {
|
|
||||||
echo "$(date +'%Y-%m-%d %T')" "$1:" "$2"
|
|
||||||
}
|
|
||||||
=======
|
|
||||||
checkOwner(){
|
checkOwner(){
|
||||||
COUNT=$(find $1 ! -user $2 |wc -l)
|
COUNT=$(find $1 ! -user $2 |wc -l)
|
||||||
if [ $COUNT -gt 0 ]; then
|
if [ $COUNT -gt 0 ]; then
|
||||||
|
@ -113,4 +104,3 @@ export PRODUCTION="false";
|
||||||
if [ "$(git branch --show-current)" == "main" ]; then
|
if [ "$(git branch --show-current)" == "main" ]; then
|
||||||
export PRODUCTION="true";
|
export PRODUCTION="true";
|
||||||
fi
|
fi
|
||||||
>>>>>>> version-1
|
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
## Check if user is a su
|
|
||||||
echo "Welcome to the starting a bridgehead. We will get your instance up and running in no time"
|
|
||||||
echo "First we will check if all prerequisites are met ..."
|
|
||||||
=======
|
|
||||||
source lib/functions.sh
|
source lib/functions.sh
|
||||||
|
|
||||||
if ! id "bridgehead" &>/dev/null; then
|
if ! id "bridgehead" &>/dev/null; then
|
||||||
|
@ -18,7 +12,6 @@ checkOwner /etc/bridgehead bridgehead || exit 1
|
||||||
|
|
||||||
## Check if user is a su
|
## Check if user is a su
|
||||||
log INFO "Checking if all prerequisites are met ..."
|
log INFO "Checking if all prerequisites are met ..."
|
||||||
>>>>>>> version-1
|
|
||||||
prerequisites="git docker docker-compose"
|
prerequisites="git docker docker-compose"
|
||||||
for prerequisite in $prerequisites; do
|
for prerequisite in $prerequisites; do
|
||||||
$prerequisite --version 2>&1
|
$prerequisite --version 2>&1
|
||||||
|
@ -30,45 +23,6 @@ for prerequisite in $prerequisites; do
|
||||||
# TODO: Check for specific version
|
# TODO: Check for specific version
|
||||||
done
|
done
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
echo "Checking site.conf"
|
|
||||||
|
|
||||||
#check if site.conf is created
|
|
||||||
if [ ! -f site.conf ]; then
|
|
||||||
echo "Please create your specific site.conf file from the site.dev.conf"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Load site specific variables
|
|
||||||
source site.conf
|
|
||||||
|
|
||||||
if [ -z "$site_name" ]; then
|
|
||||||
echo "Please set site_name"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Checking site-config module"
|
|
||||||
|
|
||||||
## Download submodule
|
|
||||||
if [ ! -d "site-config" ]; then
|
|
||||||
echo "Please set up the site-config folder. Instruction are in the readme."
|
|
||||||
exit
|
|
||||||
else
|
|
||||||
echo "Site configuration is already loaded"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Check if a project is selected
|
|
||||||
if [ -z "$project" ]; then
|
|
||||||
echo "No project selected! Please add a Project in your local site.conf."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
#check if project env is present
|
|
||||||
if [ -d "site-config/${project}.env" ]; then
|
|
||||||
echo "Please copy the tempalte from ${project} and put it in the site-config folder"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "All prerequisites are met!"
|
|
||||||
=======
|
|
||||||
log INFO "Checking configuration ..."
|
log INFO "Checking configuration ..."
|
||||||
|
|
||||||
## Download submodule
|
## Download submodule
|
||||||
|
@ -108,4 +62,3 @@ fi
|
||||||
log INFO "Success - all prerequisites are met!"
|
log INFO "Success - all prerequisites are met!"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
>>>>>>> version-1
|
|
||||||
|
|
|
@ -1,15 +1,3 @@
|
||||||
<<<<<<< HEAD
|
|
||||||
[Unit]
|
|
||||||
Description=Bridgehead (%i) Update Service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
WorkingDirectory=/srv/docker/bridgehead/
|
|
||||||
ExecStart=/bin/bash -c "/srv/docker/bridgehead/update-bridgehead.sh %i"
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
=======
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Bridgehead (%i) Update Service
|
Description=Bridgehead (%i) Update Service
|
||||||
|
|
||||||
|
@ -20,4 +8,3 @@ ExecStart=/srv/docker/bridgehead/bridgehead update %i
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
>>>>>>> version-1
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<<<<<<< HEAD
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Nightly Updates of Bridgehead (%i)
|
Description=Nightly Updates of Bridgehead (%i)
|
||||||
|
|
||||||
|
@ -7,13 +6,3 @@ OnCalendar=*-*-* 03:00:00
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=basic.target
|
WantedBy=basic.target
|
||||||
=======
|
|
||||||
[Unit]
|
|
||||||
Description=Nightly Updates of Bridgehead (%i)
|
|
||||||
|
|
||||||
[Timer]
|
|
||||||
OnCalendar=*-*-* 03:00:00
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=basic.target
|
|
||||||
>>>>>>> version-1
|
|
||||||
|
|
|
@ -1,20 +1,3 @@
|
||||||
<<<<<<< HEAD
|
|
||||||
[Unit]
|
|
||||||
Description=Bridgehead (%i) Service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Restart=always
|
|
||||||
RestartSec=30
|
|
||||||
|
|
||||||
WorkingDirectory=/srv/docker/bridgehead/
|
|
||||||
|
|
||||||
ExecStartPre=/bin/bash -c '`which docker-compose` -f %i/docker-compose.yml --env-file site-config/%i.env down'
|
|
||||||
ExecStart=/bin/bash -c '`which docker-compose` -f %i/docker-compose.yml --env-file site-config/%i.env up'
|
|
||||||
ExecStop=/bin/bash -c '`which docker-compose` -f %i/docker-compose.yml --env-file site-config/%i.env down'
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
=======
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Bridgehead (%i) Service
|
Description=Bridgehead (%i) Service
|
||||||
|
|
||||||
|
@ -27,4 +10,3 @@ ExecStop=/srv/docker/bridgehead/bridgehead stop %i
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
>>>>>>> version-1
|
|
||||||
|
|
Loading…
Reference in New Issue