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 {