Add Jenkins pipeline for CI/CD process
This Jenkinsfile defines a CI/CD pipeline with stages for checkout, build, test, and publish, along with success and failure messages.
This commit is contained in:
43
Jenkinsfile
vendored
Normal file
43
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
environment {
|
||||||
|
GITHUB_ACTOR = 'jakubbbdev'
|
||||||
|
GITHUB_TOKEN = credentials('github-credentials')
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Checkout') {
|
||||||
|
steps {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
sh './gradlew build'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Test') {
|
||||||
|
steps {
|
||||||
|
sh './gradlew test'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Publish') {
|
||||||
|
steps {
|
||||||
|
sh './gradlew publish'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
success {
|
||||||
|
echo '✅ Build erfolgreich!'
|
||||||
|
}
|
||||||
|
failure {
|
||||||
|
echo '❌ Build fehlgeschlagen!'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user