diff --git a/Jenkinsfile b/Jenkinsfile index cc7e844..70ad010 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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: """ +
Build Status: $currentBuild.currentResult
+Project: $JOB_NAME
+Build #: $BUILD_NUMBER
+URL: $BUILD_URL
+ ${CHANGES, showPaths=true} + """, + to: 'khaju452@gmail.com', + replyTo: '$DEFAULT_REPLYTO', + attachLog: true + ) + } catch (Exception e) { + echo "Failed to send email: ${e.toString()}" + } + } } } } diff --git a/login.txt b/login.txt new file mode 100644 index 0000000..fba0480 --- /dev/null +++ b/login.txt @@ -0,0 +1 @@ +New login feature