forked from aarmey/ml-for-bioe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.jenkinsfile
executable file
·45 lines (45 loc) · 1.33 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
pipeline {
agent any
stages {
stage('Setup') {
steps {
sh 'git clean -ffdx'
sh 'git status'
dir('website') {
sh 'bundle install --path ~/.gem'
}
}
}
stage('Build') {
steps {
sh 'make -j 24'
dir('website') {
sh 'bundle exec jekyll build'
}
}
}
stage('Test'){
steps {
dir('website') {
sh 'bundle exec htmlproofer --check-html --url-ignore "/ml-for-bioe/" --http-status-ignore "412, 400" --timeframe 24w --assume-extension ./_site'
}
}
}
stage('Report') {
steps {
archiveArtifacts artifacts: 'lectures/*.pdf', onlyIfSuccessful: true
recordIssues(tools: [taskScanner(highTags: 'TODO,FIXME,XXX', includePattern: '**/*.py, **/*.md', normalTags: 'CITE')])
}
}
stage('Deploy') {
when { expression { env.BRANCH_NAME == 'master' } }
steps {
dir('website/_site') {
sh 'git init; git config user.name "Jenkins CI"; git config user.email "[email protected]"'
sh 'git remote add upstream "[email protected]:aarmey/ml-for-bioe.git"; git fetch upstream; git reset upstream/gh-pages; touch .; git add .'
sh 'git commit -m "Jenkins $BUILD_ID auto-pushed"; git push --force -q upstream HEAD:gh-pages'
}
}
}
}
}