forked from 200106-uta-go/project-3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
49 lines (49 loc) · 1.08 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
pipeline {
agent {
node {
label 'my-defined-label'
customWorkspace '/var/jenkins_home/go/src/github.com/200106-uta-go/project-3'
}
}
tools {
go 'Go'
}
stages {
stage('Checkout') {
steps {
//sh 'su apt-get install build-essential -y'
sh 'git init'
echo 'Checking out code...'
checkout scm
}
}
stage('Build') {
steps {
echo 'Building project...'
sh 'go get -d ./...'
sh 'go build ./...'
}
}
stage('Test') {
steps {
echo 'Testing project...'
//sh 'go test ./... -v'
}
}
}
post {
failure {
discordSend description: "Jenkins Pipeline Build",
footer: "Build Failed: " + env.GET_COMMIT,
link: env.BUILD_URL,
result: currentBuild.currentResult,
title: JOB_NAME,
webhookURL: "https://discordapp.com/api/webhooks/685969377430077573/a0Nno_j58sYJS3QScZIE7v45GZYfG8JDSbJT112cWFiuDfh_eu53XSI7u4JC5XO6Lgf0",
image: "https://engineering.taboola.com/wp-content/uploads/2018/05/tidhar-post-featured-665x408.jpg"
}
always {
echo 'Job complete, deleting directory...'
deleteDir()
}
}
}