eap6-basic-sti.json 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "iconClass" : "icon-jboss",
  7. "description": "Application template for EAP 6 applications built using STI."
  8. },
  9. "name": "eap6-basic-sti"
  10. },
  11. "labels": {
  12. "template": "eap6-basic-sti"
  13. },
  14. "parameters": [
  15. {
  16. "description": "EAP Release version, e.g. 6.4, etc.",
  17. "name": "EAP_RELEASE",
  18. "value": "6.4"
  19. },
  20. {
  21. "description": "The name for the application.",
  22. "name": "APPLICATION_NAME",
  23. "value": "eap-app"
  24. },
  25. {
  26. "description": "Custom hostname for service routes. Leave blank for default hostname, e.g.: <application-name>.<project>.<default-domain-suffix>",
  27. "name": "APPLICATION_HOSTNAME",
  28. "value": ""
  29. },
  30. {
  31. "description": "Git source URI for application",
  32. "name": "GIT_URI",
  33. "value": "https://github.com/jboss-developer/jboss-eap-quickstarts"
  34. },
  35. {
  36. "description": "Git branch/tag reference",
  37. "name": "GIT_REF",
  38. "value": "6.4.x"
  39. },
  40. {
  41. "description": "Path within Git project to build; empty for root project directory.",
  42. "name": "GIT_CONTEXT_DIR",
  43. "value": "kitchensink"
  44. },
  45. {
  46. "description": "Queue names",
  47. "name": "HORNETQ_QUEUES",
  48. "value": ""
  49. },
  50. {
  51. "description": "Topic names",
  52. "name": "HORNETQ_TOPICS",
  53. "value": ""
  54. },
  55. {
  56. "description": "HornetQ cluster admin password",
  57. "name": "HORNETQ_CLUSTER_PASSWORD",
  58. "from": "[a-zA-Z0-9]{8}",
  59. "generate": "expression"
  60. },
  61. {
  62. "description": "Github trigger secret",
  63. "name": "GITHUB_TRIGGER_SECRET",
  64. "from": "[a-zA-Z0-9]{8}",
  65. "generate": "expression"
  66. },
  67. {
  68. "description": "Generic build trigger secret",
  69. "name": "GENERIC_TRIGGER_SECRET",
  70. "from": "[a-zA-Z0-9]{8}",
  71. "generate": "expression"
  72. }
  73. ],
  74. "objects": [
  75. {
  76. "kind": "Service",
  77. "apiVersion": "v1",
  78. "spec": {
  79. "ports": [
  80. {
  81. "port": 8080,
  82. "targetPort": 8080
  83. }
  84. ],
  85. "selector": {
  86. "deploymentConfig": "${APPLICATION_NAME}"
  87. }
  88. },
  89. "metadata": {
  90. "name": "${APPLICATION_NAME}",
  91. "labels": {
  92. "application": "${APPLICATION_NAME}"
  93. },
  94. "annotations": {
  95. "description": "The web server's http port."
  96. }
  97. }
  98. },
  99. {
  100. "kind": "Service",
  101. "apiVersion": "v1",
  102. "spec": {
  103. "ports": [
  104. {
  105. "port": 8888,
  106. "targetPort": 8888
  107. }
  108. ],
  109. "portalIP": "None",
  110. "selector": {
  111. "deploymentConfig": "${APPLICATION_NAME}"
  112. }
  113. },
  114. "metadata": {
  115. "name": "${APPLICATION_NAME}-ping",
  116. "labels": {
  117. "application": "${APPLICATION_NAME}"
  118. },
  119. "annotations": {
  120. "description": "Ping service for clustered applications."
  121. }
  122. }
  123. },
  124. {
  125. "kind": "Route",
  126. "apiVersion": "v1",
  127. "id": "${APPLICATION_NAME}-http-route",
  128. "metadata": {
  129. "name": "${APPLICATION_NAME}-http-route",
  130. "labels": {
  131. "application": "${APPLICATION_NAME}"
  132. },
  133. "annotations": {
  134. "description": "Route for application's http service."
  135. }
  136. },
  137. "spec": {
  138. "host": "${APPLICATION_HOSTNAME}",
  139. "to": {
  140. "name": "${APPLICATION_NAME}"
  141. }
  142. }
  143. },
  144. {
  145. "kind": "ImageStream",
  146. "apiVersion": "v1",
  147. "metadata": {
  148. "name": "${APPLICATION_NAME}",
  149. "labels": {
  150. "application": "${APPLICATION_NAME}"
  151. }
  152. }
  153. },
  154. {
  155. "kind": "BuildConfig",
  156. "apiVersion": "v1",
  157. "metadata": {
  158. "name": "${APPLICATION_NAME}",
  159. "labels": {
  160. "application": "${APPLICATION_NAME}"
  161. }
  162. },
  163. "spec": {
  164. "source": {
  165. "type": "Git",
  166. "git": {
  167. "uri": "${GIT_URI}",
  168. "ref": "${GIT_REF}"
  169. },
  170. "contextDir":"${GIT_CONTEXT_DIR}"
  171. },
  172. "strategy": {
  173. "type": "Source",
  174. "sourceStrategy": {
  175. "from": {
  176. "kind": "ImageStreamTag",
  177. "namespace": "openshift",
  178. "name": "jboss-eap6-openshift:${EAP_RELEASE}"
  179. }
  180. }
  181. },
  182. "output": {
  183. "to": {
  184. "kind": "ImageStreamTag",
  185. "name": "${APPLICATION_NAME}:latest"
  186. }
  187. },
  188. "triggers": [
  189. {
  190. "type": "GitHub",
  191. "github": {
  192. "secret": "${GITHUB_TRIGGER_SECRET}"
  193. }
  194. },
  195. {
  196. "type": "Generic",
  197. "generic": {
  198. "secret": "${GENERIC_TRIGGER_SECRET}"
  199. }
  200. },
  201. {
  202. "type": "ImageChange",
  203. "imageChange": {}
  204. }
  205. ]
  206. }
  207. },
  208. {
  209. "kind": "DeploymentConfig",
  210. "apiVersion": "v1",
  211. "metadata": {
  212. "name": "${APPLICATION_NAME}",
  213. "labels": {
  214. "application": "${APPLICATION_NAME}"
  215. }
  216. },
  217. "spec": {
  218. "strategy": {
  219. "type": "Recreate"
  220. },
  221. "triggers": [
  222. {
  223. "type": "ImageChange",
  224. "imageChangeParams": {
  225. "automatic": true,
  226. "containerNames": [
  227. "${APPLICATION_NAME}"
  228. ],
  229. "from": {
  230. "kind": "ImageStream",
  231. "name": "${APPLICATION_NAME}"
  232. }
  233. }
  234. }
  235. ],
  236. "replicas": 1,
  237. "selector": {
  238. "deploymentConfig": "${APPLICATION_NAME}"
  239. },
  240. "template": {
  241. "metadata": {
  242. "name": "${APPLICATION_NAME}",
  243. "labels": {
  244. "deploymentConfig": "${APPLICATION_NAME}",
  245. "application": "${APPLICATION_NAME}"
  246. }
  247. },
  248. "spec": {
  249. "containers": [
  250. {
  251. "name": "${APPLICATION_NAME}",
  252. "image": "${APPLICATION_NAME}",
  253. "imagePullPolicy": "Always",
  254. "readinessProbe": {
  255. "exec": {
  256. "command": [
  257. "/bin/bash",
  258. "-c",
  259. "/opt/eap/bin/readinessProbe.sh"
  260. ]
  261. }
  262. },
  263. "ports": [
  264. {
  265. "name": "http",
  266. "containerPort": 8080,
  267. "protocol": "TCP"
  268. },
  269. {
  270. "name": "ping",
  271. "containerPort": 8888,
  272. "protocol": "TCP"
  273. }
  274. ],
  275. "env": [
  276. {
  277. "name": "OPENSHIFT_DNS_PING_SERVICE_NAME",
  278. "value": "${APPLICATION_NAME}-ping"
  279. },
  280. {
  281. "name": "OPENSHIFT_DNS_PING_SERVICE_PORT",
  282. "value": "8888"
  283. },
  284. {
  285. "name": "HORNETQ_CLUSTER_PASSWORD",
  286. "value": "${HORNETQ_CLUSTER_PASSWORD}"
  287. },
  288. {
  289. "name": "HORNETQ_QUEUES",
  290. "value": "${HORNETQ_QUEUES}"
  291. },
  292. {
  293. "name": "HORNETQ_TOPICS",
  294. "value": "${HORNETQ_TOPICS}"
  295. }
  296. ]
  297. }
  298. ]
  299. }
  300. }
  301. }
  302. }
  303. ]
  304. }