From 5e063489969aa135222b5a0d827b46563a4164c8 Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Sun, 10 Oct 2021 09:29:40 +0200 Subject: [PATCH] add jenkins file --- customer/jenkins/Jenkinsfile | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 customer/jenkins/Jenkinsfile diff --git a/customer/jenkins/Jenkinsfile b/customer/jenkins/Jenkinsfile new file mode 100644 index 0000000..01f7289 --- /dev/null +++ b/customer/jenkins/Jenkinsfile @@ -0,0 +1,49 @@ +pipeline { + agent { + docker { image 'node:14-alpine' } + } + + stages { + stage('checkout') { + steps{ + git credentialsId: 'gitlab_token_api', poll: false, url: 'https://gitlab.com/group_rocho02/fitness-web.git' + } + } + stage('Hello') { + steps { + + sh 'node --version' + + } + } + stage('Build') { + steps { + + sh '''cd customer/app + npm i + npm run build:prod-cutler-movar + cd dist + tar -czvf app.tar.gz app + + + ''' + } + + + } + stage('upload') { + steps { + + sshPublisher(publishers: [sshPublisherDesc(configName: 'websiter.hu', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: ''' + pwd + #bash /home/fitnessa/backup_fw.sh + cd rocho/work + tar -xvf app.tar.gz + chown -R fitnessa.fitnessa app + rm -rf/home/fitnessa/public_html/group-training + mv app /home/fitnessa/public_html/group-training + ''', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: 'rocho/work', remoteDirectorySDF: false, removePrefix: 'customer/app/dist', sourceFiles: 'customer/app/dist/app.tar.gz')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)]) + } + } + } +}