Last active
November 14, 2019 09:58
-
-
Save Ksisu/49f6439f78af5ff321e0804c0f171140 to your computer and use it in GitHub Desktop.
Simple symlink style deploy script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SCRIPT_PATH=${0%/*} | |
### Check version | |
VERSION=$1 | |
if [ ! -n "$VERSION" ]; then | |
echo "Missing version parameter. Use: $0 <VERSION>" | |
exit 1 | |
fi | |
VERSION_DIR="$SCRIPT_PATH/$VERSION" | |
if [ ! -d $VERSION_DIR ]; then | |
echo "Directory not found: $VERSION_DIR" | |
exit 1 | |
fi | |
### Stop service | |
echo "Stop service..." | |
# TODO | |
### Update current dir | |
echo "Change current dir to: $VERSION" | |
ln -sfn ./$VERSION ./current | |
### Start service | |
echo "Start service..." | |
# TODO | |
echo "DEPLOY FINSHED $VERSION" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment