cakephp-mysql.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "name": "cakephp-mysql-example",
  6. "annotations": {
  7. "description": "An example CakePHP application with a MySQL database",
  8. "tags": "quickstart,php,cakephp,mysql",
  9. "iconClass": "icon-php"
  10. }
  11. },
  12. "labels": {
  13. "template": "cakephp-mysql-example"
  14. },
  15. "objects": [
  16. {
  17. "kind": "Service",
  18. "apiVersion": "v1",
  19. "metadata": {
  20. "name": "cakephp-mysql-example",
  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": "cakephp-mysql-example"
  35. }
  36. }
  37. },
  38. {
  39. "kind": "Route",
  40. "apiVersion": "v1",
  41. "metadata": {
  42. "name": "cakephp-mysql-example"
  43. },
  44. "spec": {
  45. "host": "${APPLICATION_DOMAIN}",
  46. "to": {
  47. "kind": "Service",
  48. "name": "cakephp-mysql-example"
  49. }
  50. }
  51. },
  52. {
  53. "kind": "ImageStream",
  54. "apiVersion": "v1",
  55. "metadata": {
  56. "name": "cakephp-mysql-example",
  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": "cakephp-mysql-example",
  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": "cakephp-mysql-example: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": "cakephp-mysql-example",
  117. "annotations": {
  118. "description": "Defines how to deploy the application server"
  119. }
  120. },
  121. "spec": {
  122. "strategy": {
  123. "type": "Rolling",
  124. "recreateParams": {
  125. "pre": {
  126. "failurePolicy": "Abort",
  127. "execNewPod": {
  128. "command": [
  129. "./migrate-database.sh"
  130. ],
  131. "containerName": "cakephp-mysql-example"
  132. }
  133. }
  134. }
  135. },
  136. "triggers": [
  137. {
  138. "type": "ImageChange",
  139. "imageChangeParams": {
  140. "automatic": true,
  141. "containerNames": [
  142. "cakephp-mysql-example"
  143. ],
  144. "from": {
  145. "kind": "ImageStreamTag",
  146. "name": "cakephp-mysql-example:latest"
  147. }
  148. }
  149. },
  150. {
  151. "type": "ConfigChange"
  152. }
  153. ],
  154. "replicas": 1,
  155. "selector": {
  156. "name": "cakephp-mysql-example"
  157. },
  158. "template": {
  159. "metadata": {
  160. "name": "cakephp-mysql-example",
  161. "labels": {
  162. "name": "cakephp-mysql-example"
  163. }
  164. },
  165. "spec": {
  166. "containers": [
  167. {
  168. "name": "cakephp-mysql-example",
  169. "image": "cakephp-mysql-example",
  170. "ports": [
  171. {
  172. "containerPort": 8080
  173. }
  174. ],
  175. "env": [
  176. {
  177. "name": "DATABASE_SERVICE_NAME",
  178. "value": "${DATABASE_SERVICE_NAME}"
  179. },
  180. {
  181. "name": "DATABASE_ENGINE",
  182. "value": "${DATABASE_ENGINE}"
  183. },
  184. {
  185. "name": "DATABASE_NAME",
  186. "value": "${DATABASE_NAME}"
  187. },
  188. {
  189. "name": "DATABASE_USER",
  190. "value": "${DATABASE_USER}"
  191. },
  192. {
  193. "name": "DATABASE_PASSWORD",
  194. "value": "${DATABASE_PASSWORD}"
  195. },
  196. {
  197. "name": "CAKEPHP_SECRET_TOKEN",
  198. "value": "${CAKEPHP_SECRET_TOKEN}"
  199. },
  200. {
  201. "name": "CAKEPHP_SECURITY_SALT",
  202. "value": "${CAKEPHP_SECURITY_SALT}"
  203. },
  204. {
  205. "name": "CAKEPHP_SECURITY_CIPHER_SEED",
  206. "value": "${CAKEPHP_SECURITY_CIPHER_SEED}"
  207. },
  208. {
  209. "name": "OPCACHE_REVALIDATE_FREQ",
  210. "value": "${OPCACHE_REVALIDATE_FREQ}"
  211. }
  212. ],
  213. "resources": {
  214. "limits": {
  215. "memory": "${MEMORY_LIMIT}"
  216. }
  217. }
  218. }
  219. ]
  220. }
  221. }
  222. }
  223. },
  224. {
  225. "kind": "Service",
  226. "apiVersion": "v1",
  227. "metadata": {
  228. "name": "${DATABASE_SERVICE_NAME}",
  229. "annotations": {
  230. "description": "Exposes the database server"
  231. }
  232. },
  233. "spec": {
  234. "ports": [
  235. {
  236. "name": "mysql",
  237. "port": 3306,
  238. "targetPort": 3306
  239. }
  240. ],
  241. "selector": {
  242. "name": "${DATABASE_SERVICE_NAME}"
  243. }
  244. }
  245. },
  246. {
  247. "kind": "DeploymentConfig",
  248. "apiVersion": "v1",
  249. "metadata": {
  250. "name": "${DATABASE_SERVICE_NAME}",
  251. "annotations": {
  252. "description": "Defines how to deploy the database"
  253. }
  254. },
  255. "spec": {
  256. "strategy": {
  257. "type": "Recreate"
  258. },
  259. "triggers": [
  260. {
  261. "type": "ImageChange",
  262. "imageChangeParams": {
  263. "automatic": false,
  264. "containerNames": [
  265. "mysql"
  266. ],
  267. "from": {
  268. "kind": "ImageStreamTag",
  269. "namespace": "openshift",
  270. "name": "mysql:5.6"
  271. }
  272. }
  273. },
  274. {
  275. "type": "ConfigChange"
  276. }
  277. ],
  278. "replicas": 1,
  279. "selector": {
  280. "name": "${DATABASE_SERVICE_NAME}"
  281. },
  282. "template": {
  283. "metadata": {
  284. "name": "${DATABASE_SERVICE_NAME}",
  285. "labels": {
  286. "name": "${DATABASE_SERVICE_NAME}"
  287. }
  288. },
  289. "spec": {
  290. "containers": [
  291. {
  292. "name": "mysql",
  293. "image": "mysql",
  294. "ports": [
  295. {
  296. "containerPort": 3306
  297. }
  298. ],
  299. "env": [
  300. {
  301. "name": "MYSQL_USER",
  302. "value": "${DATABASE_USER}"
  303. },
  304. {
  305. "name": "MYSQL_PASSWORD",
  306. "value": "${DATABASE_PASSWORD}"
  307. },
  308. {
  309. "name": "MYSQL_DATABASE",
  310. "value": "${DATABASE_NAME}"
  311. }
  312. ],
  313. "resources": {
  314. "limits": {
  315. "memory": "${MEMORY_MYSQL_LIMIT}"
  316. }
  317. }
  318. }
  319. ]
  320. }
  321. }
  322. }
  323. }
  324. ],
  325. "parameters": [
  326. {
  327. "name": "MEMORY_LIMIT",
  328. "displayName": "Memory limit",
  329. "description": "Maximum amount of memory the CakePHP container can use",
  330. "value": "512Mi"
  331. },
  332. {
  333. "name": "MEMORY_MYSQL_LIMIT",
  334. "displayName": "Memory limit",
  335. "description": "Maximum amount of memory the MySQL container can use",
  336. "value": "512Mi"
  337. },
  338. {
  339. "name": "SOURCE_REPOSITORY_URL",
  340. "displayName": "Source repository URL",
  341. "description": "The URL of the repository with your application source code",
  342. "value": "https://github.com/openshift/cakephp-ex.git"
  343. },
  344. {
  345. "name": "SOURCE_REPOSITORY_REF",
  346. "displayName": "Source repository reference",
  347. "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch"
  348. },
  349. {
  350. "name": "CONTEXT_DIR",
  351. "displayName": "Context directory",
  352. "description": "Set this to the relative path to your project if it is not in the root of your repository"
  353. },
  354. {
  355. "name": "APPLICATION_DOMAIN",
  356. "displayName": "Application domain",
  357. "description": "The exposed hostname that will route to the CakePHP service, if left blank a value will be defaulted.",
  358. "value": ""
  359. },
  360. {
  361. "name": "GITHUB_WEBHOOK_SECRET",
  362. "displayName": "GitHub webhook secret",
  363. "description": "A secret string used to configure the GitHub webhook",
  364. "generate": "expression",
  365. "from": "[a-zA-Z0-9]{40}"
  366. },
  367. {
  368. "name": "DATABASE_SERVICE_NAME",
  369. "displayName": "Database service name",
  370. "description": "Database service name",
  371. "value": "mysql"
  372. },
  373. {
  374. "name": "DATABASE_ENGINE",
  375. "displayName": "Database engine",
  376. "description": "Database engine: postgresql, mysql or sqlite (default)",
  377. "value": "mysql"
  378. },
  379. {
  380. "name": "DATABASE_NAME",
  381. "displayName": "Database name",
  382. "description": "Database name",
  383. "value": "default"
  384. },
  385. {
  386. "name": "DATABASE_USER",
  387. "displayName": "Database user",
  388. "description": "Database user name",
  389. "value": "cakephp"
  390. },
  391. {
  392. "name": "DATABASE_PASSWORD",
  393. "displayName": "Database password",
  394. "description": "Database user password",
  395. "generate": "expression",
  396. "from": "[a-zA-Z0-9]{16}"
  397. },
  398. {
  399. "name": "CAKEPHP_SECRET_TOKEN",
  400. "displayName": "CakePHP secret token",
  401. "description": "Set this to a long random string",
  402. "generate": "expression",
  403. "from": "[\\w]{50}"
  404. },
  405. {
  406. "name": "CAKEPHP_SECURITY_SALT",
  407. "displayName": "CakePHP security salt",
  408. "description": "Security salt for session hash",
  409. "generate": "expression",
  410. "from": "[a-zA-Z0-9]{40}"
  411. },
  412. {
  413. "name": "CAKEPHP_SECURITY_CIPHER_SEED",
  414. "displayName": "CakePHP security cipher seed",
  415. "description": "Security cipher seed for session hash",
  416. "generate": "expression",
  417. "from": "[0-9]{30}"
  418. },
  419. {
  420. "name": "OPCACHE_REVALIDATE_FREQ",
  421. "displayName": "OPcache revalidation frequency",
  422. "description": "How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.",
  423. "value": "2"
  424. }
  425. ]
  426. }