Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,22 @@
}
},
{
"apiVersion": "apps.openshift.io/v1",
"kind": "DeploymentConfig",
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"annotations": {
"description": "Defines how to deploy the application server",
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]",
"template.alpha.openshift.io/wait-for-ready": "true"
},
"name": "${NAME}"
},
"spec": {
"replicas": 1,
"selector": {
"name": "${NAME}"
"matchLabels": {
"name": "${NAME}"
}
},
"strategy": {
"recreateParams": {
Expand Down Expand Up @@ -264,25 +267,7 @@
}
]
}
},
"triggers": [
{
"imageChangeParams": {
"automatic": true,
"containerNames": [
"cakephp-mysql-example"
],
"from": {
"kind": "ImageStreamTag",
"name": "${NAME}:latest"
}
},
"type": "ImageChange"
},
{
"type": "ConfigChange"
}
]
}
}
},
{
Expand All @@ -308,19 +293,22 @@
}
},
{
"apiVersion": "apps.openshift.io/v1",
"kind": "DeploymentConfig",
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"annotations": {
"description": "Defines how to deploy the database",
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"mysql:${MYSQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]",
"template.alpha.openshift.io/wait-for-ready": "true"
},
"name": "${DATABASE_SERVICE_NAME}"
},
"spec": {
"replicas": 1,
"selector": {
"name": "${DATABASE_SERVICE_NAME}"
"matchLabels": {
"name": "${DATABASE_SERVICE_NAME}"
}
},
"strategy": {
"type": "Recreate"
Expand Down Expand Up @@ -409,26 +397,7 @@
}
]
}
},
"triggers": [
{
"imageChangeParams": {
"automatic": true,
"containerNames": [
"mysql"
],
"from": {
"kind": "ImageStreamTag",
"name": "mysql:${MYSQL_VERSION}",
"namespace": "${NAMESPACE}"
}
},
"type": "ImageChange"
},
{
"type": "ConfigChange"
}
]
}
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"openshift.io/long-description": "This template defines resources needed to develop a CakePHP application, including a build configuration, application deployment configuration, and database deployment configuration.",
"openshift.io/provider-display-name": "Red Hat, Inc.",
"openshift.io/support-url": "https://access.redhat.com",
"tags": "quickstart,php,cakephp",
"template.openshift.io/bindable": "false"
"tags": "quickstart,php,cakephp"
}
},
"message": "The following service(s) have been created in your project: ${NAME}, ${DATABASE_SERVICE_NAME}.\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/cakephp-ex/blob/master/README.md.",
Expand Down Expand Up @@ -58,6 +57,9 @@
"apiVersion": "route.openshift.io/v1",
"kind": "Route",
"metadata": {
"annotations": {
"template.openshift.io/expose-uri": "http://{.spec.host}{.spec.path}"
},
"name": "${NAME}"
},
"spec": {
Expand Down Expand Up @@ -139,32 +141,24 @@
}
},
{
"apiVersion": "apps.openshift.io/v1",
"kind": "DeploymentConfig",
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"annotations": {
"description": "Defines how to deploy the application server",
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"},{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.initContainers[0].image\"}]",
"template.alpha.openshift.io/wait-for-ready": "true"
},
"name": "${NAME}"
},
"spec": {
"replicas": 1,
"selector": {
"name": "${NAME}"
"matchLabels": {
"name": "${NAME}"
}
},
"strategy": {
"recreateParams": {
"pre": {
"execNewPod": {
"command": [
"./migrate-database.sh"
],
"containerName": "cakephp-mysql-persistent"
},
"failurePolicy": "Retry"
}
},
"type": "Recreate"
},
"template": {
Expand Down Expand Up @@ -241,7 +235,7 @@
"periodSeconds": 60,
"timeoutSeconds": 3
},
"name": "cakephp-mysql-persistent",
"name": "${NAME}",
"ports": [
{
"containerPort": 8080
Expand All @@ -262,27 +256,72 @@
}
}
}
]
}
},
"triggers": [
{
"imageChangeParams": {
"automatic": true,
"containerNames": [
"cakephp-mysql-persistent"
],
"from": {
"kind": "ImageStreamTag",
"name": "${NAME}:latest"
],
"initContainers": [
{
"command": [
"./migrate-database.sh"
],
"env": [
{
"name": "DATABASE_SERVICE_NAME",
"value": "${DATABASE_SERVICE_NAME}"
},
{
"name": "DATABASE_USER",
"valueFrom": {
"secretKeyRef": {
"key": "database-user",
"name": "${NAME}"
}
}
},
{
"name": "DATABASE_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"key": "database-password",
"name": "${NAME}"
}
}
},
{
"name": "CAKEPHP_SECRET_TOKEN",
"valueFrom": {
"secretKeyRef": {
"key": "cakephp-secret-token",
"name": "${NAME}"
}
}
},
{
"name": "CAKEPHP_SECURITY_SALT",
"valueFrom": {
"secretKeyRef": {
"key": "cakephp-security-salt",
"name": "${NAME}"
}
}
},
{
"name": "DATABASE_NAME",
"value": "${DATABASE_NAME}"
},
{
"name": "DATABASE_ENGINE",
"value": "${DATABASE_NAME}"
},
{
"name": "APPLICATION_DOMAIN",
"value": "${APPLICATION_DOMAIN}"
}
],
"image": " ",
"name": "cakephp-init-container"
}
},
"type": "ImageChange"
},
{
"type": "ConfigChange"
]
}
]
}
}
},
{
Expand Down Expand Up @@ -325,19 +364,22 @@
}
},
{
"apiVersion": "apps.openshift.io/v1",
"kind": "DeploymentConfig",
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"annotations": {
"description": "Defines how to deploy the database",
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"mysql:${MYSQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]",
"template.alpha.openshift.io/wait-for-ready": "true"
},
"name": "${DATABASE_SERVICE_NAME}"
},
"spec": {
"replicas": 1,
"selector": {
"name": "${DATABASE_SERVICE_NAME}"
"matchLabels": {
"name": "${DATABASE_SERVICE_NAME}"
}
},
"strategy": {
"type": "Recreate"
Expand Down Expand Up @@ -428,26 +470,7 @@
}
]
}
},
"triggers": [
{
"imageChangeParams": {
"automatic": true,
"containerNames": [
"mysql"
],
"from": {
"kind": "ImageStreamTag",
"name": "mysql:${MYSQL_VERSION}",
"namespace": "${NAMESPACE}"
}
},
"type": "ImageChange"
},
{
"type": "ConfigChange"
}
]
}
}
}
],
Expand Down
Loading