-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-stable-rpm.sh
executable file
·31 lines (25 loc) · 1.44 KB
/
build-stable-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
#!/bin/bash
# Build and publish a package, called by github actions
# echo, exit on error/undefined vars
set -xeu
MOD='jailkit'
NAME="wbm-$MOD"
# Load module.info to get version
version=$(grep version $MOD/module.info | cut -d'=' -f2)
VERSION="${version}"
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"
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/rpm/noarch"
scp -i "${HOME}/.ssh/id_ed25519" -p "${HOME}/rpmbuild/RPMS/noarch/${NAME}-${VERSION}-1.noarch.rpm" "[email protected]:/home/build/result/vm/6/gpl/universal"
# 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/rpm/noarch/${NAME}-${VERSION}-1.noarch.rpm >> /home/build/rpm-publish-queue'"
ssh -i "${HOME}/.ssh/id_ed25519" "[email protected]" "flock /home/build/rpm-publish-queue -c 'echo vm/6/gpl/universal/${NAME}-${VERSION}-1.noarch.rpm >> /home/build/rpm-publish-queue'"