From f404c9ddc9e5b4f2b0a1f7c8acd22471f148664e Mon Sep 17 00:00:00 2001 From: yeopto Date: Thu, 19 Oct 2023 12:56:23 +0900 Subject: [PATCH] =?UTF-8?q?build:=20=EC=A0=A0=ED=82=A8=EC=8A=A4=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=B4=ED=94=84=EB=9D=BC=EC=9D=B8=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkins/frontend-admin-develop.jenkinsfile | 27 +++++++++++++++++++ jenkins/frontend-admin-production.jenkinsfile | 27 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 jenkins/frontend-admin-develop.jenkinsfile create mode 100644 jenkins/frontend-admin-production.jenkinsfile diff --git a/jenkins/frontend-admin-develop.jenkinsfile b/jenkins/frontend-admin-develop.jenkinsfile new file mode 100644 index 00000000..2f73749b --- /dev/null +++ b/jenkins/frontend-admin-develop.jenkinsfile @@ -0,0 +1,27 @@ +pipeline { + agent any + + stages { + stage('github') { + steps { + git branch: 'develop', credentialsId: 'repo-and-hook-access-token-username-and-password', url: 'https://github.com/woowacourse-teams/2023-haru-study/' + } + } + stage('build') { + steps { + dir('admin') { + nodejs('NodeJS 18.16.0') { + sh 'yarn && yarn build' + } + } + } + } + stage('deploy') { + steps { + dir('admin') { + sshPublisher(publishers: [sshPublisherDesc(configName: 'haru-study-develop', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/2023-haru-study/develop/admin', remoteDirectorySDF: false, removePrefix: 'dist', sourceFiles: 'dist/*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)]) + } + } + } + } +} diff --git a/jenkins/frontend-admin-production.jenkinsfile b/jenkins/frontend-admin-production.jenkinsfile new file mode 100644 index 00000000..748bc2e5 --- /dev/null +++ b/jenkins/frontend-admin-production.jenkinsfile @@ -0,0 +1,27 @@ +pipeline { + agent any + + stages { + stage('github') { + steps { + git branch: 'main', credentialsId: 'repo-and-hook-access-token-username-and-password', url: 'https://github.com/woowacourse-teams/2023-haru-study/' + } + } + stage('build') { + steps { + dir('admin') { + nodejs('NodeJS 18.16.0') { + sh 'yarn && yarn build' + } + } + } + } + stage('deploy') { + steps { + dir('admin') { + sshPublisher(publishers: [sshPublisherDesc(configName: 'haru-study-develop', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/2023-haru-study/develop/admin', remoteDirectorySDF: false, removePrefix: 'dist', sourceFiles: 'dist/*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)]) + } + } + } + } +}