Deploy script

This commit is contained in:
Rien Maertens 2017-07-29 14:45:46 +02:00
parent c8b7add9d7
commit 13faf10cb9
No known key found for this signature in database
GPG key ID: 943CAB70C511D23C
2 changed files with 20 additions and 0 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
releases/
current/

17
deploy.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail
declare timestamp=$(date +%Y-%m-%d_%H%M)
declare release_dir="$HOME/releases/$timestamp"
# Pull latest revision
git pull
# Create release dir and copy sources to that dir
mkdir -p "$release_dir"
cp -ar src/* "$release_dir"
# Link this relase to $current
rm "$HOME/current"
ln -sf "$HOME/releases/$timestamp" "$HOME/current"