-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from kkkapuq/main
stage to main merge
- Loading branch information
Showing
198 changed files
with
10,265 additions
and
1,008 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Orury CD with Gradle | ||
|
||
env: | ||
PROJECT_NAME: orury | ||
BUCKET_NAME: orury-bepo-bucket | ||
CODE_DEPLOY_APP_NAME: orury-code-deploy | ||
DEPLOYMENT_GROUP_NAME: orury-code-deploy-group | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- run: touch ./orury-client/src/main/resources/application-secret.properties | ||
- run: echo "${{ secrets.APPLICATION_SECRET }}" > ./orury-client/src/main/resources/application-secret.properties | ||
- run: cat ./orury-client/src/main/resources/application-secret.properties | ||
|
||
- name: Run chmod to make gradlew executable | ||
run: chmod +x ./gradlew | ||
shell: bash | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew build | ||
shell: bash | ||
|
||
- name: Make zip file | ||
run: zip -r ./$GITHUB_SHA.zip . | ||
shell: bash | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} # 등록한 Github Secret이 자동으로 불려온다. | ||
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }} # 등록한 Github Secret이 자동으로 불려온다. | ||
aws-region: ap-northeast-2 | ||
|
||
- name: Upload to S3 | ||
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$BUCKET_NAME/$PROJECT_NAME/$GITHUB_SHA.zip | ||
|
||
- name: Code Deploy | ||
run: aws deploy create-deployment --application-name $CODE_DEPLOY_APP_NAME --deployment-config-name CodeDeployDefault.OneAtATime --deployment-group-name $DEPLOYMENT_GROUP_NAME --s3-location bucket=$BUCKET_NAME,bundleType=zip,key=$PROJECT_NAME/$GITHUB_SHA.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: 0.0 | ||
os: linux | ||
files: | ||
- source: / | ||
destination: /home/ec2-user/orury/ | ||
overwrite: yes | ||
|
||
permissions: | ||
- object: / | ||
pattern: "**" | ||
mode: '755' | ||
owner: ec2-user | ||
group: ec2-user | ||
|
||
hooks: | ||
BeforeInstall: | ||
- location: scripts/deploy.sh | ||
timeout: 60 | ||
runas: ec2-user | ||
command: chmod +x /home/ec2-user/orury/scripts/deploy.sh | ||
|
||
ApplicationStart: | ||
- location: scripts/deploy.sh | ||
timeout: 60 | ||
runas: ec2-user | ||
#hooks: | ||
# ApplicationStart: | ||
# - location: scripts/run_new_was.sh | ||
# timeout: 180 | ||
# runas: ec2-user | ||
# - location: scripts/health_check.sh | ||
# timeout: 180 | ||
# runas: ec2-user | ||
# - location: scripts/switch.sh | ||
# timeout: 180 | ||
# runas: ec2-user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...n/src/main/java/org/fastcampus/oruryadmin/global/security/jwt/JwtAccessDeniedHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../main/java/org/fastcampus/oruryadmin/global/security/jwt/JwtAuthenticationEntryPoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
orury-batch/src/main/java/org/fastcampus/orurybatch/client/KakaoMapClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.fastcampus.orurybatch.client; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.fastcampus.orurybatch.dto.KakaoMapGymResponse; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.HttpHeaders; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
|
||
@Slf4j | ||
@Configuration | ||
public class KakaoMapClient { | ||
@Value("${spring.kakao.key}") | ||
private String env; | ||
|
||
@Value("${spring.kakao.baseurl}") | ||
private String BASE_URL; | ||
|
||
@Bean | ||
public WebClient.Builder webClientBuilder() { | ||
return WebClient.builder(); | ||
} | ||
|
||
@Bean | ||
public WebClient webClient() { | ||
return webClientBuilder() | ||
.baseUrl(BASE_URL) | ||
.defaultHeader(HttpHeaders.AUTHORIZATION, env) | ||
.build(); | ||
} | ||
|
||
public KakaoMapGymResponse searchGyms(String location, int page) { | ||
String queryParam = "서울시" + location + "클라이밍"; | ||
log.info("queryParam: {}, page: {}", queryParam, page); | ||
return webClient().get() | ||
.uri(uriBuilder -> uriBuilder | ||
.queryParam("query", queryParam) | ||
.queryParam("page", page) | ||
.build() | ||
) | ||
.retrieve() | ||
.bodyToMono(KakaoMapGymResponse.class) | ||
.block(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...tch/src/main/java/org/fastcampus/orurybatch/config/JobCompletionNotificationListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.fastcampus.orurybatch.config; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.batch.core.BatchStatus; | ||
import org.springframework.batch.core.JobExecution; | ||
import org.springframework.batch.core.JobExecutionListener; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Slf4j | ||
@Component | ||
public class JobCompletionNotificationListener implements JobExecutionListener { | ||
|
||
// private final JdbcTemplate jdbcTemplate; | ||
// | ||
// public JobCompletionNotificationListener(JdbcTemplate jdbcTemplate) { | ||
// this.jdbcTemplate = jdbcTemplate; | ||
// } | ||
|
||
@Override | ||
public void afterJob(JobExecution jobExecution) { | ||
if (jobExecution.getStatus() == BatchStatus.COMPLETED) { | ||
log.info("!!! JOB FINISHED! Time to verify the results"); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
orury-batch/src/main/java/org/fastcampus/orurybatch/config/JpaAuditingConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.fastcampus.orurybatch.config; | ||
|
||
import org.springframework.boot.autoconfigure.domain.EntityScan; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
|
||
@Configuration | ||
@EntityScan(basePackages = "org.fastcampus.orurydomain") | ||
@EnableJpaRepositories(basePackages = "org.fastcampus.orurydomain") | ||
@EnableJpaAuditing | ||
public class JpaAuditingConfig { | ||
|
||
} |
Oops, something went wrong.