Skip to content

Commit

Permalink
Api-v0.0.1
Browse files Browse the repository at this point in the history
Api-v0.0.1
  • Loading branch information
ImNM authored May 20, 2023
2 parents 87b3e0e + dc24ea2 commit 8b52c68
Show file tree
Hide file tree
Showing 209 changed files with 5,954 additions and 93 deletions.
File renamed without changes.
9 changes: 6 additions & 3 deletions .github/workflows/BuildApiServer.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Build Api Server
on:
push:
branches:
- develop
tags:
- Api-v*.*.*
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -35,6 +35,9 @@ jobs:
RELEASE_VERSION_WITHOUT_V="$(cut -d'v' -f2 <<< ${GITHUB_REF#refs/*/})"
echo "RELEASE_VERSION_WITHOUT_V=$RELEASE_VERSION_WITHOUT_V" >> $GITHUB_ENV
- name: Start containers # test 돌릴때 레디스 필요
run: docker-compose up -d

- name: Gradle Build
uses: gradle/gradle-build-action@v2

Expand All @@ -58,4 +61,4 @@ jobs:
context: ./Whatnow-Api
# image push 최적화
push: true
tags: ${{secrets.NCP_CONTAINER_REGISTRY}}/deploy-test:latest
tags: ${{secrets.NCP_CONTAINER_REGISTRY}}/whatnow-api:${{ steps.get_version.outputs.VERSION }}
64 changes: 64 additions & 0 deletions .github/workflows/BuildLocationServer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build Location Server
on:
push:
tags:
- Api-v*.*.*
jobs:
build:
runs-on: ubuntu-latest
env:
image: deploy-test
tag: latest
strategy:
#모듈들 명
matrix:
kotlin-version: [ 1.5.31 ]
java-version: [ 11 ]
outputs:
#버전
VERSION: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: Check Out The Repository
uses: actions/checkout@v3

- name: Set up Kotlin
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
kotlin-version: ${{ matrix.kotlin-version }}
distribution: 'adopt'

# branch tags -> version (without v)
- name: Get the version
id: get_version
run: |
RELEASE_VERSION_WITHOUT_V="$(cut -d'v' -f2 <<< ${GITHUB_REF#refs/*/})"
echo "RELEASE_VERSION_WITHOUT_V=$RELEASE_VERSION_WITHOUT_V" >> $GITHUB_ENV
- name: Start containers # test 돌릴때 레디스 필요
run: docker-compose up -d

- name: Gradle Build
uses: gradle/gradle-build-action@v2

- name: Execute Gradle build
run: ./gradlew build :Whatnow-Api:build --no-daemon

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to NCP Registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.NCP_CONTAINER_REGISTRY }}
username: ${{ secrets.NCP_ACCESS_KEY }}
password: ${{ secrets.NCP_SECRET_KEY }}

# docker build / push to NCP Container Registry
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./Whatnow-Location
# image push 최적화
push: true
tags: ${{secrets.NCP_CONTAINER_REGISTRY}}/whatnow-location:${{steps.get_version.outputs.VERSION }}
50 changes: 50 additions & 0 deletions .github/workflows/CI_Check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI_Check
on:
pull_request:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
kotlin-version: [ 1.5.31 ]
java-version: [ 11 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Kotlin
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
kotlin-version: ${{ matrix.kotlin-version }}
distribution: 'adopt'

- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Start containers # test 돌릴때 레디스 필요
run: docker-compose up -d

- name: spotless check
run: ./gradlew spotlessCheck --no-daemon

- name: test and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew test sonar --info --stacktrace --no-daemon
51 changes: 51 additions & 0 deletions .github/workflows/develop-branch-test-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# 디밸롭 메인 브런치의 총 테스트 커버리지 측정을 위한 ci workflow
name: develop-branch-test-coverage
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
kotlin-version: [ 1.5.31 ]
java-version: [ 11 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Kotlin
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
kotlin-version: ${{ matrix.kotlin-version }}
distribution: 'adopt'

- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Start containers # test 돌릴때 레디스 필요
run: docker-compose up -d

- name: test
run: ./gradlew test --info --stacktrace --no-daemon

- name: analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonar --info --stacktrace --no-daemon
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ out/

### VS Code ###
.vscode/

.env
.env.*
5 changes: 0 additions & 5 deletions Dockerfile

This file was deleted.

14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# 13th-6team-server
66666년만에 환생한 흑마법사
66666년만에 환생한 흑마법사


[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=depromeet_Whatnow-Api&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=depromeet_Whatnow-Api)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=depromeet_Whatnow-Api&metric=coverage)](https://sonarcloud.io/summary/new_code?id=depromeet_Whatnow-Api)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=depromeet_Whatnow-Api&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=depromeet_Whatnow-Api)


## 서비스
- Whatnow-Api
- Whatnow-Location


12 changes: 8 additions & 4 deletions Whatnow-Api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FROM adoptopenjdk/openjdk11
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} /app.jar
ENTRYPOINT ["java","-jar"]
EXPOSE 8080

EXPOSE 8080

COPY ./build/libs/*.jar app.jar
ARG PROFILE=prod
ENV PROFILE=${PROFILE}

ENTRYPOINT ["java","-Dspring.profiles.active=${PROFILE}", "-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
10 changes: 10 additions & 0 deletions Whatnow-Api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
dependencies {
implementation(project(":Whatnow-Domain"))
implementation(project(":Whatnow-Infrastructure"))
implementation(project(":Whatnow-Common"))

implementation ("io.jsonwebtoken:jjwt-api:0.11.5")
runtimeOnly ( "io.jsonwebtoken:jjwt-impl:0.11.5")
runtimeOnly ( "io.jsonwebtoken:jjwt-jackson:0.11.5")

implementation("org.springdoc:springdoc-openapi-ui:1.6.12")
implementation("org.springframework.boot:spring-boot-starter-security")
}
1 change: 0 additions & 1 deletion Whatnow-Api/settings.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.depromeet.promiseapi
package com.depromeet.whatnow

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication

@SpringBootApplication
class PromiseApiApplication
class WhatnowApiApplication

fun main(args: Array<String>) {
runApplication<PromiseApiApplication>(*args)
runApplication<WhatnowApiApplication>(*args)
}
Loading

0 comments on commit 8b52c68

Please sign in to comment.