Files
weave-scope/tools/circle.yml
2017-07-13 16:18:44 +00:00

56 lines
1.8 KiB
YAML

machine:
services:
- docker
environment:
GOPATH: /home/ubuntu
SRCDIR: /home/ubuntu/src/github.com/weaveworks/tools
PATH: $PATH:$HOME/bin
dependencies:
post:
- sudo chmod a+wr --recursive /usr/local/go/pkg
- go clean -i net
- go install -tags netgo std
- mkdir -p $(dirname $SRCDIR)
- cp -r $(pwd)/ $SRCDIR
- |
curl -fsSLo shfmt https://github.com/mvdan/sh/releases/download/v1.3.0/shfmt_v1.3.0_linux_amd64 && \
echo "b1925c2c405458811f0c227266402cf1868b4de529f114722c2e3a5af4ac7bb2 shfmt" | sha256sum -c && \
chmod +x shfmt && \
sudo mv shfmt /usr/bin
- |
cd $SRCDIR;
go get \
github.com/fzipp/gocyclo \
github.com/golang/lint/golint \
github.com/kisielk/errcheck \
github.com/fatih/hclfmt
- pip install yapf==0.16.2 flake8==3.3.0
test:
override:
- cd $SRCDIR; ./lint .
- cd $SRCDIR/cover; make
- cd $SRCDIR/socks; make
- cd $SRCDIR/runner; make
- cd $SRCDIR/build; make
deployment:
snapshot:
branch: master
commands:
- docker login -e "$DOCKER_REGISTRY_EMAIL" -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASS" "$DOCKER_REGISTRY_URL"
- |
cd $SRCDIR/build;
for image in $(make images); do
# Tag the built images with the revision of this repo.
docker push "${image}:${GIT_TAG}"
# Tag the built images with something derived from the base images in
# their respective Dockerfiles. So "FROM golang:1.8.0-stretch" as a
# base image would lead to a tag of "1.8.0-stretch"
IMG_TAG=$(make "imagetag-${image#quay.io/weaveworks/build-}")
docker tag "${image}:latest" "${image}:${IMG_TAG}"
docker push "${image}:${IMG_TAG}"
done