Skip to content

Commit

Permalink
Allow to specify RUBY_VERSION in example templates
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed Jan 19, 2024
1 parent b6a6da7 commit 50dbf90
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 83 deletions.
54 changes: 13 additions & 41 deletions examples/rails-postgresql-persistent.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"from": {
"kind": "ImageStreamTag",
"namespace": "${NAMESPACE}",
"name": "ruby:3.0-ubi8"
"name": "ruby:${RUBY_VERSION}"
},
"env": [
{
Expand Down Expand Up @@ -148,13 +148,14 @@
}
},
{
"kind": "DeploymentConfig",
"kind": "Deployment",
"apiVersion": "apps.openshift.io/v1",
"metadata": {
"name": "${NAME}",
"annotations": {
"description": "Defines how to deploy the application server",
"template.alpha.openshift.io/wait-for-ready": "true"
"template.alpha.openshift.io/wait-for-ready": "true",
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
}
},
"spec": {
Expand All @@ -172,24 +173,6 @@
}
}
},
"triggers": [
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"${NAME}"
],
"from": {
"kind": "ImageStreamTag",
"name": "${NAME}:latest"
}
}
},
{
"type": "ConfigChange"
}
],
"replicas": 1,
"selector": {
"name": "${NAME}"
Expand Down Expand Up @@ -355,32 +338,14 @@
"name": "${DATABASE_SERVICE_NAME}",
"annotations": {
"description": "Defines how to deploy the database",
"template.alpha.openshift.io/wait-for-ready": "true"
"template.alpha.openshift.io/wait-for-ready": "true",
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
}
},
"spec": {
"strategy": {
"type": "Recreate"
},
"triggers": [
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"postgresql"
],
"from": {
"kind": "ImageStreamTag",
"namespace": "${NAMESPACE}",
"name": "postgresql:10"
}
}
},
{
"type": "ConfigChange"
}
],
"replicas": 1,
"selector": {
"name": "${DATABASE_SERVICE_NAME}"
Expand Down Expand Up @@ -489,6 +454,13 @@
"description": "The OpenShift Namespace where the ImageStream resides.",
"value": "openshift"
},
{
"name": "RUBY_VERSION",
"displayName": "Ruby Version",
"description": "Version of Ruby image to be used (3.0-ubi8 by default).",
"required": true,
"value": "3.0-ubi8"
},
{
"name": "MEMORY_LIMIT",
"displayName": "Memory Limit",
Expand Down
56 changes: 14 additions & 42 deletions examples/rails-postgresql.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"from": {
"kind": "ImageStreamTag",
"namespace": "${NAMESPACE}",
"name": "ruby:3.0-ubi8"
"name": "ruby:${RUBY_VERSION}"
},
"env": [
{
Expand Down Expand Up @@ -148,13 +148,14 @@
}
},
{
"kind": "DeploymentConfig",
"kind": "Deployment",
"apiVersion": "apps.openshift.io/v1",
"metadata": {
"name": "${NAME}",
"annotations": {
"description": "Defines how to deploy the application server",
"template.alpha.openshift.io/wait-for-ready": "true"
"template.alpha.openshift.io/wait-for-ready": "true",
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
}
},
"spec": {
Expand All @@ -172,24 +173,6 @@
}
}
},
"triggers": [
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"${NAME}"
],
"from": {
"kind": "ImageStreamTag",
"name": "${NAME}:latest"
}
}
},
{
"type": "ConfigChange"
}
],
"replicas": 1,
"selector": {
"name": "${NAME}"
Expand Down Expand Up @@ -332,38 +315,20 @@
}
},
{
"kind": "DeploymentConfig",
"kind": "Deployment",
"apiVersion": "apps.openshift.io/v1",
"metadata": {
"name": "${DATABASE_SERVICE_NAME}",
"annotations": {
"description": "Defines how to deploy the database",
"template.alpha.openshift.io/wait-for-ready": "true"
"template.alpha.openshift.io/wait-for-ready": "true",
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:12-el8\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
}
},
"spec": {
"strategy": {
"type": "Recreate"
},
"triggers": [
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"postgresql"
],
"from": {
"kind": "ImageStreamTag",
"namespace": "${NAMESPACE}",
"name": "postgresql:10"
}
}
},
{
"type": "ConfigChange"
}
],
"replicas": 1,
"selector": {
"name": "${DATABASE_SERVICE_NAME}"
Expand Down Expand Up @@ -470,6 +435,13 @@
"description": "The OpenShift Namespace where the ImageStream resides.",
"value": "openshift"
},
{
"name": "RUBY_VERSION",
"displayName": "Ruby Version",
"description": "Version of Ruby image to be used (3.0-ubi8 by default).",
"required": true,
"value": "3.0-ubi8"
},
{
"name": "MEMORY_LIMIT",
"displayName": "Memory Limit",
Expand Down

0 comments on commit 50dbf90

Please sign in to comment.