mirror of
https://github.com/octocat/Hello-World.git
synced 2026-06-04 22:27:37 +00:00
Add Jenkins pipeline for build and deployment
This commit is contained in:
parent
7fd1a60b01
commit
1bd87090fa
37
Jenkinsfile
vendored
Normal file
37
Jenkinsfile
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Info') {
|
||||||
|
steps {
|
||||||
|
echo "Branch: ${env.BRANCH_NAME}"
|
||||||
|
echo "PR ID: ${env.CHANGE_ID}"
|
||||||
|
echo "Target: ${env.CHANGE_TARGET}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
sh 'echo "Building..."'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Test') {
|
||||||
|
steps {
|
||||||
|
sh 'echo "Running tests..."'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy') {
|
||||||
|
when {
|
||||||
|
expression {
|
||||||
|
env.CHANGE_ID == null &&
|
||||||
|
(env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'master')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
echo "🚀 Deploying from ${env.BRANCH_NAME}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user