Commit a3576440 authored by Noah Prail's avatar Noah Prail

build: Update to Caddy 1.0.0

parent 625974fe
Pipeline #10779 passed with stages
in 4 minutes and 45 seconds
......@@ -12,11 +12,10 @@ build:
before_script:
- apk add --no-cache git gcc musl-dev
- if [ -n "${VERSION}" ]; then export RELEASE=true && echo "Release Version"; fi
- export VERSION=${VERSION:-"0.11.5"}
- export VERSION=${VERSION:-"1.0.0"}
script:
- echo "Building ${VERSION}"
- sh scripts/builder.sh
- mv /go/src/github.com/mholt/caddy/bin /builds/docker/caddy
- if [ -n "${RELEASE}" ]; then cp bin/caddy bin/caddy-${VERSION}; fi
- bin/caddy -version
artifacts:
......@@ -31,7 +30,7 @@ package_deb:
dependencies:
- build
before_script:
- if [ -n "${VERSION}" ]; then export RELEASE=true && echo "Release Version"; else export VERSION=${VERSION:-"0.11.5"}-${CI_PIPELINE_ID}; fi
- if [ -n "${VERSION}" ]; then export RELEASE=true && echo "Release Version"; else export VERSION=${VERSION:-"1.0.0"}-${CI_PIPELINE_ID}; fi
- export VERSION=${VERSION}
script:
- cp bin/caddy . && rm -rf bin/
......
package main
import (
"github.com/mholt/caddy/caddy/caddymain"
_ "github.com/caddyserver/dnsproviders/cloudflare"
_ "github.com/captncraig/cors"
)
func main() {
caddymain.Run()
}
\ No newline at end of file
cloudflare,cors
\ No newline at end of file
#!/bin/sh
# code modified from: https://github.com/abiosoft/caddy-docker/blob/master/builder/builder.sh
VERSION=${VERSION:-"1.0.0"}
git config --global user.email "bot@event1.io"
git config --global user.name "eventOne Commit Bot"
export GO111MODULE=on
VERSION=${VERSION:-"0.11.5"}
PLUGINS=$(cat plugins.txt)
CADDY_GITHUB=mholt/caddy
go mod init caddy
# caddy
git clone https://github.com/${CADDY_GITHUB} -b "v$VERSION" $GOPATH/src/github.com/${CADDY_GITHUB} \
&& cd $GOPATH/src/github.com/${CADDY_GITHUB} \
&& git checkout -b "v$VERSION"
go get github.com/mholt/caddy@v${VERSION}
# plugin helper
GOOS=linux GOARCH=amd64 go get -v github.com/abiosoft/caddyplug/caddyplug
alias caddyplug='GOOS=linux GOARCH=amd64 caddyplug'
go build
# plugins
for plugin in $(echo $PLUGINS | tr "," " "); do \
go get -v $(caddyplug package $plugin); \
printf "package caddyhttp\nimport _ \"$(caddyplug package $plugin)\"" > \
$GOPATH/src/github.com/${CADDY_GITHUB}/caddyhttp/$plugin.go ; \
done
# builder dependency
git clone https://github.com/caddyserver/builds $GOPATH/src/github.com/caddyserver/builds
# build
cd $GOPATH/src/github.com/${CADDY_GITHUB}/caddy \
&& git checkout -f \
&& sed -i 's/unofficial/eventOne/g' caddymain/run.go \
&& git add caddymain/run.go \
&& git commit -m "Version ${VERSION}" \
&& GOOS=linux GOARCH=amd64 go run build.go -goos=$GOOS -goarch=$GOARCH -goarm=$GOARM \
&& mkdir -p ../bin \
&& mv caddy ../bin
\ No newline at end of file
mkdir -p bin && cp caddy bin/
\ 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