forked from shunyeka/JenkinsConfigurationUsingApi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotnet_config.xml
128 lines (127 loc) · 4.89 KB
/
dotnet_config.xml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?xml version='1.1' encoding='UTF-8'?>
<flow-definition plugin="[email protected]">
<actions>
<org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobAction plugin="[email protected]"/>
<org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction plugin="[email protected]">
<jobProperties/>
<triggers/>
<parameters/>
<options/>
</org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction>
</actions>
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.jira.JiraProjectProperty plugin="[email protected]">
<siteName>https://shibani.atlassian.net/</siteName>
</hudson.plugins.jira.JiraProjectProperty>
</properties>
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="[email protected]">
<script>pipeline {
agent any
stages {
stage('Source Code Checkkout'){
steps([$class: 'LogstashNotifier']) {
script {
timestamps {
logstash {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'shunyeka-github', url: 'https://github.com/shunyeka/sample-dotnet-project.git']]])
echo "successfully checkout completed"
}
}
}
}
}
stage('Build Project'){
steps([$class: 'LogstashNotifier']) {
script {
timestamps {
logstash {
sh 'dotnet build'
echo 'Successfully dotnet project built'
}
}
}
}
}
stage('Unit Test'){
steps {
script {
timestamps {
logstash {
echo 'UnitTest is executed'
sh 'dotnet test --filter UnitTest || error=true'
}
}
}
}
}
stage('Integration Test'){
steps {
script {
timestamps {
logstash {
echo 'IntegrationTest is executed'
sh 'dotnet test --filter IntegrationTest || error=true'
}
}
}
}
}
stage('Executing Project'){
steps {
script {
timestamps {
logstash {
sh 'dotnet run --project src/SampleApp &'
sh 'failure test'
echo 'Application Deployement is going on....'
echo 'It will take few seconds to complete....'
sleep 30
}
}
}
}
}
stage('Generate HTTP link'){
steps {
script {
timestamps {
logstash {
echo 'http://18.217.32.211:5000/api/products'
}
}
}
}
}
stage('Quit deployement') {
steps {
script {
timestamps {
logstash {
user_input=input message: 'Do you want to Quit the deployement?', submitterParameter: 'user_input'
sh 'pkill -f SampleApp'
}
}
}
}
}
}
post {
always {
echo "This is always executed"
}
failure {
timestamps {
logstash {
echo "BuildFailed"
}
}
}
}
}</script>
<sandbox>true</sandbox>
</definition>
<triggers/>
<disabled>false</disabled>
</flow-definition>