Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 68275ab

Browse files
authored
Merge pull request #3 from BCDevOps/global-library-tweaks
Global library tweaks
2 parents 0e0ac53 + 088731e commit 68275ab

File tree

4 files changed

+264
-133
lines changed

4 files changed

+264
-133
lines changed

openshift/s2i-nginx-builder-bc.json

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"kind": "List",
3+
"apiVersion": "v1",
4+
"metadata": {},
5+
"items": [
6+
{
7+
"kind": "ImageStream",
8+
"apiVersion": "v1",
9+
"metadata": {
10+
"name": "base-centos7",
11+
"creationTimestamp": null,
12+
"labels": {
13+
"build": "bcgov-s2i-nginx"
14+
},
15+
"annotations": {
16+
"openshift.io/generated-by": "OpenShiftNewBuild"
17+
}
18+
},
19+
"spec": {
20+
"tags": [
21+
{
22+
"name": "latest",
23+
"annotations": {
24+
"openshift.io/imported-from": "openshift/base-centos7"
25+
},
26+
"from": {
27+
"kind": "DockerImage",
28+
"name": "openshift/base-centos7"
29+
},
30+
"generation": null,
31+
"importPolicy": {}
32+
}
33+
]
34+
},
35+
"status": {
36+
"dockerImageRepository": ""
37+
}
38+
},
39+
{
40+
"kind": "ImageStream",
41+
"apiVersion": "v1",
42+
"metadata": {
43+
"name": "bcgov-s2i-nginx",
44+
"creationTimestamp": null,
45+
"labels": {
46+
"build": "bcgov-s2i-nginx"
47+
},
48+
"annotations": {
49+
"openshift.io/generated-by": "OpenShiftNewBuild"
50+
}
51+
},
52+
"spec": {},
53+
"status": {
54+
"dockerImageRepository": ""
55+
}
56+
},
57+
{
58+
"kind": "BuildConfig",
59+
"apiVersion": "v1",
60+
"metadata": {
61+
"name": "bcgov-s2i-nginx",
62+
"creationTimestamp": null,
63+
"labels": {
64+
"build": "bcgov-s2i-nginx"
65+
},
66+
"annotations": {
67+
"openshift.io/generated-by": "OpenShiftNewBuild"
68+
}
69+
},
70+
"spec": {
71+
"triggers": [
72+
{
73+
"type": "ConfigChange"
74+
},
75+
{
76+
"type": "ImageChange",
77+
"imageChange": {}
78+
}
79+
],
80+
"source": {
81+
"type": "Git",
82+
"git": {
83+
"uri": "https://github.com/BCDevOps/s2i-nginx.git"
84+
}
85+
},
86+
"strategy": {
87+
"type": "Docker",
88+
"dockerStrategy": {
89+
"from": {
90+
"kind": "ImageStreamTag",
91+
"name": "base-centos7:latest"
92+
}
93+
}
94+
},
95+
"output": {
96+
"to": {
97+
"kind": "ImageStreamTag",
98+
"name": "bcgov-s2i-nginx:latest"
99+
}
100+
},
101+
"resources": {},
102+
"postCommit": {}
103+
},
104+
"status": {
105+
"lastVersion": 0
106+
}
107+
}
108+
]
109+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
{
2+
"kind": "Template",
3+
"apiVersion": "v1",
4+
"metadata": {
5+
"name": "nginx-reverse-proxy-build",
6+
"annotations": {
7+
"tags": "bcgov,nginx"
8+
}
9+
},
10+
"objects": [
11+
{
12+
"kind": "ImageStream",
13+
"apiVersion": "v1",
14+
"metadata": {
15+
"name": "${NAME}"
16+
}
17+
},
18+
{
19+
"kind": "BuildConfig",
20+
"apiVersion": "v1",
21+
"metadata": {
22+
"name": "${NAME}",
23+
"creationTimestamp": null,
24+
"labels": {
25+
"app": "${NAME}"
26+
}
27+
},
28+
"spec": {
29+
"triggers": [
30+
{
31+
"type": "GitHub",
32+
"github": {
33+
"secret": "${GITHUB_WEBHOOK_SECRET}"
34+
}
35+
},
36+
{
37+
"type": "Generic",
38+
"generic": {
39+
"secret": "${GENERIC_WEBHOOK_SECRET}"
40+
}
41+
},
42+
{
43+
"type": "ConfigChange"
44+
},
45+
{
46+
"type": "ImageChange",
47+
"imageChange": {}
48+
}
49+
],
50+
"runPolicy": "Serial",
51+
"source": {
52+
"type": "Git",
53+
"git": {
54+
"ref": "${SOURCE_REPOSITORY_REF}",
55+
"uri": "${SOURCE_REPOSITORY_URL}"
56+
},
57+
"contextDir": "${CONTEXT_DIR}"
58+
},
59+
"strategy": {
60+
"type": "Source",
61+
"sourceStrategy": {
62+
"from": {
63+
"namespace": "${BUILDER_IMAGESTREAM_NAMESPACE}",
64+
"kind": "ImageStreamTag",
65+
"name": "${BUILDER_IMAGESTREAM_TAG}"
66+
},
67+
"env": [
68+
{
69+
"name": "NGINX_PROXY_URL",
70+
"value": "${NGINX_PROXY_URL}"
71+
}
72+
]
73+
}
74+
},
75+
"output": {
76+
"to": {
77+
"kind": "ImageStreamTag",
78+
"name": "${NAME}:latest"
79+
}
80+
},
81+
"resources": {},
82+
"postCommit": {}
83+
},
84+
"status": {
85+
"lastVersion": 0
86+
}
87+
}
88+
],
89+
"parameters": [
90+
{
91+
"name": "NAME",
92+
"displayName": "Name",
93+
"description": "The name assigned to all of the frontend objects defined in this template.",
94+
"required": true,
95+
"value": "nginx-reverse-proxy"
96+
},
97+
{
98+
"name": "BUILDER_IMAGESTREAM_TAG",
99+
"displayName": "Builder ImageStreamTag",
100+
"description": "The image stream tag (e.g. rproxy:latest) of the S2I image that should be used to build the application.",
101+
"required": true,
102+
"value": "bcgov-s2i-nginx:latest"
103+
},
104+
{
105+
"name": "BUILDER_IMAGESTREAM_NAMESPACE",
106+
"displayName": "Builder ImageStream Namespace",
107+
"description": "The namespace containing the image stream tag (e.g. rproxy:latest) of the S2I image that should be used to build the application.",
108+
"required": true,
109+
"value": "openshift"
110+
},
111+
{
112+
"name": "SOURCE_REPOSITORY_URL",
113+
"displayName": "Git Repository URL",
114+
"description": "The URL of the repository with your nginx configuration code.",
115+
"required": true
116+
},
117+
{
118+
"name": "SOURCE_REPOSITORY_REF",
119+
"displayName": "Git Reference",
120+
"description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch."
121+
},
122+
{
123+
"name": "CONTEXT_DIR",
124+
"displayName": "Configuration files path (Context Dir)",
125+
"description": "Set this to the path where NGINX files are located within the GitHub repo.",
126+
"required": false
127+
},
128+
{
129+
"name": "GITHUB_WEBHOOK_SECRET",
130+
"displayName": "GitHub Webhook Secret",
131+
"description": "A secret string used to configure the GitHub webhook.",
132+
"generate": "expression",
133+
"from": "[a-zA-Z0-9]{40}"
134+
},
135+
{
136+
"name": "GENERIC_WEBHOOK_SECRET",
137+
"displayName": "Generic Webhook Secret",
138+
"description": "A secret string used to configure the Generic webhook.",
139+
"generate": "expression",
140+
"from": "[a-zA-Z0-9]{40}"
141+
},
142+
{
143+
"name": "NGINX_PROXY_URL",
144+
"displayName": "NGinx Proxy URL",
145+
"description": "The URL you want NGinx to proxy to, e.g., http://<service-name>:port/",
146+
"required": true
147+
}
148+
]
149+
}

openshift/templates/rproxy-environment-template.json renamed to openshift/templates/nginx-deployment-template.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
"kind": "Template",
33
"apiVersion": "v1",
44
"metadata": {
5-
"name": "true",
6-
"creationTimestamp": null
5+
"name": "nginx-reverse-proxy-deployment",
6+
"annotations": {
7+
"tags": "bcgov,nginx"
8+
}
79
},
810
"objects": [
911
{
@@ -157,7 +159,7 @@
157159
{
158160
"name": "APPLICATION_DOMAIN",
159161
"displayName": "Application Hostname",
160-
"description": "The exposed hostname that will route to the MyGovBC service, if left blank a value will be defaulted.",
162+
"description": "The exposed hostname for the application/service.",
161163
"required": true
162164
},
163165
{
@@ -186,4 +188,4 @@
186188
"required": true
187189
}
188190
]
189-
}
191+
}

0 commit comments

Comments
 (0)