mirror of
https://github.com/itzg/mc-router.git
synced 2024-11-22 11:35:14 +01:00
66 lines
1.4 KiB
YAML
66 lines
1.4 KiB
YAML
# Golang CircleCI 2.0 configuration file
|
|
#
|
|
# Check https://circleci.com/docs/2.0/language-go/ for more details
|
|
version: 2
|
|
|
|
defaults: &defaults
|
|
docker:
|
|
# specify the version
|
|
- image: circleci/golang:1.10
|
|
|
|
# Specify service dependencies here if necessary
|
|
# CircleCI maintains a library of pre-built images
|
|
# documented at https://circleci.com/docs/2.0/circleci-images/
|
|
# - image: circleci/postgres:9.4
|
|
|
|
working_directory: /go/src/github.com/itzg/mc-router
|
|
|
|
|
|
jobs:
|
|
build:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ arch }}-{{ .Branch }}-{{ checksum "Gopkg.lock" }}
|
|
- cache-{{ arch }}-{{ .Branch }}
|
|
- cache
|
|
|
|
- run: make install-dep
|
|
|
|
- save_cache:
|
|
key: cache-{{ arch }}-{{ .Branch }}-{{ checksum "Gopkg.lock" }}
|
|
paths:
|
|
- vendor
|
|
|
|
- run: make test
|
|
|
|
release:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
|
|
- run: make install-dep
|
|
|
|
- setup_remote_docker
|
|
- run: echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin
|
|
- run: make release
|
|
|
|
workflows:
|
|
version: 2
|
|
incremental:
|
|
jobs:
|
|
- build:
|
|
filters:
|
|
tags:
|
|
ignore: /^\d+\.\d+\.\d+/
|
|
release:
|
|
jobs:
|
|
- release:
|
|
filters:
|
|
tags:
|
|
only: /^\d+\.\d+\.\d+/
|
|
branches:
|
|
ignore: /.*/ |