Skip to content

Commit

Permalink
generate packaging dirs for spread on the fly
Browse files Browse the repository at this point in the history
  • Loading branch information
mvo5 committed Dec 15, 2016
1 parent 2713d95 commit cacd5cf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions generate-packaging-dir
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

set -e

ID="$1"
VERSION_ID="$2"

DST="debian-$ID-$VERSION_ID"
rm -rf $DST
mkdir -p "$DST"

git ls-tree "$ID"/"$VERSION_ID" debian/ | while read line ; do
file=$(basename $(echo $line | cut -d " " -f4))
hash=$(echo $line | cut -d " " -f3)
type=$(echo $line | cut -d " " -f2)
# FIXME: deal with subdirs
if [ "$type" = "blob" ]; then
git cat-file -p $hash > "$DST/$file"
fi
done
20 changes: 20 additions & 0 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ environment:
TRUST_TEST_KEYS: "true"
MANAGED_DEVICE: "false"
CORE_CHANNEL: "$(HOST: echo ${SPREAD_CORE_CHANNEL:-edge})"
# slight abuse
GENERATE_14_04: "$(HOST: ./generate-packaging-dir ubuntu 14.04)"
GENERATE_16_04: "$(HOST: ./generate-packaging-dir ubuntu 16.04)"

backends:
linode:
Expand Down Expand Up @@ -180,6 +183,23 @@ prepare: |
# utilities
apt-get install -y curl devscripts expect gdebi-core jq rng-tools git
# apply the right packaging delta, only 14.04 is special for now
. /etc/os-release
if [ "$ID" = "ubuntu" ]; then
case "$VERSION_ID" in
14.04)
mv debian-$ID-$VERSION_ID debian
;;
*)
mv debian-ubuntu-16.04 debian
;;
esac
else
echo "unknown distro ID $ID, please update the spread tests"
exit 1
fi
# in 16.04: apt build-dep -y ./
apt-get install -y $(gdebi --quiet --apt-line ./debian/control)
Expand Down

0 comments on commit cacd5cf

Please sign in to comment.