Created
May 20, 2017 14:35
-
-
Save gokman/0c2e39ea083224be0e7bb0a67c8d2915 to your computer and use it in GitHub Desktop.
spring boot git hook post-receive
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
| #!/usr/bin/env bash | |
| TARGET="/opt/backend" | |
| REPO="/opt/backend.git" | |
| TEMP="/tmp/backend" | |
| # Extracting source to temp directory. | |
| rm -rf $TEMP | |
| mkdir -p $TEMP | |
| git --work-tree=$TEMP --git-dir=$REPO checkout -f | |
| cd $TEMP | |
| ./gradlew build -x test | |
| rm -rf $TARGET/* | |
| mv build/libs/backend.jar $TARGET |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment