Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
prasadharke-tekdi authored Sep 25, 2023
1 parent 1d1814d commit 9392069
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9392069

Please sign in to comment.