-
Notifications
You must be signed in to change notification settings - Fork 90
/
Jenkinsfile
33 lines (31 loc) · 1.1 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
properties([
disableConcurrentBuilds(),
buildDiscarder(logRotator(numToKeepStr: '5', daysToKeepStr: '15'))
])
node("docker") { stage('build') { timeout(time: 1, unit: 'HOURS') {
checkout scm
def commit = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
def workDir = pwd()
def tmpDir = pwd(tmp:true)
def img = docker.build("flatironinstitute/selene:${env.BRANCH_NAME}", ".")
img.inside() {
sh '''#!/bin/bash -ex
source activate $CONDA_ENV
python setup.py build_ext --inplace
export PYTHONPATH=$PWD
nosetests
make -C docs html
'''
}
dir("$tmpDir/gh-pages") {
def subdir = env.BRANCH_NAME
git(url: "ssh://[email protected]/FunctionLab/selene.git", branch: "gh-pages", credentialsId: "ssh", changelog: false)
sh "mkdir $subdir || rm -rf $subdir/[[:lower:]_]*"
sh "mv $workDir/docs/build/html/* $subdir"
sh "git add -A $subdir"
sh """
git commit --author='Flatiron Jenkins <[email protected]>' --allow-empty -m 'Generated documentation' -m '${env.BUILD_TAG} ${commit}'
"""
sh "git push origin gh-pages"
}
} } }