-
Notifications
You must be signed in to change notification settings - Fork 10
/
Jenkinsfile
37 lines (34 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
pipeline {
agent {
label 'master || built-in'
}
stages {
stage('Build docker image') {
when {
branch 'main'
not {
changeRequest()
}
}
steps {
sh "docker build . -t openitcockpit/mkdocs"
}
}
stage('Build and deploy') {
when {
branch 'main'
not {
changeRequest()
}
}
steps {
sh 'docker run --rm --user 111:116 -v "$PWD":/docs -w /docs/de openitcockpit/mkdocs /usr/bin/mkdocs build'
sh 'docker run --rm --user 111:116 -v "$PWD":/docs -w /docs/en openitcockpit/mkdocs /usr/bin/mkdocs build'
sh 'mkdir -p htdocs/en'
sh 'cp -r de/site/. htdocs/'
sh 'cp -r en/site/. htdocs/en'
sh 'rsync -avz -e "ssh -o StrictHostKeyChecking=no -i /var/lib/jenkins/.ssh/id_rsa" --progress --delete ./htdocs/. [email protected]:/var/www/docs.openitcockpit.io/'
}
}
}
}