forked from google/grr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_server_deb.sh
executable file
·45 lines (41 loc) · 1.4 KB
/
build_server_deb.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
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -e
function create_changelog() {
if [[ -f debian/changelog ]]; then
echo "Replacing debian/changelog with new changelog."
rm debian/changelog
fi
pyscript="
import ConfigParser
config = ConfigParser.SafeConfigParser()
config.read('version.ini')
print('%s.%s.%s-%s' % (
config.get('Version', 'major'),
config.get('Version', 'minor'),
config.get('Version', 'revision'),
config.get('Version', 'release')))
"
deb_version="$(python -c "${pyscript}")"
debchange --create \
--newversion "${deb_version}" \
--package grr-server \
--urgency low \
--controlmaint \
--distribution unstable \
"Built by Travis CI at ${TRAVIS_COMMIT}"
}
# Sets environment variables to be used by debhelper.
function export_build_vars() {
# Note that versions for the packages listed here can differ.
export LOCAL_DEB_PYINDEX="${PWD}/local_pypi"
export API_SDIST="$(ls sdists | grep -e 'grr-api-client-.*\.zip')"
export TEST_SDIST="$(ls sdists | grep -e 'grr-response-test-.*\.zip')"
export CLIENT_SDIST="$(ls sdists | grep -e 'grr-response-client-.*\.zip')"
export TEMPLATES_SDIST="$(ls sdists | grep -e 'grr-response-templates-.*\.zip')"
export SERVER_SDIST="$(ls sdists | grep -e 'grr-response-server-.*\.zip')"
}
create_changelog
export_build_vars
rm -rf sdists
dpkg-buildpackage -us -uc
mkdir gcs_upload_dir && cp "${PWD}"/../grr-server* gcs_upload_dir