summaryrefslogtreecommitdiff
path: root/deploy.sh
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-08-20 23:21:02 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-08-21 19:26:10 +0200
commit81890b657004ebfed45db139c15a22282d1a683b (patch)
tree23621068a1b3d96aabf0d0648c2a502a7c43795a /deploy.sh
parentbf6efe532c8f2de84e95b090911280a9b1b61ce8 (diff)
Build docker image with gitlab
Diffstat (limited to 'deploy.sh')
-rwxr-xr-xdeploy.sh11
1 files changed, 4 insertions, 7 deletions
diff --git a/deploy.sh b/deploy.sh
index b731e36a..15795011 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -60,14 +60,11 @@ ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "${remote_hos
if [[ -f \"${remote_path}/current/config/config.php\" ]]; then
echo \"Config backup\"
cp \"${remote_path}/current/config/config.php\" \"${deploy_id}-config.php\"
- fi
-
- echo \"Changing symlink\"
- unlink_cmd=\$(command -v unlink || command -v rm)
- \$unlink_cmd \"${remote_path}/current\" && ln -s \"${remote_path}/${deploy_id}\" \"${remote_path}/current\"
- if [[ -f \"${deploy_id}-config.php\" ]]; then
echo \"Restoring config\"
- cp \"${deploy_id}-config.php\" \"${remote_path}/current/config/config.php\"
+ cp \"${deploy_id}-config.php\" \"${remote_path}/${deploy_id}/config/config.php\"
fi
+
+ echo \"Changing symlink\"
+ ln -nsf \"${remote_path}/${deploy_id}\" \"${remote_path}/current\"
"