Commit 578f04f8 authored by Daniel Sonck's avatar Daniel Sonck
Browse files

Remove debug from redo scripts & add mod.install.do

parent 5b927c95
......@@ -25,7 +25,6 @@ buildah add "${C}" https://github.com/apenwarr/redo/archive/redo-0.42c.tar.gz ./
buildah run -- "${C}" tar -xvf redo-0.42c.tar.gz || on_fail
buildah run -- "${C}" sh -c "cd redo-redo-0.42c; DESTDIR= PREFIX=/usr/local ./do -j10 install" || on_fail
buildah copy "${C}" go.* ./ || on_fail
buildah run -- "${C}" go mod download || on_fail
buildah copy "${C}" main.go ./ || on_fail
buildah copy "${C}" internal/ ./internal/ || on_fail
......
echo "default.dep.do: $2" >&2
case $2 in
*mod)
redo-ifchange mod.install
SUBMODULE="go.touhou.fm/radio/server/playlist/$(dirname "$1" | sed 's!\./\(.*\)!\1!g')"
go list -f '{{ join .Imports "\n" }}' "${SUBMODULE}" | \
......@@ -8,6 +9,5 @@ case $2 in
tee "$3" | \
xargs -r redo-ifchange || exit 1
redo-ifchange ./"$(dirname "$1")"/*.go
redo-ifchange go.mod go.sum
;;
esac
\ No newline at end of file
exec >&2
echo "Default.do: $2" >&2
case $2 in
.build/test)
redo-ifchange target/reports/tests.xml target/site/clover/clover.xml
......@@ -7,28 +6,23 @@ case $2 in
touch "$3"
;;
*/playlist)
echo "Building playlist"
redo-ifchange mod.dep .build/test version.txt
VERSION=$(sed -n 's/version=\(.*\)/\1/gp' < version.txt)
echo "Building playlist version $VERSION" >&2
CGO_ENABLED=0 go build -a -tags netgo -installsuffix netgo -ldflags "-X go.touhou.fm/radio/server/playlist/internal.version=$VERSION" -o "$3" .
setcap cap_net_bind_service=+ep "$3" || true
;;
*/go-clover)
echo "Building go-clover"
redo-ifchange go.mod go.sum
redo-ifchange mod.install
mkdir -p "$(dirname "$3")"
go build -o "$3" github.com/codeofthrone/goclover
;;
*/go-junit-report)
echo "Building go-junit-report"
redo-ifchange go.mod go.sum
redo-ifchange mod.install
mkdir -p "$(dirname "$3")"
go build -o "$3" github.com/jstemmer/go-junit-report
;;
*/go-acc)
echo "Building go-acc"
redo-ifchange go.mod go.sum
redo-ifchange mod.install
mkdir -p "$(dirname "$3")"
go build -o "$3" github.com/ory/go-acc
;;
......
echo "Do run $1 - $2 - $3" >&2
case $2 in
*/tests)
echo "Running tests" >&2
redo-ifchange mod.dep tool/go-acc
mkdir -vp "$1.tmp" >&2
mkdir -p "$1.tmp" >&2
tool/go-acc --output="$1.tmp/coverage.txt" ./... -- -v > "$1.tmp/tests.txt"
touch "$3"
;;
......
......@@ -3,13 +3,11 @@ case $2 in
*/tests)
redo-ifchange "target/reports/tests.run"
mkdir -p "$(dirname "$1")"
echo "Linking \"target/reports/tests.run.tmp/$(basename "$1")\" \"$3\""
cp -f "target/reports/tests.run.tmp/$(basename "$1")" "$3"
;;
*/coverage)
redo-ifchange "target/reports/tests.run"
mkdir -p "$(dirname "$1")"
echo "Linking \"target/reports/tests.run.tmp/$(basename "$1")\" \"$3\""
cp -f "target/reports/tests.run.tmp/$(basename "$1")" "$3"
;;
esac
\ No newline at end of file
exec >&2
mkdir -pv "$(dirname "$2")"
mkdir -p "$(dirname "$2")"
case $2 in
*/clover)
echo "Generating Clover XML"
redo-ifchange "target/reports/coverage.txt" "tool/go-clover"
tool/go-clover -f target/reports/coverage.txt -o "$3"
;;
*/tests)
echo "Generating JUnit XML"
redo-ifchange "target/reports/tests.txt" "tool/go-junit-report"
tool/go-junit-report < "target/reports/tests.txt" > "$3"
;;
......
redo-ifchange go.mod go.sum
go mod download -x -json > "$3"
redo-stamp < "$3"
\ No newline at end of file
#!/bin/sh
redo-ifchange target/reports/tests.xml target/site/clover/clover.xml
mkdir -p "$(dirname "$1")"
touch "$1$2"
\ No newline at end of file
#!/bin/sh
redo-ifchange "$(dirname "$1")/tests.run"
mkdir -p "$(basename "$1$2")"
ln "$(dirname "$1")/tests.run.tmp/$(basename "$1$2")" "$3"
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment