Skip to content

Instantly share code, notes, and snippets.

@gokman
Created May 20, 2017 14:35
Show Gist options
  • Select an option

  • Save gokman/0c2e39ea083224be0e7bb0a67c8d2915 to your computer and use it in GitHub Desktop.

Select an option

Save gokman/0c2e39ea083224be0e7bb0a67c8d2915 to your computer and use it in GitHub Desktop.
spring boot git hook post-receive
#!/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