-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathj2.txt
157 lines (114 loc) · 3.77 KB
/
j2.txt
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
Jenkins Installation in RedHat Linux Server - Mithun Technologies - 9980923226
Mithun Technologies +91-9980923226 [email protected]
http://mithuntechnologies.com/
http://mithuntechnologies.co.in/
Jenkins Installation in RedHat Linux Server
sudo su -
yum install wget -y
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install fontconfig java-11-openjdk -y
yum install jenkins -y
systemctl enable jenkins
systemctl start jenkins
systemctl status jenkins
at September 21, 2022
Email This
BlogThis!
Share to Twitter
Share to Facebook
Share to Pinterest
Labels: Jenkins
Friday, September 11, 2020
Sample Jenkinsfile 1 - Mithun Technologies - 9980923226
Mithun Technologies +91-9980923226 [email protected]
http://mithuntechnologies.com/
http://mithuntechnologies.co.in/
Sample Jenkinsfile
timestamps {
timeout(time: 60, unit: 'SECONDS') {
node
{
try{
/*
def jobname = env.JOB_NAME
def buildnum = env.BUILD_NUMBER.toInteger()
def job = Jenkins.instance.getItemByFullName(jobname)
for (build in job.builds) {
if (!build.isBuilding()) { continue; }
if (buildnum == build.getNumber().toInteger()) { continue; println "equals" }
build.doStop();
}
*/
if (env.BRANCH_NAME=='master'){
echo "GitHub BranhName ${env.BRANCH_NAME}"
properties([
buildDiscarder(logRotator(daysToKeepStr: '1',numToKeepStr: '3',artifactNumToKeepStr: '3',artifactDaysToKeepStr: '1')),
pipelineTriggers([
pollSCM('* * * * *')
]),
])
}
else
{
echo "GitHub BranhName ${env.BRANCH_NAME}"
properties([
buildDiscarder(logRotator(daysToKeepStr: '10',numToKeepStr: '10',artifactNumToKeepStr: '10',artifactDaysToKeepStr: '10')),
pipelineTriggers([
pollSCM('* * * * *')
]),
])
}
echo "GitHub BranhName ${env.BRANCH_NAME}"
echo "Jenkins Job Number ${env.BUILD_NUMBER}"
echo "Jenkins Node Name ${env.NODE_NAME}"
echo "Jenkins Home ${env.JENKINS_HOME}"
echo "Jenkins URL ${env.JENKINS_URL}"
echo "JOB Name ${env.JOB_NAME}"
def mvnHome=tool name: "maven3.6.3"
stage('CheckoutCode')
{
git branch: 'master', credentialsId: '235e277e-7cf7-495e-b970-a22c2478d48c', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git'
}
stage('Build')
{
sh "${mvnHome}/bin/mvn clean package"
}
stage('ExecuteSonarQubeReport')
{
sh "${mvnHome}/bin/mvn sonar:sonar"
}
stage('UploadArtifactIntoNexus')
{
sh "${mvnHome}/bin/mvn deploy"
}
stage('DeployToTomcat')
{
sshagent(['bac46180-c907-4a95-b8a9-417aff7d4f5c'])
{
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.30/webapps/maven-web-application.war"
}
}
stage('SendEmailNotification')
{
emailext body: '''Build is over,
Please check the logs,
Regards,
Mithun Technologies,
9980923226.''', subject: 'Build is Over', to: '[email protected]'
}
}
}
at September 11, 2020
Email This
BlogThis!
Share to Twitter
Share to Facebook
Share to Pinterest
Labels: Jenkins
Saturday, October 26, 2019
Jenkins installation in Linux Server - Mithun Technologies - +91-9980923226
Mithun Technologies +91-9980923226 [email protected]
http://mithuntechnologies.com/
http://mithuntechnologies.co.in/
Login as a root user