Skip to content

Commit

Permalink
Create Jenkinsfile
Browse files Browse the repository at this point in the history
Signed-off-by: Anoint <72187543+whoami-anoint@users.noreply.github.com>
  • Loading branch information
whoami-anoint authored Jan 29, 2024
1 parent 17daa70 commit d7dc5e6
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
pipeline {
agent any

stages {
stage('Setup') {
steps {
script {
// Clone the repository
try {
git branch: 'main', url: 'https://github.com/whoami-anoint/Probe'
} catch (Exception e) {
echo "Error: Failed to clone repository - ${e.message}"
}
}
}
}

stage('Prepare') {
steps {
script {
// Download requirements.txt
try {
sh 'wget https://raw.githubusercontent.com/whoami-anoint/Probe/main/requirements.txt'
} catch (Exception e) {
echo "Error: Failed to download requirements.txt - ${e.message}"
}

// Make shell scripts executable
try {
sh 'chmod +x make.sh probe.sh'
} catch (Exception e) {
echo "Error: Failed to chmod +x for shell scripts - ${e.message}"
}
}
}
}

stage('Build') {
steps {
script {
// Run make.sh
try {
sh './make.sh'
} catch (Exception e) {
echo "Error: Failed to execute make.sh - ${e.message}"
}
}
}
}

stage('Test') {
steps {
script {
// Run probe.sh
try {
sh './probe.sh'
} catch (Exception e) {
echo "Error: Failed to execute probe.sh - ${e.message}"
}
}
}
}

stage('Cleanup') {
steps {
script {
// Clean up workspace
deleteDir()
}
}
}
}

post {
success {
echo 'Pipeline has completed successfully!'
}

failure {
echo 'Pipeline has failed!'
}
}
}

0 comments on commit d7dc5e6

Please sign in to comment.