openjdk18-web-basic-s2i.json 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "iconClass": "icon-jboss",
  7. "description": "Application template for Java applications built using S2I.",
  8. "tags": "java,xpaas",
  9. "version": "1.1.0",
  10. "openshift.io/display-name": "Red Hat OpenJDK 8"
  11. },
  12. "name": "openjdk18-web-basic-s2i"
  13. },
  14. "labels": {
  15. "template": "openjdk18-web-basic-s2i",
  16. "xpaas": "1.4.0"
  17. },
  18. "message": "A new java application has been created in your project.",
  19. "parameters": [
  20. {
  21. "description": "The name for the application.",
  22. "displayName": "Application Name",
  23. "name": "APPLICATION_NAME",
  24. "value": "openjdk-app",
  25. "required": true
  26. },
  27. {
  28. "description": "Custom hostname for http service route. Leave blank for default hostname, e.g.: <application-name>-<project>.<default-domain-suffix>",
  29. "displayName": "Custom http Route Hostname",
  30. "name": "HOSTNAME_HTTP",
  31. "value": "",
  32. "required": false
  33. },
  34. {
  35. "description": "Git source URI for application",
  36. "displayName": "Git Repository URL",
  37. "name": "SOURCE_REPOSITORY_URL",
  38. "value": "https://github.com/jboss-openshift/openshift-quickstarts",
  39. "required": true
  40. },
  41. {
  42. "description": "Git branch/tag reference",
  43. "displayName": "Git Reference",
  44. "name": "SOURCE_REPOSITORY_REF",
  45. "value": "master",
  46. "required": false
  47. },
  48. {
  49. "description": "Path within Git project to build; empty for root project directory.",
  50. "displayName": "Context Directory",
  51. "name": "CONTEXT_DIR",
  52. "value": "undertow-servlet",
  53. "required": false
  54. },
  55. {
  56. "description": "GitHub trigger secret",
  57. "displayName": "Github Webhook Secret",
  58. "name": "GITHUB_WEBHOOK_SECRET",
  59. "from": "[a-zA-Z0-9]{8}",
  60. "generate": "expression",
  61. "required": true
  62. },
  63. {
  64. "description": "Generic build trigger secret",
  65. "displayName": "Generic Webhook Secret",
  66. "name": "GENERIC_WEBHOOK_SECRET",
  67. "from": "[a-zA-Z0-9]{8}",
  68. "generate": "expression",
  69. "required": true
  70. },
  71. {
  72. "description": "Namespace in which the ImageStreams for Red Hat Middleware images are installed. These ImageStreams are normally installed in the openshift namespace. You should only need to modify this if you've installed the ImageStreams in a different namespace/project.",
  73. "displayName": "ImageStream Namespace",
  74. "name": "IMAGE_STREAM_NAMESPACE",
  75. "value": "openshift",
  76. "required": true
  77. }
  78. ],
  79. "objects": [
  80. {
  81. "kind": "Service",
  82. "apiVersion": "v1",
  83. "spec": {
  84. "ports": [
  85. {
  86. "port": 8080,
  87. "targetPort": 8080
  88. }
  89. ],
  90. "selector": {
  91. "deploymentConfig": "${APPLICATION_NAME}"
  92. }
  93. },
  94. "metadata": {
  95. "name": "${APPLICATION_NAME}",
  96. "labels": {
  97. "application": "${APPLICATION_NAME}"
  98. },
  99. "annotations": {
  100. "description": "The application's http port."
  101. }
  102. }
  103. },
  104. {
  105. "kind": "Route",
  106. "apiVersion": "v1",
  107. "id": "${APPLICATION_NAME}-http",
  108. "metadata": {
  109. "name": "${APPLICATION_NAME}",
  110. "labels": {
  111. "application": "${APPLICATION_NAME}"
  112. },
  113. "annotations": {
  114. "description": "Route for application's http service."
  115. }
  116. },
  117. "spec": {
  118. "host": "${HOSTNAME_HTTP}",
  119. "to": {
  120. "name": "${APPLICATION_NAME}"
  121. }
  122. }
  123. },
  124. {
  125. "kind": "ImageStream",
  126. "apiVersion": "v1",
  127. "metadata": {
  128. "name": "${APPLICATION_NAME}",
  129. "labels": {
  130. "application": "${APPLICATION_NAME}"
  131. }
  132. }
  133. },
  134. {
  135. "kind": "BuildConfig",
  136. "apiVersion": "v1",
  137. "metadata": {
  138. "name": "${APPLICATION_NAME}",
  139. "labels": {
  140. "application": "${APPLICATION_NAME}"
  141. }
  142. },
  143. "spec": {
  144. "source": {
  145. "type": "Git",
  146. "git": {
  147. "uri": "${SOURCE_REPOSITORY_URL}",
  148. "ref": "${SOURCE_REPOSITORY_REF}"
  149. },
  150. "contextDir": "${CONTEXT_DIR}"
  151. },
  152. "strategy": {
  153. "type": "Source",
  154. "sourceStrategy": {
  155. "forcePull": true,
  156. "from": {
  157. "kind": "ImageStreamTag",
  158. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  159. "name": "redhat-openjdk18-openshift:1.1"
  160. }
  161. }
  162. },
  163. "output": {
  164. "to": {
  165. "kind": "ImageStreamTag",
  166. "name": "${APPLICATION_NAME}:latest"
  167. }
  168. },
  169. "triggers": [
  170. {
  171. "type": "GitHub",
  172. "github": {
  173. "secret": "${GITHUB_WEBHOOK_SECRET}"
  174. }
  175. },
  176. {
  177. "type": "Generic",
  178. "generic": {
  179. "secret": "${GENERIC_WEBHOOK_SECRET}"
  180. }
  181. },
  182. {
  183. "type": "ImageChange",
  184. "imageChange": {}
  185. },
  186. {
  187. "type": "ConfigChange"
  188. }
  189. ]
  190. }
  191. },
  192. {
  193. "kind": "DeploymentConfig",
  194. "apiVersion": "v1",
  195. "metadata": {
  196. "name": "${APPLICATION_NAME}",
  197. "labels": {
  198. "application": "${APPLICATION_NAME}"
  199. }
  200. },
  201. "spec": {
  202. "strategy": {
  203. "type": "Recreate"
  204. },
  205. "triggers": [
  206. {
  207. "type": "ImageChange",
  208. "imageChangeParams": {
  209. "automatic": true,
  210. "containerNames": [
  211. "${APPLICATION_NAME}"
  212. ],
  213. "from": {
  214. "kind": "ImageStreamTag",
  215. "name": "${APPLICATION_NAME}:latest"
  216. }
  217. }
  218. },
  219. {
  220. "type": "ConfigChange"
  221. }
  222. ],
  223. "replicas": 1,
  224. "selector": {
  225. "deploymentConfig": "${APPLICATION_NAME}"
  226. },
  227. "template": {
  228. "metadata": {
  229. "name": "${APPLICATION_NAME}",
  230. "labels": {
  231. "deploymentConfig": "${APPLICATION_NAME}",
  232. "application": "${APPLICATION_NAME}"
  233. }
  234. },
  235. "spec": {
  236. "terminationGracePeriodSeconds": 75,
  237. "containers": [
  238. {
  239. "name": "${APPLICATION_NAME}",
  240. "image": "${APPLICATION_NAME}",
  241. "imagePullPolicy": "Always",
  242. "env": [
  243. ],
  244. "ports": [
  245. {
  246. "name": "jolokia",
  247. "containerPort": 8778,
  248. "protocol": "TCP"
  249. },
  250. {
  251. "name": "http",
  252. "containerPort": 8080,
  253. "protocol": "TCP"
  254. },
  255. {
  256. "name": "https",
  257. "containerPort": 8443,
  258. "protocol": "TCP"
  259. }
  260. ]
  261. }
  262. ]
  263. }
  264. }
  265. }
  266. }
  267. ]
  268. }