Skip to content

Commit

Permalink
ci: Add concurrency option
Browse files Browse the repository at this point in the history
  • Loading branch information
JiwonKKang committed Dec 5, 2024
1 parent c04cbc6 commit 001be53
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 12 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/game-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,24 @@ jobs:
git config --local user.email "[email protected]"
git config --local user.name "githubaction"
git add ${{ env.HELM_VALUE }}
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}"
git push --force origin ${{ env.HELM_BRANCH }}
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}" || echo "No changes to commit"
attempts=0
max_attempts=3
while [ $attempts -lt $max_attempts ]; do
if git push --force origin ${{ env.HELM_BRANCH }}; then
echo "Push successful!"
break
else
echo "Push failed due to remote ref lock. Attempting rebase with remote branch."
# 원격 브랜치 최신 상태 반영
git pull --rebase origin ${{ env.HELM_BRANCH }}
attempts=$((attempts+1))
if [ $attempts -eq $max_attempts ]; then
echo "Push failed after $max_attempts attempts"
exit 1
fi
echo "Retrying push..."
fi
done
23 changes: 21 additions & 2 deletions .github/workflows/gateway-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,24 @@ jobs:
git config --local user.email "[email protected]"
git config --local user.name "githubaction"
git add ${{ env.HELM_VALUE }}
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}"
git push --force origin ${{ env.HELM_BRANCH }}
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}" || echo "No changes to commit"
attempts=0
max_attempts=3
while [ $attempts -lt $max_attempts ]; do
if git push --force origin ${{ env.HELM_BRANCH }}; then
echo "Push successful!"
break
else
echo "Push failed due to remote ref lock. Attempting rebase with remote branch."
# 원격 브랜치 최신 상태 반영
git pull --rebase origin ${{ env.HELM_BRANCH }}
attempts=$((attempts+1))
if [ $attempts -eq $max_attempts ]; then
echo "Push failed after $max_attempts attempts"
exit 1
fi
echo "Retrying push..."
fi
done
24 changes: 22 additions & 2 deletions .github/workflows/matching-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,29 @@ jobs:

- name: Commit and Push Helm Chart Changes
run: |
run: |
cd helm-chart
git config --local user.email "[email protected]"
git config --local user.name "githubaction"
git add ${{ env.HELM_VALUE }}
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}"
git push --force origin ${{ env.HELM_BRANCH }}
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}" || echo "No changes to commit"
attempts=0
max_attempts=3
while [ $attempts -lt $max_attempts ]; do
if git push --force origin ${{ env.HELM_BRANCH }}; then
echo "Push successful!"
break
else
echo "Push failed due to remote ref lock. Attempting rebase with remote branch."
# 원격 브랜치 최신 상태 반영
git pull --rebase origin ${{ env.HELM_BRANCH }}
attempts=$((attempts+1))
if [ $attempts -eq $max_attempts ]; then
echo "Push failed after $max_attempts attempts"
exit 1
fi
echo "Retrying push..."
fi
done
23 changes: 21 additions & 2 deletions .github/workflows/quiz-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,24 @@ jobs:
git config --local user.email "[email protected]"
git config --local user.name "githubaction"
git add ${{ env.HELM_VALUE }}
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}"
git push --force origin ${{ env.HELM_BRANCH }}
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}" || echo "No changes to commit"
attempts=0
max_attempts=3
while [ $attempts -lt $max_attempts ]; do
if git push --force origin ${{ env.HELM_BRANCH }}; then
echo "Push successful!"
break
else
echo "Push failed due to remote ref lock. Attempting rebase with remote branch."
# 원격 브랜치 최신 상태 반영
git pull --rebase origin ${{ env.HELM_BRANCH }}
attempts=$((attempts+1))
if [ $attempts -eq $max_attempts ]; then
echo "Push failed after $max_attempts attempts"
exit 1
fi
echo "Retrying push..."
fi
done
23 changes: 21 additions & 2 deletions .github/workflows/user-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,24 @@ jobs:
git config --local user.email "[email protected]"
git config --local user.name "githubaction"
git add ${{ env.HELM_VALUE }}
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}"
git push --force origin ${{ env.HELM_BRANCH }}
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}" || echo "No changes to commit"
attempts=0
max_attempts=3
while [ $attempts -lt $max_attempts ]; do
if git push --force origin ${{ env.HELM_BRANCH }}; then
echo "Push successful!"
break
else
echo "Push failed due to remote ref lock. Attempting rebase with remote branch."
# 원격 브랜치 최신 상태 반영
git pull --rebase origin ${{ env.HELM_BRANCH }}
attempts=$((attempts+1))
if [ $attempts -eq $max_attempts ]; then
echo "Push failed after $max_attempts attempts"
exit 1
fi
echo "Retrying push..."
fi
done
3 changes: 3 additions & 0 deletions gateway-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ RUN mkdir -p ${MODULE_NAME}/build/extracted && (java -Djarmode=layertools -jar $
FROM eclipse-temurin:17-jdk
VOLUME /tmp

RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
ENV TZ=Asia/Seoul

RUN apt-get update && apt-get install -y curl

ARG MODULE_NAME=gateway-service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")

//swagger
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0")

implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
Expand Down
1 change: 0 additions & 1 deletion user-service/user-application/app-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")

//swagger
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0")

// JWT
Expand Down

0 comments on commit 001be53

Please sign in to comment.