-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile.cloud
49 lines (44 loc) · 1.39 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
pipeline {
agent {
docker {
image 'debian:bookworm'
// 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 jq make puppet python3-pydantic quilt
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') {
steps { sh 'make 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'
}
}
}
}