Skip to content

Instantly share code, notes, and snippets.

@evlymn
Created November 19, 2017 21:00
Show Gist options
  • Save evlymn/6a2ec91072be0452fc86aba3a5abea4e to your computer and use it in GitHub Desktop.
Save evlymn/6a2ec91072be0452fc86aba3a5abea4e to your computer and use it in GitHub Desktop.
Deploy to Umbler Git
#!/bin/sh
echo "Deploy umbler master"
COMMIT_MSG="$1"
DEPLOY_FOLDER=~/projects/deploy/seusite-com
BUILD_FOLDER=dist
GIT_URL=ssh://[email protected]:9922/~/git/seusite-com.git
if [[ ! -d $DEPLOY_FOLDER ]]; then
git clone $GIT_URL $DEPLOY_FOLDER
fi
ng build --prod
cp -r $BUILD_FOLDER/* $DEPLOY_FOLDER
cd $DEPLOY_FOLDER
git diff --quiet; NOCHANGES=$?
if [ $NOCHANGES -eq 0 ]; then
echo "no changes"
else
echo "changes"
git add .
git commit -m"$COMMIT_MSG"
git push origin master
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment