Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/heesane/HomeServer
Browse files Browse the repository at this point in the history
  • Loading branch information
heesane committed Nov 28, 2024
2 parents 22b0645 + 8a6c60b commit 1e1ada8
Show file tree
Hide file tree
Showing 370 changed files with 9,226 additions and 6,461 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- 'database/**'
- name: Default Deploy
uses: appleboy/ssh-action@master
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.REMOTE_SSH_HOST }}
username: ${{ secrets.REMOTE_SSH_USERNAME }}
Expand All @@ -56,7 +56,7 @@ jobs:
- name: deploy backend with connecting My PC via SSH
if: steps.changes.outputs.back == 'true'
# 위에 말했던 appleboy의 Action을 사용
uses: appleboy/ssh-action@master
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.REMOTE_SSH_HOST }}
username: ${{ secrets.REMOTE_SSH_USERNAME }}
Expand All @@ -75,7 +75,7 @@ jobs:
- name: deploy frontend with connecting My PC via SSH
if: steps.changes.outputs.frontend == 'true'
# 위에 말했던 appleboy의 Action을 사용
uses: appleboy/ssh-action@master
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.REMOTE_SSH_HOST }}
username: ${{ secrets.REMOTE_SSH_USERNAME }}
Expand All @@ -94,7 +94,7 @@ jobs:
- name: deploy database with connecting My PC via SSH
if: steps.changes.outputs.database == 'true'
# 위에 말했던 appleboy의 Action을 사용
uses: appleboy/ssh-action@master
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.REMOTE_SSH_HOST }}
username: ${{ secrets.REMOTE_SSH_USERNAME }}
Expand All @@ -113,7 +113,7 @@ jobs:
- name: deploy devops with connecting My PC via SSH
if: steps.changes.outputs.devops == 'true'
# 위에 말했던 appleboy의 Action을 사용
uses: appleboy/ssh-action@master
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.REMOTE_SSH_HOST }}
username: ${{ secrets.REMOTE_SSH_USERNAME }}
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mysql/
redis/
pgadmin/
grafana/
jenkins/
pgadmin/
!grafana/env.grafana
prometheus/
Expand All @@ -23,4 +24,6 @@ fast/
__pycache__/
.DS_Store
server.log
back/home_server/gradle.properties
back/home_server/gradle.properties
acme.json
*.log
85 changes: 85 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
pipeline {
agent any

environment {
DOCKER_COMPOSE_FILE = 'back/docker-compose.back.yml'
SPRING_DATASOURCE_PASSWORD="${env.SPRING_DATASOURCE_PASSWORD}"
SPRING_DATASOURCE_URL="${env.SPRING_DATASOURCE_URL}"
SPRING_DATASOURCE_USERNAME="${env.SPRING_DATASOURCE_USERNAME}"
}

stages {
stage('Checkout') {
steps {
cleanWs()
git branch: 'main', url: 'https://github.com/heesane/HomeServer.git'
}
}

stage('Get Commit Message') {
steps {
script {
def gitCommitMessage = sh(
script: "git log -1 --pretty=%B",
returnStdout: true
).trim()
echo "Commit Message: ${gitCommitMessage}"
env.GIT_COMMIT_MESSAGE = gitCommitMessage
}
}
}

stage('Test') {
steps {
script {
sh "docker --version"
sh "docker compose --version"
}
}
}

stage('Build') {
steps {
script {
sh "docker compose -f ${DOCKER_COMPOSE_FILE} build"
}
}
}

stage('Deploy') {
when {
anyOf {
branch 'main'
branch 'local'
branch 'server'
}
}
steps {
script {
sh "docker compose -f ${DOCKER_COMPOSE_FILE} up -d"
}
}
}
}

post {
always {
cleanWs(cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true,
patterns: [[pattern: '.gitignore', type: 'INCLUDE'],
[pattern: '.propsfile', type: 'EXCLUDE']])
}
success {
slackSend (
message: "성공: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL}). 최근 커밋: '${env.GIT_COMMIT_MESSAGE}'",
)
}
failure {
slackSend (
message: "실패: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL}). 최근 커밋: '${env.GIT_COMMIT_MESSAGE}'",
)
}
}
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@

## 현재 작업 목록

- [ ] Docker -> K8S Migration
43 changes: 0 additions & 43 deletions back/docker-compose.back.yml

This file was deleted.

114 changes: 0 additions & 114 deletions back/home_server/build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion back/home_server/settings.gradle

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1e1ada8

Please sign in to comment.