Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CD Workflow 수정 #21

Merged
merged 12 commits into from
Mar 26, 2024
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
Loading