This repository has been archived by the owner on Nov 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Jenkinsfile
89 lines (85 loc) · 2.55 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
pipeline {
agent any
tools {
maven 'M3'
}
options {
buildDiscarder(
logRotator(artifactNumToKeepStr: '5', numToKeepStr: '10')
)
timestamps()
}
stages {
stage('create local branch'){
when {
branch 'master'
}
steps{
sh('git checkout -B master')
}
}
stage('Generate navigation'){
when {
branch 'master'
}
steps{
sh('./generate_navigation.sh')
}
}
stage('Push') {
when {
branch 'master'
}
environment {
GIT_AUTH = credentials('1f897a89-aed2-478f-9efc-29ae9b6aaa7c')
}
steps {
sh('''
git config --local credential.helper "!f() { echo username=\\$GIT_AUTH_USR; echo password=\\$GIT_AUTH_PSW; }; f"
ls
git add .;
git commit -m "Jenkins Update navigation" || echo;
git push origin HEAD:master || echo;
''')
}
}
stage('artifactory build') {
steps {
rtMavenResolver (
id: 'hop-resolver',
serverId: 'ART',
releaseRepo: 'hop-releases',
snapshotRepo: 'hop-snapshots'
)
rtMavenDeployer (
id: 'hop-deployer',
serverId: 'ART',
releaseRepo: 'hop-releases-local',
snapshotRepo: 'hop-snapshots-local',
// By default, 3 threads are used to upload the artifacts to Artifactory. You can override this default by setting:
threads: 6
)
rtMavenRun (
// Tool name from Jenkins configuration.
tool: 'M3',
pom: 'pom.xml',
goals: 'clean install',
// Maven options.
opts: '-Xms1024m -Xmx4096m',
resolverId: 'hop-resolver',
deployerId: 'hop-deployer'
)
}
}
stage('Start Website Build') {
when {
branch 'master'
}
steps {
script {
build job: "hop-website/master", wait: false
}
}
}
}
}