-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkinsfile
96 lines (92 loc) · 3.68 KB
/
jenkinsfile
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
pipeline {
agent any
stages {
stage('*branch-name*') {
steps {
echo "${env.BRANCH_NAME}"
sh '''
printenv
# Other commands in this stage
'''
}
}
stage('master') {
when {
branch "master"
}
steps {
echo "${env.BRANCH_NAME}"
echo "${BRANCH_NAME}"
sh '''
printenv
/home/jenkins/.dotnet/tools/dotnet-gitversion /output buildserver
'''
script {
echo "This is Master branch Execution"
def props = readProperties file: 'gitversion.properties'
env.GitVersion_SemVer = props.GitVersion_SemVer
env.GitVersion_FullSemVer = props.GitVersion_FullSemVer
env.GitVersion_BranchName = props.GitVersion_BranchName
env.GitVersion_AssemblySemVer = props.GitVersion_AssemblySemVer
env.GitVersion_MajorMinorPatch = props.GitVersion_MajorMinorPatch
env.GitVersion_Sha = props.GitVersion_Sha
echo env.GitVersion_SemVer
echo env.GitVersion_MajorMinorPatch
echo env.GitVersion_FullSemVer
}
}
}
stage('major') {
when {
branch "major/*"
}
steps {
echo "${env.BRANCH_NAME}"
echo "${BRANCH_NAME}"
sh '''
printenv
/var/jenkins_home/.dotnet/tools/dotnet-gitversion /output buildserver
'''
echo "This is Major branch Execution"
script {
def props = readProperties file: 'gitversion.properties'
env.GitVersion_SemVer = props.GitVersion_SemVer
env.GitVersion_FullSemVer = props.GitVersion_FullSemVer
env.GitVersion_BranchName = props.GitVersion_BranchName
env.GitVersion_AssemblySemVer = props.GitVersion_AssemblySemVer
env.GitVersion_MajorMinorPatch = props.GitVersion_MajorMinorPatch
env.GitVersion_Sha = props.GitVersion_Sha
echo env.GitVersion_SemVer
echo env.GitVersion_MajorMinorPatch
echo env.GitVersion_FullSemVer
}
}
}
stage('hostfix') {
when {
branch "hotfix/*"
}
steps {
echo "${env.BRANCH_NAME}"
echo "${BRANCH_NAME}"
sh '''
printenv
/var/jenkins_home/.dotnet/tools/dotnet-gitversion /output buildserver
'''
echo "This is bugfix branch Execution"
script {
def props = readProperties file: 'gitversion.properties'
env.GitVersion_SemVer = props.GitVersion_SemVer
env.GitVersion_FullSemVer = props.GitVersion_FullSemVer
env.GitVersion_BranchName = props.GitVersion_BranchName
env.GitVersion_AssemblySemVer = props.GitVersion_AssemblySemVer
env.GitVersion_MajorMinorPatch = props.GitVersion_MajorMinorPatch
env.GitVersion_Sha = props.GitVersion_Sha
echo env.GitVersion_SemVer
echo env.GitVersion_MajorMinorPatch
echo env.GitVersion_FullSemVer
}
}
}
}
}