forked from lacostej/puavo-os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.cloud
60 lines (54 loc) · 1.74 KB
/
Jenkinsfile.cloud
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
51
52
53
54
55
56
57
58
59
60
pipeline {
agent {
docker {
image 'debian:stretch'
// XXX could you do most operations as normal user?
args '-u root --mount type=bind,source=/etc/jenkins-docker-config,destination=/etc/jenkins-docker-config,readonly --env-file=/etc/jenkins-docker-config/environment'
}
}
stages {
stage('Prepare for build') {
steps {
sh '''
apt-get update
apt-get -y dist-upgrade
apt-get install -y apt-utils devscripts dpkg-dev make puppet
make setup-buildhost
'''
// We can treat a docker container as if it is a puavo-os system
// so package builds can proceed:
sh 'ln -fns "$(pwd)" /puavo-os'
sh 'make prepare'
}
}
stage('Build puavo-os cloud deb-packages') {
// These are packages not needed by puavo-os image.
// DEB_BUILD_OPTIONS=nocheck is needed for the openldap-build in
// a docker environment (?). It makes the build quite a bit faster as
// well, but this means that some openldap-regressions will not be caught
// by Jenkins builds.
steps { sh 'make DEB_BUILD_OPTIONS=nocheck build-debs-cloud' }
}
stage('Upload deb-packages') {
steps {
sh '''
install -o root -g root -m 644 /etc/jenkins-docker-config/dput.cf \
/etc/dput.cf
install -o root -g root -m 644 \
/etc/jenkins-docker-config/ssh_known_hosts \
/etc/ssh/ssh_known_hosts
install -d -o root -g root -m 700 ~/.ssh
install -o root -g root -m 600 \
/etc/jenkins-docker-config/sshkey_puavo_deb_upload \
~/.ssh/id_rsa
'''
sh 'make upload-debs'
}
}
}
post {
always {
cleanWs()
}
}
}