-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-devel-rpm.sh
executable file
·36 lines (28 loc) · 1.26 KB
/
build-devel-rpm.sh
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
#!/bin/bash
# Build and publish a package, called by github actions
# echo, exit on error/undefined vars
set -xeu
MOD='jailkit'
NAME="wbm-$MOD"
# Always increasing. Also a human-readable datetime.
BUILD=$(date +'%Y%m%d%H%M')
# Load module.info to get version
version=$(grep version $MOD/module.info | cut -d'=' -f2)
VERSION="${version}.devel.${BUILD}"
if [ -f epoch ]; then
epoch="--epoch $(cat epoch)"
else
epoch=""
fi
# FIXME after PR is merged to Webmin
mkdir -p ${HOME}/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
mkdir -p "${HOME}/rpmbuild/RPMS/noarch"
ls "${HOME}/rpmbuild/RPMS/noarch"
ls "${HOME}/rpmbuild/SOURCES"
ls "${HOME}/rpmbuild/SPECS"
perl makemodulerpm.pl --rpm-depends --licence 'GPLv3' --allow-overwrite $epoch "$MOD" "$VERSION"
# Copy to build/deploy server
chmod g+w "${HOME}/rpmbuild/RPMS/noarch/${NAME}-${VERSION}-1.noarch.rpm"
scp -i "${HOME}/.ssh/id_ed25519" -p "${HOME}/rpmbuild/RPMS/noarch/${NAME}-${VERSION}-1.noarch.rpm" "[email protected]:/home/build/result/vm/7/gpl-devel/rpm/noarch"
# Add it to the publish queue
ssh -i "${HOME}/.ssh/id_ed25519" "[email protected]" "flock /home/build/rpm-publish-queue -c 'echo vm/7/gpl-devel/rpm/noarch/${NAME}-${VERSION}-1.noarch.rpm >> /home/build/rpm-publish-queue'"