Skip to content

Commit 59e379b

Browse files
Refactor writing BUILD_META_FILE (#229)
1 parent b981bf2 commit 59e379b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

prepare.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ fi
2727
echo "Generating build metadata"
2828
mkdir -p "${OS_FLAVOR}/context/etc/metal"
2929
BUILD_META_FILE="${OS_FLAVOR}/context/etc/metal/build.yaml"
30-
python3 -c "import yaml; from datetime import datetime; print(yaml.dump(dict(builddate=datetime.now(), commit_ref=\"${BRANCH}\", commit_sha1=\"${GITHUB_SHA}\", gitrepo=\"${GITHUB_REPOSITORY}\"), default_flow_style=False))" | tee -a "${BUILD_META_FILE}"
30+
python3 - <<EOF | tee -a "${BUILD_META_FILE}"
31+
from datetime import datetime
32+
print(f"builddate='{datetime.now().isoformat(' ')}'")
33+
print("commit_ref='${BRANCH}'")
34+
print("commit_sha1='${GITHUB_SHA}'")
35+
print("gitrepo='${GITHUB_REPOSITORY}'")
36+
EOF
3137

3238
echo "remove old firecracker images"
3339
sudo rm -rf /var/lib/firecracker/image/* /var/lib/firecracker/kernel/*

0 commit comments

Comments
 (0)