-
Notifications
You must be signed in to change notification settings - Fork 40
/
HWIMO-BUILD
executable file
·74 lines (59 loc) · 1.94 KB
/
HWIMO-BUILD
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
74
#!/bin/bash
#
# Build debian package for all images created by on-imagebuilder
#
# Input (environment variables):
# * PKG_VERSION: The version of debian package,
# such as: 1.3.1 (official release);
#
set -e
output_path=/tmp/on-imagebuilder
rm -rf $output_path
mkdir -p $output_path
bintray_repo=http://dl.bintray.com/rackhd/binary/builds
#build static files
sudo ./build_all.sh
#prepare workplace for deb build
rm -rf on-static-common*
sudo rm -rf packagebuild
mkdir packagebuild
pushd packagebuild
mkdir common
mkdir pxe
#add Microkernel images from bintray
pushd $output_path/builds/
wget $bintray_repo/base.trusty.3.16.0-25-generic.squashfs.img
wget $bintray_repo/discovery.overlay.cpio.gz
wget $bintray_repo/initrd.img-3.16.0-25-generic
wget $bintray_repo/vmlinuz-3.16.0-25-generic
popd
#copy static files
sudo chmod 644 /tmp/on-imagebuilder/builds/*
sudo chmod 644 /tmp/on-imagebuilder/ipxe/*
sudo chmod 644 /tmp/on-imagebuilder/syslinux/*
cp $output_path/builds/* common/
cp $output_path/syslinux/* pxe/
cp $output_path/ipxe/* pxe/
rsync -av ../debian .
export DEBEMAIL="hwimo robots <[email protected]>"
export DEBFULLNAME="The HWIMO Robots"
# If PKG_VERSION is not set as an environment variable
# compute it as below:
if [ -z "$PKG_VERSION" ];then
GIT_COMMIT_DATE=$(git show -s --pretty="format:%ci")
DATE_STRING=$(date -d "$GIT_COMMIT_DATE" -u +"%Y%m%dUTC")
GIT_COMMIT_HASH=$(git show -s --pretty="format:%h")
CHANGELOG_VERSION=$(dpkg-parsechangelog --show-field Version)
PKG_VERSION="$CHANGELOG_VERSION-$DATE_STRING-$GIT_COMMIT_HASH"
fi
if [[ $PKG_VERSION =~ ^([0-9]+\.){2}[0-9]+$ ]];then
# If version looks like 1.2.3, the build is official build.
# So update the distribution of changelog from "UNRELEASED" to "unstable"
dch -r ""
else
COMMIT_STR=`git log -n 1 --oneline`
dch -v $PKG_VERSION -u low $COMMIT_STR -b -m
fi
debuild --no-lintian --no-tgz-check -us -uc
popd
sudo rm -rf packagebuild