Skip to content

Commit 001be53

Browse files
committed
ci: Add concurrency option
1 parent c04cbc6 commit 001be53

File tree

8 files changed

+109
-12
lines changed

8 files changed

+109
-12
lines changed

.github/workflows/game-image-build.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,24 @@ jobs:
5757
git config --local user.email "[email protected]"
5858
git config --local user.name "githubaction"
5959
git add ${{ env.HELM_VALUE }}
60-
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}"
61-
git push --force origin ${{ env.HELM_BRANCH }}
60+
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}" || echo "No changes to commit"
61+
62+
attempts=0
63+
max_attempts=3
64+
65+
while [ $attempts -lt $max_attempts ]; do
66+
if git push --force origin ${{ env.HELM_BRANCH }}; then
67+
echo "Push successful!"
68+
break
69+
else
70+
echo "Push failed due to remote ref lock. Attempting rebase with remote branch."
71+
# 원격 브랜치 최신 상태 반영
72+
git pull --rebase origin ${{ env.HELM_BRANCH }}
73+
attempts=$((attempts+1))
74+
if [ $attempts -eq $max_attempts ]; then
75+
echo "Push failed after $max_attempts attempts"
76+
exit 1
77+
fi
78+
echo "Retrying push..."
79+
fi
80+
done

.github/workflows/gateway-image-build.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,24 @@ jobs:
5757
git config --local user.email "[email protected]"
5858
git config --local user.name "githubaction"
5959
git add ${{ env.HELM_VALUE }}
60-
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}"
61-
git push --force origin ${{ env.HELM_BRANCH }}
60+
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}" || echo "No changes to commit"
61+
62+
attempts=0
63+
max_attempts=3
64+
65+
while [ $attempts -lt $max_attempts ]; do
66+
if git push --force origin ${{ env.HELM_BRANCH }}; then
67+
echo "Push successful!"
68+
break
69+
else
70+
echo "Push failed due to remote ref lock. Attempting rebase with remote branch."
71+
# 원격 브랜치 최신 상태 반영
72+
git pull --rebase origin ${{ env.HELM_BRANCH }}
73+
attempts=$((attempts+1))
74+
if [ $attempts -eq $max_attempts ]; then
75+
echo "Push failed after $max_attempts attempts"
76+
exit 1
77+
fi
78+
echo "Retrying push..."
79+
fi
80+
done

.github/workflows/matching-image-build.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,29 @@ jobs:
5353

5454
- name: Commit and Push Helm Chart Changes
5555
run: |
56+
run: |
5657
cd helm-chart
5758
git config --local user.email "[email protected]"
5859
git config --local user.name "githubaction"
5960
git add ${{ env.HELM_VALUE }}
60-
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}"
61-
git push --force origin ${{ env.HELM_BRANCH }}
61+
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}" || echo "No changes to commit"
62+
63+
attempts=0
64+
max_attempts=3
65+
66+
while [ $attempts -lt $max_attempts ]; do
67+
if git push --force origin ${{ env.HELM_BRANCH }}; then
68+
echo "Push successful!"
69+
break
70+
else
71+
echo "Push failed due to remote ref lock. Attempting rebase with remote branch."
72+
# 원격 브랜치 최신 상태 반영
73+
git pull --rebase origin ${{ env.HELM_BRANCH }}
74+
attempts=$((attempts+1))
75+
if [ $attempts -eq $max_attempts ]; then
76+
echo "Push failed after $max_attempts attempts"
77+
exit 1
78+
fi
79+
echo "Retrying push..."
80+
fi
81+
done

.github/workflows/quiz-image-build.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,24 @@ jobs:
5757
git config --local user.email "[email protected]"
5858
git config --local user.name "githubaction"
5959
git add ${{ env.HELM_VALUE }}
60-
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}"
61-
git push --force origin ${{ env.HELM_BRANCH }}
60+
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}" || echo "No changes to commit"
61+
62+
attempts=0
63+
max_attempts=3
64+
65+
while [ $attempts -lt $max_attempts ]; do
66+
if git push --force origin ${{ env.HELM_BRANCH }}; then
67+
echo "Push successful!"
68+
break
69+
else
70+
echo "Push failed due to remote ref lock. Attempting rebase with remote branch."
71+
# 원격 브랜치 최신 상태 반영
72+
git pull --rebase origin ${{ env.HELM_BRANCH }}
73+
attempts=$((attempts+1))
74+
if [ $attempts -eq $max_attempts ]; then
75+
echo "Push failed after $max_attempts attempts"
76+
exit 1
77+
fi
78+
echo "Retrying push..."
79+
fi
80+
done

.github/workflows/user-image-build.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,24 @@ jobs:
5757
git config --local user.email "[email protected]"
5858
git config --local user.name "githubaction"
5959
git add ${{ env.HELM_VALUE }}
60-
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}"
61-
git push --force origin ${{ env.HELM_BRANCH }}
60+
git commit -m "Update ${SERVICE_NAME} image tag to ${{ env.BUILD_ID }}" || echo "No changes to commit"
61+
62+
attempts=0
63+
max_attempts=3
64+
65+
while [ $attempts -lt $max_attempts ]; do
66+
if git push --force origin ${{ env.HELM_BRANCH }}; then
67+
echo "Push successful!"
68+
break
69+
else
70+
echo "Push failed due to remote ref lock. Attempting rebase with remote branch."
71+
# 원격 브랜치 최신 상태 반영
72+
git pull --rebase origin ${{ env.HELM_BRANCH }}
73+
attempts=$((attempts+1))
74+
if [ $attempts -eq $max_attempts ]; then
75+
echo "Push failed after $max_attempts attempts"
76+
exit 1
77+
fi
78+
echo "Retrying push..."
79+
fi
80+
done

gateway-service/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ RUN mkdir -p ${MODULE_NAME}/build/extracted && (java -Djarmode=layertools -jar $
1414
FROM eclipse-temurin:17-jdk
1515
VOLUME /tmp
1616

17+
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
18+
ENV TZ=Asia/Seoul
19+
1720
RUN apt-get update && apt-get install -y curl
1821

1922
ARG MODULE_NAME=gateway-service

matching-service/matching-application/app-api/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies {
88
implementation("org.springframework.boot:spring-boot-starter-web")
99
implementation("org.springframework.boot:spring-boot-starter-actuator")
1010

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

1413
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")

user-service/user-application/app-api/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies {
88
implementation("org.springframework.boot:spring-boot-starter-web")
99
implementation("org.springframework.boot:spring-boot-starter-actuator")
1010

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

1413
// JWT

0 commit comments

Comments
 (0)