2019-07-28 19:47:59 +09:00

47 lines
1.2 KiB
YAML

version: 2
jobs:
test:
docker:
- image: circleci/golang
environment:
REDIS_URL: redis://localhost:6379/0
- image: redis:alpine
steps:
- checkout
- run:
name: build
command: |
go version
go test -coverprofile=coverage.txt -covermode=atomic -p 1 . ./worker ./cli ./State
bash <(curl -s https://codecov.io/bash)
docker:
docker:
- image: docker:git
steps:
- checkout
- setup_remote_docker
- run:
name: build docker image
command: |
docker build -t ${DOCKER_USER}/activity-relay:edge .
docker tag ${DOCKER_USER}/activity-relay:edge ${DOCKER_USER}/activity-relay:$(echo ${CIRCLE_SHA1}|head -c7)
- run:
name: upload image to docker hub.
command: |
docker login --username=${DOCKER_USER} --password=${DOCKER_PASS}
docker push ${DOCKER_USER}/activity-relay:edge
docker push ${DOCKER_USER}/activity-relay:$(echo ${CIRCLE_SHA1}|head -c7)
workflows:
version: 2
build:
jobs:
- test
- docker:
requires:
- test
filters:
branches:
only:
- master