Skip to content

Commit

Permalink
Merge pull request #13 from team-tiki-taka/dev
Browse files Browse the repository at this point in the history
🚀  feat(prod): 배포 세팅 완료
  • Loading branch information
gengminy authored Sep 21, 2022
2 parents 7e5511a + 9d3a6e4 commit 35a253e
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 91 deletions.
2 changes: 1 addition & 1 deletion .ebextensions/00-makeFiles.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ files:

# run app
killall java
java -Dfile.encoding=UTF-8 -jar $JAR_PATH
java -Dfile.encoding=UTF-8 -Dspring.profiles.active=$SPRING_PROFILE -jar $JAR_PATH
10 changes: 9 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
java-version: '11'
distribution: 'temurin'

#Create dotenv file
- name: Make env properties
run: |
touch ./src/main/resources/application-prod.yml
echo "$ENV_PROPERTIES" > ./src/main/resources/application-prod.yml
env:
ENV_PROPERTIES: ${{ secrets.ENV_PROPERTIES }}

#Grant gradlew Permission
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
Expand Down Expand Up @@ -55,7 +63,7 @@ jobs:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: naechinso
environment_name: Naechinso-env
environment_name: Naechinso-env-1
version_label: github-action-${{ steps.current-time.outputs.formattedTime }}
region: ap-northeast-2
deployment_package: deploy/deploy.zip
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ out/

### dotenv ###
.env.*
.env
.env
!**/src/main/resources/application-**.yml
src/main/resources/application-dev.yml
src/main/resources/application-local.yml
src/main/resources/application-prod.yml
4 changes: 2 additions & 2 deletions .platform/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ http {
}

upstream springboot {
server 127.0.0.1:8080;
server localhost:8080;
keepalive 1024;
}

Expand All @@ -34,7 +34,7 @@ http {
listen [::]:80 default_server;

location / {
proxy_pass https://api.naechinso.com;
proxy_pass http://springboot;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class SmsCertificationServiceImpl implements SmsCertificationService {
private final String VERIFICATION_PREFIX = "sms:";
private final int VERIFICATION_TIME_LIMIT = 3 * 60;

@Value("${SPRING_PROFILE}")
@Value("${spring.profiles.active}")
private String springProfile;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
public class JwtTokenProvider {
private final RedisService redisService;
/** 토큰 비밀 키 */
@Value("${JWT_SECRET_KEY}")
@Value("${jwt.secret-key}")
private String JWT_SECRET;

/** 토큰 유효 시간 (ms) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
@RequiredArgsConstructor
public class SmsServiceImpl implements SmsService {
private final WebClient webClient;
@Value("${NAVER_ACCESS_KEY}")
@Value("${naver.sms.access-key}")
private String accessKey;
@Value("${NAVER_SECRET_KEY}")
@Value("${naver.sms.secret-key}")
private String secretKey;
@Value("${NAVER_SMS_ID}")
@Value("${naver.sms.id}")
private String serviceId;
@Value("${NAVER_SMS_PHONE_NUMBER}")
@Value("${naver.sms.phone}")
private String senderNumber;

/**
Expand Down
24 changes: 0 additions & 24 deletions src/main/resources/application-dev.yml

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/resources/application-local.yml

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/resources/application-prod.yml

This file was deleted.

10 changes: 2 additions & 8 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
server:
port: ${PORT:8080}
port: 8080

spring:
profiles:
active: ${SPRING_PROFILE}
# .env import
config:
import: optional:file:.env[.properties]
active: local
# Using POSTGRESQL
datasource:
url: jdbc:postgresql://${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
username: ${POSTGRES_USER}
password: ${POSTGRES_PASSWORD}
driver-class-name: org.postgresql.Driver

jpa:
Expand Down

0 comments on commit 35a253e

Please sign in to comment.