This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile-over-git.yaml
140 lines (140 loc) · 3.67 KB
/
dockerfile-over-git.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
apiVersion: v1
kind: Template
labels:
template: dockerfile-over-git
metadata:
annotations:
description: An instant app built using Dockerfile pulled from Git
tags: instant-app,docker
name: dockerfile-over-git
objects:
- apiVersion: v1
kind: BuildConfig
metadata:
annotations:
description: Defines how to build the application
name: dockerfile-over-git
spec:
output:
to:
kind: ImageStreamTag
name: dockerfile-over-git:latest
source:
contextDir: ${CONTEXT_DIR}
git:
ref: ${SOURCE_REPOSITORY_REF}
uri: ${SOURCE_REPOSITORY_URL}
type: Git
strategy:
type: Docker
dockerStrategy:
from:
kind: ImageStreamTag
name: dockerfile-over-git-builder-image:${BASE_IMAGE_TAG}
triggers:
- type: ImageChange
- github:
secret: ${GITHUB_WEBHOOK_SECRET}
type: GitHub
- generic:
secret: ${GENERIC_WEBHOOK_SECRET}
type: Generic
- apiVersion: v1
kind: ImageStream
metadata:
annotations:
description: Keeps track of changes in the application image
name: dockerfile-over-git
- apiVersion: v1
kind: ImageStream
metadata:
annotations:
description: Builder Image
name: dockerfile-over-git-builder-image
spec:
dockerImageRepository: ${BASE_IMAGE}
- apiVersion: v1
kind: DeploymentConfig
metadata:
annotations:
description: Defines how to deploy the application server
name: dockerfile-over-git
spec:
replicas: 1
selector:
name: dockerfile-over-git
strategy:
type: Rolling
template:
metadata:
labels:
name: dockerfile-over-git
name: dockerfile-over-git
spec:
containers:
- env:
image: dockerfile-over-git
name: dockerfile-over-git
triggers:
- imageChangeParams:
automatic: true
containerNames:
- dockerfile-over-git
from:
kind: ImageStreamTag
name: dockerfile-over-git:latest
type: ImageChange
- type: ConfigChange
- apiVersion: v1
kind: Service
metadata:
annotations:
description: Exposes and load balances the application pods
name: dockerfile-over-git
spec:
ports:
- name: web
port: 8080
targetPort: 8080
selector:
name: dockerfile-over-git
- apiVersion: v1
kind: Route
metadata:
name: ${APPLICATION_NAME}
spec:
host:
to:
kind: Service
name: dockerfile-over-git
parameters:
- description: The name of the application matching Regex [a-z-_]{2}[a-z-_0-9]*
name: APPLICATION_NAME
from: '[a-z-_]{2}[a-z-_0-9]*'
generate: expression
value: my-app
required: true
- description: The URL of the repository containing Dockerfile
name: SOURCE_REPOSITORY_URL
required: true
- description: Set this to a branch name, tag or other ref of your repository if you
are not using the default branch
name: SOURCE_REPOSITORY_REF
- description: Set this to the relative path to Dockerfile if it is not in the root
of your repository
name: CONTEXT_DIR
- description: Base image name. This is the image name in FROM clause of Dockerfile before colon. For example, node.
name: BASE_IMAGE
required: true
- description: Base image tag. This is the image tag in FROM clause of Dockerfile after colon. For example, 4.2-onbuild.
name: BASE_IMAGE_TAG
required: true
value: latest
- description: A secret string used to configure the GitHub webhook
from: '[a-zA-Z0-9]{40}'
generate: expression
name: GITHUB_WEBHOOK_SECRET
- description: A secret string used to configure the Generic webhook
from: '[a-zA-Z0-9]{40}'
generate: expression
name: GENERIC_WEBHOOK_SECRET