mirror of
https://gitlab.archlinux.org/archlinux/archlinux-docker.git
synced 2025-08-06 14:17:18 +02:00
Currently things are a bit mixed up - just rename all the files to include the BUILD_VERSION and consistently use the rootfs_file variable. Throw in some quotes while in there. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
23 lines
743 B
Bash
Executable File
23 lines
743 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
declare -r ROOTFS_FILE="$1"
|
|
declare -r GROUP="$2"
|
|
declare -r OUTPUTDIR="$3"
|
|
declare -r DOWNLOAD="$4"
|
|
declare -r TITLE="$5"
|
|
|
|
# Do not use these directly in the sed below - it will mask git failures
|
|
BUILD_VERSION="${BUILD_VERSION:-dev}"
|
|
CI_COMMIT_SHA="${CI_COMMIT_SHA:-$(git rev-parse HEAD)}"
|
|
|
|
sed -e "s|TEMPLATE_ROOTFS_FILE|$ROOTFS_FILE|" \
|
|
-e "s|TEMPLATE_ROOTFS_DOWNLOAD|$DOWNLOAD|" \
|
|
-e "s|TEMPLATE_ROOTFS_HASH|$(cat $OUTPUTDIR/$ROOTFS_FILE.SHA256)|" \
|
|
-e "s|TEMPLATE_TITLE|Arch Linux $TITLE Image|" \
|
|
-e "s|TEMPLATE_VERSION_ID|$BUILD_VERSION|" \
|
|
-e "s|TEMPLATE_REVISION|$CI_COMMIT_SHA|" \
|
|
-e "s|TEMPLATE_CREATED|$(date -Is)|" \
|
|
Dockerfile.template > "$OUTPUTDIR/Dockerfile.$GROUP"
|