-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: deploy cd 작성 * chore: deploy-dev 수정 * fix: remove set yaml file * fix: remove set yaml file * fix: actions -> action * fix: set up jdk 11 * fix: add distribution * feat: health check 추가 * fix: add run * fix: fix source * fix workflows * Update deploy-dev.yml * Update deploy-dev.yml * gradle cache * Update sonarqube.yml * Update sonarqube.yml * Update deploy-dev.yml * git action test * Update deploy-dev.yml * Update deploy-dev.yml * Update deploy-dev.yml * Update deploy-dev.yml * Update deploy-dev.yml * Update deploy-dev.yml * fix: update docker script * feat: prod logback 추가 * Update logback-spring.xml * add git ignore * Update deploy-dev.yml * fix: redis 주석처리 * fix: docker-compose -> docker run * Update deploy-dev.yml * Update deploy-dev.yml * Update deploy-dev.yml * Update deploy-dev.yml * Update deploy-dev.yml * fix: application.yml * fix: build action * Update deploy-dev.yml * Update deploy-dev.yml * Update deploy-dev.yml
- Loading branch information
Showing
20 changed files
with
230 additions
and
51 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,59 @@ | ||
name: Dev deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
|
||
- name: Gradle Caching | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with gradle | ||
run : ./gradlew build -x test -x asciidoctor | ||
|
||
- name: Build Docker image | ||
run: | | ||
docker login -u ${{ secrets.DOCKERHUB_ID }} -p ${{ secrets.DOCKERHUB_PASSWORD }} | ||
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/mju-graduate-server:v2 \ | ||
--build-arg DATASOURCE_URL=${{ secrets.DATASOURCE_URL }} \ | ||
--build-arg DATASOURCE_USERNAME=${{ secrets.DATASOURCE_USERNAME }} \ | ||
--build-arg DATASOURCE_PASSWORD=${{ secrets.DATASOURCE_PASSWORD }} \ | ||
--build-arg JWT_SECRET=${{ secrets.JWT_SECRET }} . | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/mju-graduate-server:v2 | ||
- name: Docker Deploy executing remote ssh commands using ssh_key | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.WAS_HOST }} | ||
username: ${{ secrets.WAS_USERNAME }} | ||
key: ${{ secrets.WAS_KEY }} | ||
script : | | ||
cd ~/mju-graduate-server | ||
docker stop $(docker ps -a -q) | ||
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/mju-graduate-server:v2 | ||
docker rm -f $(docker ps -a -q) | ||
docker run -d --name mju-graduate-api-server -p 8080:8080 ${{ secrets.DOCKERHUB_USERNAME }}/mju-graduate-server:v2 |
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 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 @@ | ||
FROM openjdk:11 | ||
|
||
ARG JAR_FILE=build/libs/*.jar | ||
ARG PROFILE=prod | ||
ARG DATASOURCE_URL | ||
ARG DATASOURCE_USERNAME | ||
ARG DATASOURCE_PASSWORD | ||
ARG JWT_SECRET | ||
|
||
COPY ${JAR_FILE} app.jar | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["java", "-Dspring.profiles.active=${PROFILE}", "-jar", "/app.jar"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
2 changes: 0 additions & 2 deletions
2
...m/plzgraduate/myongjigraduatebe/auth/adaptor/out/persistence/RefreshTokenRedisEntity.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
30 changes: 30 additions & 0 deletions
30
src/main/java/com/plzgraduate/myongjigraduatebe/core/EnvironmentCheck.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,30 @@ | ||
package com.plzgraduate.myongjigraduatebe.core; | ||
|
||
import javax.annotation.PostConstruct; | ||
|
||
import org.springframework.core.env.Environment; | ||
import org.springframework.stereotype.Component; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
@Component | ||
public class EnvironmentCheck { | ||
private final Environment env; | ||
|
||
public EnvironmentCheck(Environment env) { | ||
this.env = env; | ||
} | ||
|
||
@PostConstruct | ||
public void init() { | ||
String url = env.getProperty("spring.datasource.url"); | ||
String username = env.getProperty("spring.datasource.username"); | ||
String password = env.getProperty("spring.datasource.password"); | ||
String jwtKey = env.getProperty("jwt.secret-key"); | ||
log.info("env url={}", url); | ||
log.info("env username={}", username); | ||
log.info("env password={}", password); | ||
log.info("env jwtKey={}", jwtKey); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/plzgraduate/myongjigraduatebe/core/HealthCheckController.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,16 @@ | ||
package com.plzgraduate.myongjigraduatebe.core; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
import com.plzgraduate.myongjigraduatebe.core.meta.WebAdapter; | ||
|
||
@WebAdapter | ||
@RequestMapping("/api/v1") | ||
public class HealthCheckController { | ||
|
||
@GetMapping("/health") | ||
public String healthCheck() { | ||
return "healthy"; | ||
} | ||
} |
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
Oops, something went wrong.