Browse Source

Cross-compile for a range of platforms

main
Nick Thomas 4 years ago
parent
commit
8624bceba7
Signed by: lupine
GPG Key ID: 1F1A7ECCCFE0B92F
  1. 2
      .gitignore
  2. 4
      .gitlab-ci.yml
  3. 7
      scripts/build

2
.gitignore vendored

@ -1,2 +1,4 @@
/bin
/cadmium
/gopath
/plugins.txt

4
.gitlab-ci.yml

@ -10,10 +10,10 @@ build:
- mkdir -p "$GOPATH/src/github.com/mholt"
- ln -s "$(pwd)/source" "$GOPATH/src/github.com/mholt/caddy"
- scripts/build ${CADDY_TAG}
- ./cadmium -plugins | tee plugins.txt
- ./bin/cadmium.linux_amd64 -plugins | tee plugins.txt
artifacts:
paths:
- cadmium
- bin
- gopath
- plugins.txt
only:

7
scripts/build

@ -8,8 +8,11 @@ fi
echo "Building Cadmium $1..."
cm="github.com/mholt/caddy/caddy/caddymain"
GOPATH="$(pwd)/gopath" go build \
-o cadmium \
CGO_ENABLED=0 GOPATH="$(pwd)/gopath" gox \
-verbose \
-output "bin/cadmium.{{.OS}}_{{.Arch}}" \
-os "!netbsd" \
-ldflags "-X \"$cm.gitTag=$1\" -X \"$cm.gitNearestTag=$1\"" \
github.com/mholt/caddy/caddy

Loading…
Cancel
Save