Skip to content

Commit

Permalink
[CI/CD] CodeDeploy 환경변수 원복
Browse files Browse the repository at this point in the history
  • Loading branch information
eunsol-an committed May 18, 2024
1 parent 72320e7 commit b8a06d0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ JAR_FILE="$PROJECT_ROOT/application.jar"
APP_LOG="$PROJECT_ROOT/application.log"
ERROR_LOG="$PROJECT_ROOT/error.log"
DEPLOY_LOG="$PROJECT_ROOT/deploy.log"
SPRING_PROFILES_ACTIVE=$(aws ssm get-parameters --output text --region ap-northeast-2 --names SPRING_PROFILES_ACTIVE --query Parameters[0].Value)

TIME_NOW=$(date +%c)

echo "$TIME_NOW > $JAR_FILE file copied." >> $DEPLOY_LOG
cp $PROJECT_ROOT/build/libs/*.jar $JAR_FILE

echo "$TIME_NOW > $JAR_FILE running application." >> $DEPLOY_LOG
nohup java -jar -Dspring.profiles.active=$SPRING_PROFILES_ACTIVE $JAR_FILE > $APP_LOG 2> $ERROR_LOG &
nohup java -jar -Dspring.profiles.active=dev $JAR_FILE > $APP_LOG 2> $ERROR_LOG &

CURRENT_PID=$(pgrep -f $JAR_FILE)
echo "$TIME_NOW > running process: $CURRENT_PID" >> $DEPLOY_LOG

0 comments on commit b8a06d0

Please sign in to comment.