forked from project-hop/hop-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
56 lines (54 loc) · 1.41 KB
/
Jenkinsfile
File metadata and controls
56 lines (54 loc) · 1.41 KB
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
pipeline {
agent any
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('Start Website Build') {
when {
branch 'master'
}
steps {
script {
build job: "hop-website/master", wait: false
}
}
}
}
}