Deploy script
This commit is contained in:
parent
c8b7add9d7
commit
13faf10cb9
2 changed files with 20 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
releases/
|
||||||
|
current/
|
||||||
|
|
17
deploy.sh
Executable file
17
deploy.sh
Executable 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"
|
Loading…
Reference in a new issue