Skip to content

Instantly share code, notes, and snippets.

@Ksisu
Last active November 14, 2019 09:58
Show Gist options
  • Save Ksisu/49f6439f78af5ff321e0804c0f171140 to your computer and use it in GitHub Desktop.
Save Ksisu/49f6439f78af5ff321e0804c0f171140 to your computer and use it in GitHub Desktop.
Simple symlink style deploy script
#!/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