Skip to content

Commit

Permalink
CD Workflow μˆ˜μ • (#21)
Browse files Browse the repository at this point in the history
* feat: ci workflow μž‘μ„±

* feat: cd workflow μž‘μ„±

* fix: mysql actions step μ‚­μ œ

* fix: docker image νƒœκ·Έ 제거

* fix: cd νŒŒμ΄ν”„λΌμΈ trigger 브랜치λͺ… μˆ˜μ •(develop->dev)

* fix: gradle build κ³Όμ • μΆ”κ°€

* fix: gradle build κ³Όμ • μΆ”κ°€

* fix: cd νŒŒμ΄ν”„λΌμΈ μž„μ‹œ μˆ˜μ •

* fix: cd νŒŒμ΄ν”„λΌμΈ μž„μ‹œ μˆ˜μ • 사항 μ‚­μ œ

* fix: gradlew κΆŒν•œ μˆ˜μ •

* fix: ν…ŒμŠ€νŠΈ μ‹€νŒ¨ 였λ₯˜ ν•΄κ²°
  • Loading branch information
jinlee1703 authored Mar 26, 2024
1 parent 1b41db4 commit e09ab66
Show file tree
Hide file tree
Showing 8 changed files with 396 additions and 360 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,21 @@ jobs:
java-version: '17'
distribution: 'temurin'

# 3. Docker 이미지 build 및 push
# 3. Build Gradle
- name: Build Gradle
run: |
chmod +x ./gradlew
./gradlew build --stacktrace --info -x test
shell: bash

# 4. Docker 이미지 build 및 push
- name: docker build and push
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t jinlee1703/pennyway-was .
docker push jinlee1703/pennyway-was
# 4. AWS SSM을 ν†΅ν•œ Run-Command (Docker 이미지 pull ν›„ docker-composeλ₯Ό ν†΅ν•œ μ‹€ν–‰)
# 5. AWS SSM을 ν†΅ν•œ Run-Command (Docker 이미지 pull ν›„ docker-composeλ₯Ό ν†΅ν•œ μ‹€ν–‰)
- name: AWS SSM Send-Command
uses: peterkimzz/aws-ssm-send-command@master
id: ssm
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ jobs:

# 3. Gradle Test μ‹€ν–‰
- name: Test with Gradle
run: ./gradlew --info test
run: |
chmod +x ./gradlew
./gradlew --info test
81 changes: 46 additions & 35 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,50 +1,61 @@
buildscript {
repositories {
mavenCentral()
}
repositories {
mavenCentral()
}
}

plugins {
id 'java'
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.4'
id 'java'
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.4'
}

group = 'kr.co'
version = '0.0.1-SNAPSHOT'

bootJar {enabled = false}
jar {enabled = true}
bootJar { enabled = false }
jar { enabled = true }

allprojects {
group = 'kr.co'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
group = 'kr.co'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
}

subprojects {
apply plugin: "java"
apply plugin: 'java-library'
apply plugin: "io.spring.dependency-management"
apply plugin: "org.springframework.boot"

repositories {
mavenCentral()
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}
apply plugin: "java"
apply plugin: 'java-library'
apply plugin: "io.spring.dependency-management"
apply plugin: "org.springframework.boot"

repositories {
mavenCentral()
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}

test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
showCauses = true
showExceptions = true
showStackTraces = true
exceptionFormat = 'full'
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,31 @@
@Helper
@RequiredArgsConstructor
public class UserSyncHelper {
private final UserService userService;

/**
* 일반 νšŒμ›κ°€μž… μ‹œ 이미 κ°€μž…λœ νšŒμ›μΈμ§€ 확인
*
* @param phone String : μ „ν™”λ²ˆν˜Έ
* @return Pair<Boolean, String> : 이미 κ°€μž…λœ νšŒμ›μΈμ§€ μ—¬λΆ€ (TRUE: κ°€μž…λ˜μ§€ μ•Šμ€ νšŒμ›, FALSE: κ°€μž…λœ νšŒμ›), κ°€μž…λœ νšŒμ›μΈ 경우 νšŒμ› ID λ°˜ν™˜
* @throws UserErrorException : 이미 일반 νšŒμ›κ°€μž…μ„ ν•œ μœ μ €μΈ 경우
*/
public Pair<Boolean, String> isSignedUserWhenGeneral(String phone) {
User user;
try {
user = userService.readUserByPhone(phone);
} catch (GlobalErrorException e) {
log.info("User not found. phone: {}", phone);
return Pair.of(Boolean.TRUE, null);
}
private final UserService userService;

if (user.getPassword() != null) {
log.warn("User already exists. phone: {}", phone);
throw new UserErrorException(UserErrorCode.ALREADY_SIGNUP);
}
/**
* 일반 νšŒμ›κ°€μž… μ‹œ 이미 κ°€μž…λœ νšŒμ›μΈμ§€ 확인
*
* @param phone String : μ „ν™”λ²ˆν˜Έ
* @return Pair<Boolean, String> : 이미 κ°€μž…λœ νšŒμ›μΈμ§€ μ—¬λΆ€ (TRUE: κ°€μž…λ˜μ§€ μ•Šμ€ νšŒμ›, FALSE: κ°€μž…λœ νšŒμ›), κ°€μž…λœ νšŒμ›μΈ 경우 νšŒμ›
* ID λ°˜ν™˜
* @throws UserErrorException : 이미 일반 νšŒμ›κ°€μž…μ„ ν•œ μœ μ €μΈ 경우
*/
public Pair<Boolean, String> isSignedUserWhenGeneral(String phone) {
User user;
try {
user = userService.readUserByPhone(phone);
} catch (GlobalErrorException e) {
log.info("User not found. phone: {}", phone);
return Pair.of(Boolean.FALSE, null);
}

return Pair.of(Boolean.FALSE, user.getUsername());
if (user.getPassword() != null) {
log.warn("User already exists. phone: {}", phone);
throw new UserErrorException(UserErrorCode.ALREADY_SIGNUP);
}

return Pair.of(Boolean.TRUE, user.getUsername());
}
}
Loading

0 comments on commit e09ab66

Please sign in to comment.