Skip to content

Commit 7471dc2

Browse files
YunaYuna
authored andcommitted
add: pre-push-build.sh
1 parent 419b532 commit 7471dc2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/scripts/pre-push-build.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
4+
echo "현재 브랜치: $BRANCH"
5+
6+
if [ "$BRANCH" = "develop" ]; then
7+
echo "develop 브랜치 빌드 검사 시작 (spring.profiles.active=dev)..."
8+
9+
./gradlew clean build -x test -Dspring.profiles.active=dev
10+
if [ $? -ne 0 ]; then
11+
echo "빌드 실패! push 차단"
12+
exit 1
13+
fi
14+
15+
echo "빌드 성공! push 진행."
16+
else
17+
echo "$BRANCH 브랜치는 빌드 체크 없이 push 허용"
18+
fi
19+
20+
exit 0

0 commit comments

Comments
 (0)