openjdk18-web-basic-s2i.json 9.2 KB

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