-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.yaml
75 lines (75 loc) · 1.89 KB
/
build.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
71
72
73
74
75
apiVersion: v1
kind: List
items:
- kind: ImageStream
apiVersion: v1
metadata:
name: snowstorm
- kind: BuildConfig
apiVersion: v1
metadata:
name: snowstorm-binary
spec:
successfulBuildsHistoryLimit: 1
failedBuildsHistoryLimit: 2
output:
to:
kind: ImageStreamTag
name: snowstorm:binaries
source:
git:
ref: master
uri: https://github.com/mfojtik/snowstorm.git
type: Git
dockerfile: |
FROM openshift/origin-release:golang-1.9
COPY . /go/src/github.com/mfojtik/snowstorm
RUN cd /go/src/github.com/mfojtik/snowstorm && \
mkdir -p /static && \
cp -r static/* /static && \
CGO_ENABLED=0 go install ./cmd/snowstorm/... && \
rm -rf /go/src /go/pkg
strategy:
dockerStrategy:
from:
kind: DockerImage
name: openshift/origin-release:golang-1.9
imageOptimizationPolicy: SkipLayers
- apiVersion: v1
kind: BuildConfig
metadata:
name: snowstorm
spec:
successfulBuildsHistoryLimit: 1
failedBuildsHistoryLimit: 2
output:
to:
kind: ImageStreamTag
name: snowstorm:latest
source:
dockerfile: |
FROM centos:7
COPY snowstorm /usr/bin/snowstorm
COPY static /static
ENTRYPOINT [ "/usr/bin/snowstorm", "-alsologtostderr", "-logtostderr" ]
images:
- from:
kind: ImageStreamTag
name: snowstorm:binaries
paths:
- destinationDir: .
sourcePath: /go/bin/snowstorm
- destinationDir: .
sourcePath: /static
strategy:
dockerStrategy:
from:
kind: DockerImage
name: centos:7
imageOptimizationPolicy: SkipLayers
triggers:
- imageChange:
from:
kind: ImageStreamTag
name: snowstorm:binaries
type: ImageChange