mirror of
https://github.com/willnorris/imageproxy.git
synced 2025-01-13 22:51:38 -05:00
feat(wercker): Add wercker to build the slim container
This commit is contained in:
parent
b5984d2822
commit
32419f1e39
3 changed files with 55 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
build
|
||||
.goxc.local.json
|
||||
*.test
|
||||
.wercker
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM google/golang
|
||||
FROM google/golang-alpine
|
||||
MAINTAINER Sevki <s@sevki.org>
|
||||
|
||||
ADD . /go/src/willnorris.com/go/imageproxy
|
||||
|
|
53
wercker.yml
Normal file
53
wercker.yml
Normal file
|
@ -0,0 +1,53 @@
|
|||
build:
|
||||
box: golang
|
||||
steps:
|
||||
- setup-go-workspace:
|
||||
package-dir: willnorris.com/go/imageproxy
|
||||
|
||||
- golint:
|
||||
exclude: vendor
|
||||
|
||||
- script:
|
||||
name: go fmt
|
||||
code: |
|
||||
output=$(go fmt willnorris.com/go/imageproxy/...)
|
||||
if [[ $(echo -n $output | wc -l) -ne 0 ]]; then
|
||||
echo "command should not print anything to succeed:"
|
||||
echo $output
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- script:
|
||||
name: go test
|
||||
code: go test -v $(go list willnorris.com/go/imageproxy/... | grep -v /vendor/)
|
||||
|
||||
- script:
|
||||
name: go build
|
||||
code: |
|
||||
GOOS=linux CGO_ENABLED=0 go build \
|
||||
-a -ldflags '-s' \
|
||||
-installsuffix cgo \
|
||||
-o imageproxy \
|
||||
willnorris.com/go/imageproxy/cmd/imageproxy
|
||||
|
||||
- script:
|
||||
name: copy binary
|
||||
code: cp imageproxy "$WERCKER_OUTPUT_DIR"
|
||||
|
||||
deploy-docker:
|
||||
box:
|
||||
id: alpine
|
||||
cmd: /bin/sh
|
||||
steps:
|
||||
- script:
|
||||
name: Install packages
|
||||
code: |
|
||||
apk --no-cache add ca-certificates
|
||||
- internal/docker-push:
|
||||
disable-sync: true
|
||||
username: $DOCKER_USERNAME
|
||||
password: $DOCKER_PASSWORD
|
||||
repository: $DOCKER_OWNER/$WERCKER_GIT_REPOSITORY
|
||||
tag: $WERCKER_GIT_COMMIT, latest, $WERCKER_GIT_BRANCH
|
||||
entrypoint: /pipeline/source/imageproxy
|
||||
|
Loading…
Add table
Reference in a new issue