Skip to content

Commit

Permalink
Merge pull request #418 from inkuss/deployScripts
Browse files Browse the repository at this point in the history
Add deploy.sh and install.sh in bin/
  • Loading branch information
inkuss authored Aug 10, 2023
2 parents ddfa8bf + bce6e81 commit 51f79a8
Show file tree
Hide file tree
Showing 34 changed files with 64 additions and 169,747 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ data
.settings
.classpath
.project
bin
conf/application.conf
conf/mail.properties
conf/site.conf
Expand Down
20 changes: 20 additions & 0 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

if (( $EUID == 0 )); then
echo "Don't run as root!"
exit
fi

export TERM=xterm-color
deployingApp="regal-api"
branch=$(git status | grep branch | cut -d ' ' -f3)
echo "git currently on branch: "$branch
if [ ! -z "$1" ]; then
branch="$1"
fi

cd /opt/regal/$deployingApp
git pull origin $branch
/opt/regal/activator/bin/activator -java-home /opt/jdk clean
/opt/regal/activator/bin/activator -java-home /opt/jdk clean-files
/opt/regal/activator/bin/activator -java-home /opt/jdk dist
44 changes: 44 additions & 0 deletions bin/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

if (( $EUID == 0 )); then
echo "Don't run as root!"
exit
fi

actDir=$(pwd)
deployingApp="regal-api"
toscienceDir="/opt/regal"
deployDir="/opt/regal/regal-tmp"
targetDir="/opt/regal"
linkDir="regal-server"
fileName="regal-api-0.8.0-SNAPSHOT.zip"
folderName="regal-api-0.8.0-SNAPSHOT"
newInstallDir="$linkDir.$(date +'%Y%m%d%H%M%S')"
confDir="/etc/to.science/api.conf"
resourcesDir="/etc/to.science/resources"
PLAYPORT=9000

cp $deployDir/$deployingApp/target/universal/$fileName $deployDir

cd $deployDir
unzip $fileName

mv $deployDir/$folderName $targetDir/$newInstallDir
mkdir $targetDir/$newInstallDir/logs

if [ -L $toscienceDir/$linkDir ]; then
rm $toscienceDir/$linkDir
fi
ln -sf $targetDir/$newInstallDir $toscienceDir/$linkDir
rm -r $targetDir/$newInstallDir/conf
ln -sf $confDir $targetDir/$newInstallDir/conf
ln -sf $resourcesDir $targetDir/$newInstallDir/resources
cd $actDir

echo ""
echo "Neue Binärversion verfügbar unter $targetDir/$newInstallDir."
echo "Port ist fest eingestellet auf: $PLAYPORT"
echo "Zum Umschalten auf die neue Version:"
echo "sudo service regal-api stop"
echo "sudo service regal-api start"
echo "Das Log unter $targetDir/$newInstallDir/logs/application.log beobachten"
17 changes: 0 additions & 17 deletions conf/aggregations.conf

This file was deleted.

133 changes: 0 additions & 133 deletions conf/application.conf.tmpl

This file was deleted.

Loading

0 comments on commit 51f79a8

Please sign in to comment.