Skip to content

Commit

Permalink
배포 1.1.0
Browse files Browse the repository at this point in the history
Merge pull request #99 from team-crews/dev
  • Loading branch information
jongmee authored Nov 6, 2024
2 parents 3564b9b + f7bdded commit 5dcd9e1
Show file tree
Hide file tree
Showing 168 changed files with 8,651 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Bug fix
about: fix bug
title: 'fix: '
labels: bug
assignees: jongmee

---

## Problem 🐞

>문제 상황을 설명해주세요
## Progress 🐢

- [ ] todo1
- [ ] todo2
- [ ] todo3

## Help ❗️

아직 못 고쳤거나, 왜 고쳐진지 모르겠다면 작성해주세요.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature
about: new feature
title: 'feat: '
labels: enhancement
assignees: jongmee

---

## Description ✏️

>description
## Progress 🐢

- [ ] todo1
- [ ] todo2
- [ ] todo3

## Need to improve 🥕

추후 개선해야 할 사항이 있다면 작성해주세요.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Description 📒

>description
## Issue 💬

#
82 changes: 82 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: crews backend deploy

on:
push:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.ACTION_TOKEN }}
submodules: true

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up MySQL
uses: mirromutth/[email protected]
with:
mysql database: 'crews'
mysql user: ${{ secrets.TEST_DB_USERNAME }}
mysql password: ${{ secrets.TEST_DB_PASSWORD }}

- name: Run Test And Create API Documentation
run: ./gradlew openapi3

- name: Build with Gradle
run: ./gradlew bootJar -x test

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

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker Image And Push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ secrets.DOCKER_PROD_SERVER_IMAGE_NAME }}
platforms: |
linux/amd64
linux/arm64
deploy:
needs: build
runs-on: ubuntu-latest
steps:

- name: deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ubuntu
key: ${{ secrets.KEY }}
script: |
cd /home/ubuntu
sudo chmod 666 /var/run/docker.sock
docker rm -f $(docker ps -qa)
docker pull ${{ secrets.DOCKER_PROD_SERVER_IMAGE_NAME }}
docker run -d -p 8080:8080 --name crews-server \
-e JAVA_OPTS="-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0" \
-e SPRING_PROFILES_ACTIVE=prod \
${{ secrets.DOCKER_PROD_SERVER_IMAGE_NAME }}
docker image prune -f
docker volume prune -f
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: crews backend ci

on:
pull_request:
branches: [ "dev", "main" ]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.ACTION_TOKEN }}
submodules: true

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up MySQL
uses: mirromutth/[email protected]
with:
mysql database: 'crews'
mysql user: ${{ secrets.TEST_DB_USERNAME }}
mysql password: ${{ secrets.TEST_DB_PASSWORD }}

- name: Set up Redis
uses: supercharge/[email protected]
with:
redis-port: 36379

- name: Run Test
run: ./gradlew clean test
62 changes: 62 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: crews backend development version distribute

on:
push:
branches: [ "dev" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.ACTION_TOKEN }}
submodules: true

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up MySQL
uses: mirromutth/[email protected]
with:
mysql database: 'crews'
mysql user: ${{ secrets.TEST_DB_USERNAME }}
mysql password: ${{ secrets.TEST_DB_PASSWORD }}

- name: Set up Redis
uses: supercharge/[email protected]
with:
redis-port: 36379

- name: Run Test And Create API Documentation
run: ./gradlew openapi3

- name: Build with Gradle
run: ./gradlew bootJar -x test

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

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker Image And Push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ secrets.DOCKER_SERVER_IMAGE_NAME }}
platforms: |
linux/amd64
linux/arm64
24 changes: 24 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: release tag

on:
push:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

- name: Extract Version Information
run: echo "##[set-output name=version;]$(echo '${{ github.event.head_commit.message }}' | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
id: extract_version_name

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
with:
tag_name: ${{ steps.extract_version_name.outputs.version }}
release_name: ${{ steps.extract_version_name.outputs.version }}
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/main/resources/config"]
path = src/main/resources/config
url = https://github.com/team-crews/crews-config
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM openjdk:17
ARG JAR_FILE=/build/libs/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar /app.jar"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Crews

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 5dcd9e1

Please sign in to comment.