-
Notifications
You must be signed in to change notification settings - Fork 12
/
circle.yml
76 lines (72 loc) · 1.67 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: 2
jobs:
build:
docker:
- image: circleci/golang:1.9
working_directory: /go/src/github.com/openfresh/ecs-formation
steps:
- checkout
- run:
name: deps
command: make deps
- run:
name: test
command: make test
- persist_to_workspace:
root: .
paths:
- "*"
build_image:
docker:
- image: docker:17.09.0-ce
steps:
- attach_workspace:
at: .
- setup_remote_docker:
version: 17.09.0-ce
docker_layer_caching: true
reusable: true
- run:
name: docker login
command: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run:
name: docker build
command: docker build -t openfresh/ecs-formation:latest .
- run:
name: check docker image
command: docker images
- run:
name: release latest
command: docker push openfresh/ecs-formation:latest
- persist_to_workspace:
root: .
paths:
- "*"
release:
docker:
- image: circleci/golang:1.9
working_directory: /go/src/github.com/openfresh/ecs-formation
steps:
- attach_workspace:
at: .
- run: make build-all
- run: ./release.sh
workflows:
version: 2
build_and_release:
jobs:
- build
- build_image:
requires:
- build
filters:
branches:
only: master
- release:
requires:
- build_image
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/