From 9392069e41d970dc19b3c86a6dd62af9a70dd132 Mon Sep 17 00:00:00 2001 From: prasadharke-tekdi <131845849+prasadharke-tekdi@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:58:52 +0530 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 78 ++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4d82d611..d9620855 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,51 +20,51 @@ pipeline { } } - // stage('Building Code') { - // steps { - // dir('/var/lib/jenkins/workspace/prod-frontend') { - // sh 'rm -rf node_modules' - // sh 'rm -f package-lock.json' // Corrected to remove the file - // sh 'ls' - // sh 'yarn install' - // sh 'yarn workspace @shiksha/common-lib build' - // sh 'yarn install' - // sh 'yarn build' - // } - // } - // } + stage('Building Code') { + steps { + dir('/var/lib/jenkins/workspace/prod-frontend') { + sh 'rm -rf node_modules' + sh 'rm -f package-lock.json' // Corrected to remove the file + sh 'ls' + sh 'yarn install' + sh 'yarn workspace @shiksha/common-lib build' + sh 'yarn install' + sh 'yarn build' + } + } + } - // stage('Copy Package') { - // steps { - // sh './scripts/pack-prod-build.sh' - // // sh "rsync shiksha-ui.tar:/var/www/alt.uniteframework.io/shiksha-ui.tar" - // } - // } + stage('Copy Package') { + steps { + sh './scripts/pack-prod-build.sh' + // sh "rsync shiksha-ui.tar:/var/www/alt.uniteframework.io/shiksha-ui.tar" + } + } - // stage('Deploy') { - // steps { - // script { - // dir('/var/lib/jenkins/build') { - // sh 'rm -rf *' - // sh 'cp /var/lib/jenkins/workspace/prod-frontend/shiksha-ui.tar .' - // sh 'tar -xvf shiksha-ui.tar' - // } - // } - // } - // } - stage ('deployment on s3') { + stage('Deploy') { steps { - dir('/var/lib/jenkins/build'){ - script { - withAWS(region:'ap-south-1',credentials:'prasad-aws-id') { - s3Delete(bucket: 'altprodfrontend', path:'**/*') - s3Upload(bucket: 'altprodfrontend', workingDir:'.', includePathPattern:'**/*', excludePathPattern:'.git/*, **/node_modules/**'); - } - } + script { + dir('/var/lib/jenkins/build') { + sh 'rm -rf *' + sh 'cp /var/lib/jenkins/workspace/prod-frontend/shiksha-ui.tar .' + sh 'tar -xvf shiksha-ui.tar' } + } } } - + stage('deployment on s3') { + steps { + dir('/var/lib/jenkins/build') { + script { + withAWS(region: 'ap-south-1', credentials: 'prasad-aws-id') { + s3Delete(bucket: 'altprodfrontend', path: '**/*') + s3Upload(bucket: 'altprodfrontend', workingDir: '.', includePathPattern: '**/*', excludePathPattern: '.git/*, **/node_modules/**') + } + } + } + } +} + // stage('Deployment') { // steps {