forked from jenkins-x/jx-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
48 lines (45 loc) · 1.14 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
pipeline {
agent any
environment {
HUGO_VERSION = "0.26"
GH_CREDS = credentials('jenkins-x-github')
BUILD_NUMBER = "$BUILD_NUMBER"
GIT_USERNAME = "$GH_CREDS_USR"
GIT_API_TOKEN = "$GH_CREDS_PSW"
GITHUB_ACCESS_TOKEN = "$GH_CREDS_PSW"
JOB_NAME = "$JOB_NAME"
BRANCH_NAME = "$BRANCH_NAME"
}
stages {
stage('CI Validate') {
when {
branch 'PR-*'
}
steps {
checkout scm
sh "hugo version"
sh "hugo -d tmp-website --enableGitInfo"
}
}
stage('Regenerate Website') {
when {
branch 'master'
}
steps {
sh "git clone https://github.com/jenkins-x/jx-docs.git"
dir("jx-docs") {
sh "git clone https://github.com/jenkins-x/jenkins-x-website.git"
sh "hugo version"
sh "hugo -d jenkins-x-website --enableGitInfo"
dir("jenkins-x-website") {
sh "jx step git credentials"
sh 'git config credential.helper store'
sh 'git add *'
sh "git commit --allow-empty -a -m \"updated site\""
sh "git push origin"
}
}
}
}
}
}