-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci_file
More file actions
44 lines (41 loc) · 1.28 KB
/
ci_file
File metadata and controls
44 lines (41 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
pipeline {
agent any
parameters { string(name: 'Branch_Name', defaultValue: 'master', description: 'Enter your branch name to build') }
stages {
stage('Hello') {
steps {
echo 'Hello World'
}
}
stage('Hi'){
steps{
echo 'Hi, my name is Isaac Dadah Wolofar'
}
}
stage('Git checkout'){
steps{
git branch: '$Branch_Name', changelog: false, credentialsId: 'dadah-git-cred', poll: false, url: 'https://github.com/Dadah3227/devops-coding.git'
}
}
stage('run on condition'){
when {
expression{
env.Branch_Name=='master' // only on branch 'master it will build. NOT any other branch'
}
}
steps{
echo "Hey, I am main branch...and there's another branch called dev that is feature branch"
}
}
stage('pull scm from git'){
steps{
echo 'new push in github'
}
}
} // stage ending
post { // Note: this post stage is always added after the last stage
always {
echo 'I will always say hello'
}
}
} // pipeline ending