diff --git a/projects/caddyserver.com/package.yml b/projects/caddyserver.com/package.yml new file mode 100644 index 00000000..aad086f2 --- /dev/null +++ b/projects/caddyserver.com/package.yml @@ -0,0 +1,51 @@ +distributable: + url: https://github.com/caddyserver/caddy/archive/v{{version}}.tar.gz + strip-components: 1 +versions: + github: caddyserver/caddy +build: + dependencies: + go.dev: '*' + curl.se: '*' + script: + - run: | + curl -L "$XCADDY" | tar zxf - --strip-components 1 + go run cmd/xcaddy/main.go build v{{version}} --output {{prefix}}/bin/caddy + working-directory: xcaddy + env: + XCADDY: https://github.com/caddyserver/xcaddy/archive/refs/tags/v0.3.5.tar.gz +provides: + - bin/caddy +test: + dependencies: + curl.se: '*' + script: + - caddy version | grep {{version}} + - run: | + port=8080 + + while lsof -i:$port >/dev/null 2>&1; do + ((port++)) + done + + port1=$port + port2=$((port + 1)) + + # Create the Caddyfile + cat > Caddyfile < /dev/null 2>&1 <