Initial set of builds for Cadmium

This commit is contained in:
2018-07-12 00:52:35 +01:00
parent 87b9f7bace
commit 2cf8752f0b
6 changed files with 147 additions and 0 deletions

15
scripts/build Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
if [ "x$1" = "x" ]; then
echo "Usage: $0 <Tag>"
exit 1
fi
echo "Building Cadmium $1..."
cm="github.com/mholt/caddy/caddy/caddymain"
go build \
-o cadmium \
-ldflags "-X \"$cm.gitTag=$1\" -X \"$cm.gitNearestTag=$1\"" \
github.com/mholt/caddy/caddy

24
scripts/download Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
if [ "x$1" = "x" ]; then
echo "Usage: $0 <Tarball URL>"
exit 1
fi
if [ -e "source" ]; then
echo "source/ directory already exists, remove it first"
exit 1
fi
curl -L "$1" | tar -xzf -
mv caddy* source
# Disable telemetry in run.go and rename to Cadmium
patch -d source -p1 <"$(pwd)/patches/run.go.diff"
# Replace telemetry with a stub
rm -r source/telemetry
mkdir source/telemetry
cp patches/collection.go source/telemetry/collection.go