Skip to content
61 changes: 20 additions & 41 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,34 @@ pipeline {
agent any

stages {
stage('Checkout') {
steps {
checkout scm
echo "Successfully checked out code from ${env.GIT_URL}"
}
}

stage('Build') {
steps {
script {
// Simple build steps that work on most Jenkins environments
echo "Checking what build tools are available..."

// Check for common build files
if (fileExists('pom.xml')) {
echo "Found Maven project"
sh 'mvn --version || echo "Maven not installed"'
} else if (fileExists('build.gradle')) {
echo "Found Gradle project"
sh 'gradle --version || echo "Gradle not installed"'
} else if (fileExists('Makefile')) {
echo "Found Makefile"
sh 'make --version || echo "Make not installed"'
} else {
echo "No standard build files found"
echo "Contents of workspace:"
sh 'ls -la'
}
}
}
}

stage('Results') {
steps {
echo "Build process completed"
echo "Workspace: ${env.WORKSPACE}"
echo "Building..."
}
}
}

post {
always {
echo "Pipeline finished - ${currentBuild.result}"
}
success {
echo "Build succeeded!"
}
failure {
echo "Build failed - please check console output"
script {
try {
emailext(
subject: "$JOB_NAME - Build # $BUILD_NUMBER - $currentBuild.currentResult",
body: """
<p>Build Status: <b>$currentBuild.currentResult</b></p>
<p>Project: $JOB_NAME</p>
<p>Build #: $BUILD_NUMBER</p>
<p>URL: <a href="$BUILD_URL">$BUILD_URL</a></p>
${CHANGES, showPaths=true}
""",
to: 'khaju452@gmail.com',
replyTo: '$DEFAULT_REPLYTO',
attachLog: true
)
} catch (Exception e) {
echo "Failed to send email: ${e.toString()}"
}
}
}
}
}
1 change: 1 addition & 0 deletions login.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
New login feature