Skip to content

Commit

Permalink
Merge pull request #4 from tianon/output-reorg
Browse files Browse the repository at this point in the history
Reorganize build*.sh output directory structure (dir/SERIAL/SUITE/[VARIANT]/...)
  • Loading branch information
tianon authored May 24, 2017
2 parents e208ee0 + b63a2fd commit 12cae69
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ set -x
./scripts/debuerreotype-version
./build.sh travis "$SUITE" "@$epoch"

real="$(sha256sum "travis/$serial/$SUITE-amd64.tar.xz" | cut -d' ' -f1)"
real="$(sha256sum "travis/$serial/$SUITE/rootfs-amd64.tar.xz" | cut -d' ' -f1)"
[ -z "$SHA256" ] || [ "$SHA256" = "$real" ]
32 changes: 25 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,16 @@ docker run \
epoch="$(date --date "$timestamp" +%s)"
serial="$(date --date "@$epoch" +%Y%m%d)"
exportDir="output"
outputDir="$exportDir/$serial"
outputDir="$exportDir/$serial/$suite"
dpkgArch="$(dpkg --print-architecture)"
touch_epoch() {
while [ "$#" -gt 0 ]; do
local f="$1"; shift
touch --no-dereference --date="@$epoch" "$f"
done
}
{
debuerreotype-init rootfs "$suite" "@$epoch"
Expand Down Expand Up @@ -89,12 +96,23 @@ docker run \
debuerreotype-gen-sources-list "$rootfs" "$suite" http://deb.debian.org/debian http://security.debian.org
done
mkdir -p "$outputDir"
for variant in "" -slim; do
targetBase="$outputDir/$suite$variant-$dpkgArch"
debuerreotype-tar "rootfs$variant" "$targetBase.tar.xz"
debuerreotype-chroot "rootfs$variant" dpkg-query -W > "$targetBase.manifest"
touch --no-dereference --date="@$epoch" "$targetBase.manifest"
for variant in "" slim; do
variantDir="$outputDir/$variant"
mkdir -p "$variantDir"
targetBase="$variantDir/rootfs-$dpkgArch"
rootfs="rootfs${variant:+-$variant}"
debuerreotype-tar "$rootfs" "$targetBase.tar.xz"
debuerreotype-chroot "$rootfs" dpkg-query -W > "$targetBase.manifest"
echo "$epoch" > "$targetBase.debuerreotype-epoch"
touch_epoch "$targetBase.manifest" "$targetBase.debuerreotype-epoch"
for f in debian_version os-release; do
cp "$rootfs/etc/$f" "$targetBase.$f"
touch_epoch "$targetBase.$f"
done
done
} >&2
Expand Down

0 comments on commit 12cae69

Please sign in to comment.