portfolio-admin/Jenkinsfile
Bangara Raju Kottedi a6e48d6b2b
Some checks failed
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head There was a failure building this commit
fix: remove redundant ownership change command in deployment stage
2026-02-16 18:39:34 +05:30

70 lines
1.5 KiB
Groovy

pipeline {
agent { label 'built-in' }
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
}
environment {
DEPLOY_PATH = "/var/www/bangararaju.kottedi.in/admin"
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Inject Environment File') {
steps {
configFileProvider(
[configFile(fileId: 'admin-uat-properties',
targetLocation: 'src/environments/environment.ts',
replaceTokens: true)]
) {
echo "Environment file injected"
}
}
}
stage('Build Angular') {
steps {
sh '''
npm install
ng build --configuration production --base-href /admin/
'''
}
}
stage('Deploy') {
steps {
sh '''
rm -rf $DEPLOY_PATH/*
cp -r dist/portfolio-admin/browser/* $DEPLOY_PATH/
systemctl reload nginx
'''
}
}
stage('Health Check') {
steps {
sh '''
sleep 2
curl -f https://bangararaju-uat.kottedi.in/admin
'''
}
}
}
post {
failure {
echo "Deployment failed!"
}
success {
echo "Deployment successful!"
}
}
}