Skip to content

Instantly share code, notes, and snippets.

@joacar
Last active February 23, 2018 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joacar/44df63faf7c23f8a48a9841eba1930e0 to your computer and use it in GitHub Desktop.
Save joacar/44df63faf7c23f8a48a9841eba1930e0 to your computer and use it in GitHub Desktop.
Script to copy content from VSTS Agent release artificat to web folder
#!/bin/bash
dir=/var/<app>
src=/home/user/vstsagent/_work/r1/a/<app>/drop/<app>.zip
service=<app>.service
# Clear directory
echo "Remove content from '$dir'"
rm -r $dir >> /dev/null
# Copy content
echo "Unzip file content '$src' to '$dir'"
unzip -o $src -d $dir >> /dev/null
# Restart servcice
echo "Restarting service '$service'"
sudo systemctl restart $service
sudo systemctl status $service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment