cakephp.json 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "name": "cakephp-example",
  6. "annotations": {
  7. "description": "An example CakePHP application with no database",
  8. "tags": "quickstart,php,cakephp",
  9. "iconClass": "icon-php"
  10. }
  11. },
  12. "labels": {
  13. "template": "cakephp-example"
  14. },
  15. "objects": [
  16. {
  17. "kind": "Service",
  18. "apiVersion": "v1",
  19. "metadata": {
  20. "name": "${NAME}",
  21. "annotations": {
  22. "description": "Exposes and load balances the application pods"
  23. }
  24. },
  25. "spec": {
  26. "ports": [
  27. {
  28. "name": "web",
  29. "port": 8080,
  30. "targetPort": 8080
  31. }
  32. ],
  33. "selector": {
  34. "name": "${NAME}"
  35. }
  36. }
  37. },
  38. {
  39. "kind": "Route",
  40. "apiVersion": "v1",
  41. "metadata": {
  42. "name": "${NAME}"
  43. },
  44. "spec": {
  45. "host": "${APPLICATION_DOMAIN}",
  46. "to": {
  47. "kind": "Service",
  48. "name": "${NAME}"
  49. }
  50. }
  51. },
  52. {
  53. "kind": "ImageStream",
  54. "apiVersion": "v1",
  55. "metadata": {
  56. "name": "${NAME}",
  57. "annotations": {
  58. "description": "Keeps track of changes in the application image"
  59. }
  60. }
  61. },
  62. {
  63. "kind": "BuildConfig",
  64. "apiVersion": "v1",
  65. "metadata": {
  66. "name": "${NAME}",
  67. "annotations": {
  68. "description": "Defines how to build the application"
  69. }
  70. },
  71. "spec": {
  72. "source": {
  73. "type": "Git",
  74. "git": {
  75. "uri": "${SOURCE_REPOSITORY_URL}",
  76. "ref": "${SOURCE_REPOSITORY_REF}"
  77. },
  78. "contextDir": "${CONTEXT_DIR}"
  79. },
  80. "strategy": {
  81. "type": "Source",
  82. "sourceStrategy": {
  83. "from": {
  84. "kind": "ImageStreamTag",
  85. "namespace": "openshift",
  86. "name": "php:5.6"
  87. }
  88. }
  89. },
  90. "output": {
  91. "to": {
  92. "kind": "ImageStreamTag",
  93. "name": "${NAME}:latest"
  94. }
  95. },
  96. "triggers": [
  97. {
  98. "type": "ImageChange"
  99. },
  100. {
  101. "type": "ConfigChange"
  102. },
  103. {
  104. "type": "GitHub",
  105. "github": {
  106. "secret": "${GITHUB_WEBHOOK_SECRET}"
  107. }
  108. }
  109. ]
  110. }
  111. },
  112. {
  113. "kind": "DeploymentConfig",
  114. "apiVersion": "v1",
  115. "metadata": {
  116. "name": "${NAME}",
  117. "annotations": {
  118. "description": "Defines how to deploy the application server"
  119. }
  120. },
  121. "spec": {
  122. "strategy": {
  123. "type": "Rolling"
  124. },
  125. "triggers": [
  126. {
  127. "type": "ImageChange",
  128. "imageChangeParams": {
  129. "automatic": true,
  130. "containerNames": [
  131. "cakephp-example"
  132. ],
  133. "from": {
  134. "kind": "ImageStreamTag",
  135. "name": "${NAME}:latest"
  136. }
  137. }
  138. },
  139. {
  140. "type": "ConfigChange"
  141. }
  142. ],
  143. "replicas": 1,
  144. "selector": {
  145. "name": "${NAME}"
  146. },
  147. "template": {
  148. "metadata": {
  149. "name": "${NAME}",
  150. "labels": {
  151. "name": "${NAME}"
  152. }
  153. },
  154. "spec": {
  155. "containers": [
  156. {
  157. "name": "cakephp-example",
  158. "image": "cakephp-example",
  159. "ports": [
  160. {
  161. "containerPort": 8080
  162. }
  163. ],
  164. "readinessProbe": {
  165. "timeoutSeconds": 3,
  166. "initialDelaySeconds": 3,
  167. "httpGet": {
  168. "path": "/",
  169. "port": 8080
  170. }
  171. },
  172. "livenessProbe": {
  173. "timeoutSeconds": 3,
  174. "initialDelaySeconds": 30,
  175. "httpGet": {
  176. "path": "/",
  177. "port": 8080
  178. }
  179. },
  180. "env": [
  181. {
  182. "name": "DATABASE_SERVICE_NAME",
  183. "value": "${DATABASE_SERVICE_NAME}"
  184. },
  185. {
  186. "name": "DATABASE_ENGINE",
  187. "value": "${DATABASE_ENGINE}"
  188. },
  189. {
  190. "name": "DATABASE_NAME",
  191. "value": "${DATABASE_NAME}"
  192. },
  193. {
  194. "name": "DATABASE_USER",
  195. "value": "${DATABASE_USER}"
  196. },
  197. {
  198. "name": "DATABASE_PASSWORD",
  199. "value": "${DATABASE_PASSWORD}"
  200. },
  201. {
  202. "name": "CAKEPHP_SECRET_TOKEN",
  203. "value": "${CAKEPHP_SECRET_TOKEN}"
  204. },
  205. {
  206. "name": "CAKEPHP_SECURITY_SALT",
  207. "value": "${CAKEPHP_SECURITY_SALT}"
  208. },
  209. {
  210. "name": "CAKEPHP_SECURITY_CIPHER_SEED",
  211. "value": "${CAKEPHP_SECURITY_CIPHER_SEED}"
  212. },
  213. {
  214. "name": "OPCACHE_REVALIDATE_FREQ",
  215. "value": "${OPCACHE_REVALIDATE_FREQ}"
  216. }
  217. ],
  218. "resources": {
  219. "limits": {
  220. "memory": "${MEMORY_LIMIT}"
  221. }
  222. }
  223. }
  224. ]
  225. }
  226. }
  227. }
  228. }
  229. ],
  230. "parameters": [
  231. {
  232. "name": "NAME",
  233. "displayName": "Name",
  234. "description": "The name assigned to all of the frontend objects defined in this template.",
  235. "required": true,
  236. "value": "cakephp-example"
  237. },
  238. {
  239. "name": "MEMORY_LIMIT",
  240. "displayName": "Memory Limit",
  241. "description": "Maximum amount of memory the container can use.",
  242. "value": "512Mi"
  243. },
  244. {
  245. "name": "SOURCE_REPOSITORY_URL",
  246. "displayName": "Git Repository URL",
  247. "description": "The URL of the repository with your application source code.",
  248. "value": "https://github.com/openshift/cakephp-ex.git"
  249. },
  250. {
  251. "name": "SOURCE_REPOSITORY_REF",
  252. "displayName": "Git Reference",
  253. "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch."
  254. },
  255. {
  256. "name": "CONTEXT_DIR",
  257. "displayName": "Context Directory",
  258. "description": "Set this to the relative path to your project if it is not in the root of your repository."
  259. },
  260. {
  261. "name": "APPLICATION_DOMAIN",
  262. "displayName": "Application Hostname",
  263. "description": "The exposed hostname that will route to the CakePHP service, if left blank a value will be defaulted.",
  264. "value": ""
  265. },
  266. {
  267. "name": "GITHUB_WEBHOOK_SECRET",
  268. "displayName": "GitHub Webhook Secret",
  269. "description": "A secret string used to configure the GitHub webhook.",
  270. "generate": "expression",
  271. "from": "[a-zA-Z0-9]{40}"
  272. },
  273. {
  274. "name": "DATABASE_SERVICE_NAME",
  275. "displayName": "Database Service Name"
  276. },
  277. {
  278. "name": "DATABASE_ENGINE",
  279. "displayName": "Database Engine",
  280. "description": "Database engine: postgresql, mysql or sqlite (default)."
  281. },
  282. {
  283. "name": "DATABASE_NAME",
  284. "displayName": "Database Name"
  285. },
  286. {
  287. "name": "DATABASE_USER",
  288. "displayName": "Database User"
  289. },
  290. {
  291. "name": "DATABASE_PASSWORD",
  292. "displayName": "Database Password"
  293. },
  294. {
  295. "name": "CAKEPHP_SECRET_TOKEN",
  296. "displayName": "CakePHP Secret Token",
  297. "description": "Set this to a long random string.",
  298. "generate": "expression",
  299. "from": "[\\w]{50}"
  300. },
  301. {
  302. "name": "CAKEPHP_SECURITY_SALT",
  303. "displayName": "CakePHP Security Salt",
  304. "description": "Security salt for session hash.",
  305. "generate": "expression",
  306. "from": "[a-zA-Z0-9]{40}"
  307. },
  308. {
  309. "name": "CAKEPHP_SECURITY_CIPHER_SEED",
  310. "displayName": "CakePHP Security Cipher Seed",
  311. "description": "Security cipher seed for session hash.",
  312. "generate": "expression",
  313. "from": "[0-9]{30}"
  314. },
  315. {
  316. "name": "OPCACHE_REVALIDATE_FREQ",
  317. "displayName": "OPcache Revalidation Frequency",
  318. "description": "How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.",
  319. "value": "2"
  320. }
  321. ]
  322. }