forked from Cumulocity-IoT/c8y-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
41 lines (38 loc) · 874 Bytes
/
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
HUGO_PARAMS = ""
pipeline {
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
skipStagesAfterUnstable()
}
agent {
docker {
image 'c8y-ubuntu-hugo-deploy:latest'
}
}
environment {
YUM_SRV = 'yum.cumulocity.com'
YUM_USR = 'hudson'
YUM_DEST_DIR = '/var/www/staticpage-guides/guides/'
}
stages {
stage('Build') {
steps {
sh "hugo ${HUGO_PARAMS}"
}
}
stage('Deploy') {
steps {
sshagent(['hudson-ssh-resources']) {
sh '''bash --login
python /docsRepoScanner.py ./
pwd
ls
cp output.json ./public/releases.json
rsync -avh ./public/* ${YUM_USR}@${YUM_SRV}:${YUM_DEST_DIR} --delete
'''
// sh "rsync -avh ./public/* ${env.YUM_USR}@${env.YUM_SRV}:${YUM_DEST_DIR} --delete"
}
}
}
}
}