forked from cognitedata/cognite-python-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
50 lines (48 loc) · 1.64 KB
/
Jenkinsfile
File metadata and controls
50 lines (48 loc) · 1.64 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
@Library('jenkins-helpers@v0.1.12') _
def label = "cognite-python-docs-${UUID.randomUUID().toString()}"
podTemplate(
label: label,
annotations: [
podAnnotation(key: "jenkins/build-url", value: env.BUILD_URL ?: ""),
podAnnotation(key: "jenkins/github-pr-url", value: env.CHANGE_URL ?: ""),
],
containers: [
containerTemplate(name: 'python',
image: 'eu.gcr.io/cognitedata/multi-python:7040fac',
command: '/bin/cat -',
resourceRequestCpu: '1000m',
resourceRequestMemory: '800Mi',
resourceLimitCpu: '1000m',
resourceLimitMemory: '800Mi',
ttyEnabled: true),
],
volumes: [
secretVolume(secretName: 'jenkins-docker-builder', mountPath: '/jenkins-docker-builder', readOnly: true)
]) {
node(label) {
def gitCommit
container('jnlp') {
stage('Checkout') {
checkout(scm)
gitCommit = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim()
}
}
container('python') {
stage('Install pipenv') {
sh("pip3 install pipenv")
}
stage('Install dependencies') {
sh("pipenv sync")
}
stage('Check code style') {
sh("pipenv run black -l 120 --check .")
// sh("pipenv run isort -w 120 -m 3 -tc -rc --check-only .")
}
stage('Build Docs') {
dir('./docs'){
sh("pipenv run sphinx-build -W -b html ./source ./build")
}
}
}
}
}