forked from weeveiot/weeve-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·73 lines (58 loc) · 1.9 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
·73 lines (58 loc) · 1.9 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
create_debs(){
for ARCH in amd64 armhf arm64
do
mkdir -p deb-${ARCH}
cp -r DEBIAN deb-${ARCH}
# populate control file
echo "Package: weeve-agent
Version: ${VERSION}
License: GPL-3.0
Architecture: ${ARCH}
Maintainer: ${FULL_NAME} <${EMAIL}>
Section: misc
Priority: optional
Homepage: https://weeve.network
Description: A client to manage docker containers on IoT devices." > deb-${ARCH}/DEBIAN/control
mkdir -p deb-${ARCH}/var/lib/weeve-agent
cp ca.crt deb-${ARCH}/var/lib/weeve-agent
mkdir -p deb-${ARCH}/lib/systemd/system/
cp weeve-agent.service deb-${ARCH}/lib/systemd/system
mkdir -p deb-${ARCH}/usr/bin/
if [ "$ARCH" = "armhf" ]; then
GOARCH="arm"
else
GOARCH=$ARCH
fi
cp bin/weeve-agent-linux-${GOARCH} deb-${ARCH}/usr/bin/weeve-agent
# TODO: generate the changelog
dpkg-deb -Zxz --build deb-${ARCH} "weeve-agent_${VERSION}_${ARCH}.deb"
done
}
create_sign_release(){
cp weeve.gpg apt-repo
cd apt-repo
mkdir -p pool/main/
for ARCH in amd64 armhf arm64
do
# copy the deb
cp "../weeve-agent_${VERSION}_${ARCH}.deb" pool/main/
# create Packages* files
mkdir -p dists/stable/main/binary-${ARCH}
dpkg-scanpackages --arch ${ARCH} --multiversion pool/ > dists/stable/main/binary-${ARCH}/Packages
cat dists/stable/main/binary-${ARCH}/Packages | gzip -9 > dists/stable/main/binary-${ARCH}/Packages.gz
done
# create *Release* files
cd dists/stable
apt-ftparchive release . > Release
gpg -abs -o - Release > Release.gpg
gpg --clearsign -o - Release > InRelease
cd ../../..
}
configure_gpg(){
echo -n "${GPG_SIGNING_KEY}" | base64 --decode | gpg --import
}
FULL_NAME="Paul Gaiduk"
EMAIL=paul.gaiduk@weeve.network
VERSION=$(git tag | sort -V | tail -n 1 | cut -c2-)
"$@"