-
Notifications
You must be signed in to change notification settings - Fork 139
/
Copy pathpublish-deb
executable file
·41 lines (32 loc) · 1.37 KB
/
publish-deb
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
#!/bin/bash
set -e
VERSION=$(jq -r ".version" < package.json)
DESCRIPTION=$(jq -r ".description" < package.json)
rm -rf "bin/gitlab-ci-local_${VERSION}_amd64"
mkdir -p ppa
# Generate package info file
mkdir -p "bin/gitlab-ci-local_${VERSION}_amd64/DEBIAN/"
cat << EOF > "bin/gitlab-ci-local_${VERSION}_amd64/DEBIAN/control"
Name: gitlab-ci-local
Package: gitlab-ci-local
Version: ${VERSION}
Architecture: amd64
Author: Mads Jon Nielsen <[email protected]>
Maintainer: Mads Jon Nielsen <[email protected]>
Description: ${DESCRIPTION}
Homepage: https://github.com/firecow/gitlab-ci-local
Website: https://github.com/firecow/gitlab-ci-local
EOF
mkdir -p "bin/gitlab-ci-local_${VERSION}_amd64/usr/local/bin/"
cp bin/linux/gitlab-ci-local "bin/gitlab-ci-local_${VERSION}_amd64/usr/local/bin/"
(cd bin/ && (dpkg-deb --root-owner-group --build "gitlab-ci-local_${VERSION}_amd64" || rm "bin/gitlab-ci-local_${VERSION}_amd64.deb"))
mv "bin/gitlab-ci-local_${VERSION}_amd64.deb" "ppa/"
# Packages & Packages.gz
(cd ppa && dpkg-scanpackages --multiversion . > Packages)
(cd ppa && gzip -k -f Packages)
# Release, Release.gpg & InRelease
(cd ppa && apt-ftparchive release . > Release)
(cd ppa && gpg --default-key "[email protected]" -abs -o - Release > Release.gpg)
(cd ppa && gpg --default-key "[email protected]" --clearsign -o - Release > InRelease)
rm -f ppa/ppa.zip
(cd ppa && zip -r ppa.zip .)