Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .cci.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ buildPod {
stage("Build") {
shwrap("make ignition BIN_PATH=bin/amd64")
shwrap("make ignition-validate BIN_PATH=bin/amd64")
shwrap("make butane BIN_PATH=bin/amd64")
shwrap("make install BIN_PATH=bin/amd64 DESTDIR=install")
stash name: 'build', includes: 'install/**'
}
// first, run gofmt/govet/unit tests
stage("Unit Tests") {
shwrap("./test")
shwrap("BIN_PATH=bin/amd64 ./test")
}
stage("Build Blackbox Tests") {
shwrap("""
Expand Down
79 changes: 0 additions & 79 deletions butane/test

This file was deleted.

30 changes: 30 additions & 0 deletions test
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,34 @@ for id in ${platforms}; do
esac
done

echo "Checking butane docs..."
BUTANE_BIN="${BIN_PATH:-bin}/butane"
if [ ! -x "${BUTANE_BIN}" ]; then
echo "butane binary not found at ${BUTANE_BIN}; run 'make butane' first" >&2
exit 1
fi
shopt -s nullglob
tmpdir=$(mktemp -d)
trap 'rm -rf "${tmpdir}"' EXIT
# Create files-dir contents expected by example configs
mkdir -p "${tmpdir}/files-dir/tree"
touch "${tmpdir}/files-dir/"{config.ign,ca.pem,example.conf,example.service,file,file-epilogue,local-file3}
echo "ssh-rsa AAAA" > "${tmpdir}/files-dir/id_rsa.pub"
echo "ssh-ed25519 AAAA" > "${tmpdir}/files-dir/id_ed25519.pub"
echo '{"ignition": {"version": "3.5.0"}}' > "${tmpdir}/files-dir/ignition.ign"

for doc in butane/docs/*md; do
# Split each doc on the butane-config marker
sed -n '/^<!-- butane-config -->/,/^```$/ p' <"${doc}" \
| csplit - '/<!-- butane-config -->/' '{*}' -z --prefix "${tmpdir}/config_$(basename "${doc%.*}")_" -q
for cfg in "${tmpdir}"/config_*; do
echo "Checking ${doc}: $(basename "${cfg}")"
# Strip the marker + ```yaml header and the trailing ```
tail -n +3 "${cfg}" | head -n -1 \
| "${BUTANE_BIN}" --check --strict --files-dir "${tmpdir}/files-dir" \
Comment thread
coderabbitai[bot] marked this conversation as resolved.
|| (cat -n "${cfg}" && exit 1)
done
rm -f "${tmpdir}"/config_*
done

echo "Success"
Loading