-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathij.yaml
70 lines (61 loc) · 1.26 KB
/
ij.yaml
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
environment:
- WORKSPACE=/ijci
- GO_IMAGE=golang:1.12
workspace: ${WORKSPACE}
import:
files: '*'
export:
files:
- vendor
- ijci-api
- ijci-agent
- ijci-migrate
tasks:
install-vendors:
image: ${GO_IMAGE}
script: |
if [ ! -d vendor ]; then
echo "Installing vendors"
go get -u ./...
go mod vendor
fi
go-build:
image: ${GO_IMAGE}
script: |
echo "Building ${APP_NAME} binary"
go build -mod vendor -o ijci-${APP_NAME} ./cmd/${APP_NAME}
environment:
- GOOS=linux
- GOARCH=amd64
- CGO_ENABLED=0
build-image:
type: build
dockerfile: Dockerfile.${APP_NAME}
tags:
- ijci-${APP_NAME}:master-latest
plans:
build:
stages:
- name: deps
tasks:
- install-vendors
- name: build
parallel: true
tasks:
- name: go-build
environment: APP_NAME=api
- name: go-build
environment: APP_NAME=agent
build-images:
stages:
- name: build images
parallel: true
tasks:
- name: build-image
environment: APP_NAME=api
- name: build-image
environment: APP_NAME=agent
metaplans:
default:
- build
- build-images