Add relative directory and some echo's to deployscript
This commit is contained in:
parent
3b70f95e56
commit
94254df35a
2 changed files with 12 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,3 @@
|
||||||
releases/
|
releases/
|
||||||
current/
|
current
|
||||||
|
|
||||||
|
|
14
deploy.sh
14
deploy.sh
|
@ -1,17 +1,25 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
declare dir=$(pwd)
|
||||||
|
|
||||||
declare timestamp=$(date +%Y-%m-%d_%H%M)
|
declare timestamp=$(date +%Y-%m-%d_%H%M)
|
||||||
|
|
||||||
declare release_dir="$HOME/releases/$timestamp"
|
declare release_dir="$dir/releases/$timestamp"
|
||||||
|
|
||||||
|
|
||||||
# Pull latest revision
|
# Pull latest revision
|
||||||
|
echo "-> Pulling latest release"
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
# Create release dir and copy sources to that dir
|
# Create release dir and copy sources to that dir
|
||||||
|
echo "-> This release will be stored in $release_dir"
|
||||||
mkdir -p "$release_dir"
|
mkdir -p "$release_dir"
|
||||||
cp -ar src/* "$release_dir"
|
cp -ar src/* "$release_dir"
|
||||||
|
|
||||||
# Link this relase to $current
|
# Link this relase to $current
|
||||||
rm "$HOME/current"
|
echo "-> Linking $dir/current to $release_dir"
|
||||||
ln -sf "$HOME/releases/$timestamp" "$HOME/current"
|
rm "$dir/current" || true # This may fail
|
||||||
|
ln -sf "$dir/releases/$timestamp" "$dir/current"
|
||||||
|
|
||||||
|
echo "-> Deployed succesfully!"
|
||||||
|
|
Loading…
Reference in a new issue