forked from JJUNGTABLE/Back
[✨] init Project Back
This commit is contained in:
parent
22207f62d6
commit
f59df58823
15
.gitignore
vendored
15
.gitignore
vendored
|
@ -1,6 +1,9 @@
|
|||
./Dockerfile
|
||||
./docker-compose.yml
|
||||
./node_modules
|
||||
./firebaseConfig.js
|
||||
./front
|
||||
./private
|
||||
.DS_Store
|
||||
|
||||
/Dockerfile
|
||||
/docker-compose.yml
|
||||
|
||||
/node_modules
|
||||
|
||||
# 보안 파일 위치 (서버에 직접 저장)
|
||||
/private
|
||||
|
|
49
Jenkinsfile
vendored
Executable file
49
Jenkinsfile
vendored
Executable file
|
@ -0,0 +1,49 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
DOCKER_CONTAINER_NAME = 'jjungtable-node'
|
||||
APP_VOLUME_FRONT = '/home/node/app' // stein-node 컨테이너 내부 경로
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Clone Repository') {
|
||||
steps {
|
||||
git url: 'https://git.ipstein.myds.me/JJUNGTABLE_PJT/Back.git', branch: 'main'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
script {
|
||||
// Docker 컨테이너 ID 가져오기
|
||||
def containerId = sh(script: "docker ps -qf 'name=${DOCKER_CONTAINER_NAME}'", returnStdout: true).trim()
|
||||
if (containerId) {
|
||||
// 컨테이너 내부로 파일 복사
|
||||
sh "docker cp ${WORKSPACE}/. ${containerId}:${APP_VOLUME_FRONT}"
|
||||
// 컨테이너 재시작
|
||||
// sh "docker restart ${containerId}"
|
||||
} else {
|
||||
error "Docker container ${DOCKER_CONTAINER_NAME} not found"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
def containerId = sh(script: "docker ps -qf 'name=${DOCKER_CONTAINER_NAME}'", returnStdout: true).trim()
|
||||
if (containerId) {
|
||||
sh "docker logs ${containerId}"
|
||||
} else {
|
||||
echo "Docker container ${DOCKER_CONTAINER_NAME} not found"
|
||||
}
|
||||
}
|
||||
}
|
||||
failure {
|
||||
echo "Build failed. Check the console output for details."
|
||||
}
|
||||
}
|
||||
}
|
15
index.js
Executable file
15
index.js
Executable file
|
@ -0,0 +1,15 @@
|
|||
// index.js
|
||||
|
||||
import express from 'express';
|
||||
|
||||
const app = express();
|
||||
const port = 7002;
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Hello World!123123123123');
|
||||
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server is running at http://localhost:${port}`);
|
||||
});
|
3205
package-lock.json
generated
Executable file
3205
package-lock.json
generated
Executable file
File diff suppressed because it is too large
Load Diff
18
package.json
Normal file
18
package.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "JJTABLE",
|
||||
"version": "1.0.0",
|
||||
"description": "JJUNG TABLE",
|
||||
"main": "index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node index.js",
|
||||
"build": "echo \"No build step defined\""
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Team.Stein",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.19.2"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user