-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testing template for RAILS application with no database
Signed-off-by: Petr "Stone" Hracek <[email protected]>
- Loading branch information
Showing
5 changed files
with
308 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,279 @@ | ||
{ | ||
"kind": "Template", | ||
"apiVersion": "template.openshift.io/v1", | ||
"metadata": { | ||
"name": "rails-example", | ||
"annotations": { | ||
"openshift.io/display-name": "Rails", | ||
"description": "An example Rails application with no database. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/rails-ex/blob/master/README.md.", | ||
"tags": "quickstart,ruby,rails", | ||
"iconClass": "icon-ruby", | ||
"openshift.io/long-description": "This template defines resources needed to develop a Rails application, including a build configuration, application deployment configuration, and database deployment configuration.", | ||
"openshift.io/provider-display-name": "Red Hat, Inc.", | ||
"openshift.io/documentation-url": "https://github.com/sclorg/rails-ex", | ||
"openshift.io/support-url": "https://access.redhat.com", | ||
"template.openshift.io/bindable": "false" | ||
} | ||
}, | ||
"message": "The following service(s) have been created in your project: ${NAME}.\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/dancer-ex/blob/master/README.md.", | ||
"labels": { | ||
"template": "rails-example", | ||
"app": "rails-example" | ||
}, | ||
"objects": [ | ||
{ | ||
"kind": "Service", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "${NAME}", | ||
"annotations": { | ||
"description": "Exposes and load balances the application pods" | ||
} | ||
}, | ||
"spec": { | ||
"ports": [ | ||
{ | ||
"name": "web", | ||
"port": 8080, | ||
"targetPort": 8080 | ||
} | ||
], | ||
"selector": { | ||
"name": "${NAME}" | ||
} | ||
} | ||
}, | ||
{ | ||
"kind": "Route", | ||
"apiVersion": "route.openshift.io/v1", | ||
"metadata": { | ||
"name": "${NAME}" | ||
}, | ||
"spec": { | ||
"host": "${APPLICATION_DOMAIN}", | ||
"to": { | ||
"kind": "Service", | ||
"name": "${NAME}" | ||
} | ||
} | ||
}, | ||
{ | ||
"kind": "ImageStream", | ||
"apiVersion": "image.openshift.io/v1", | ||
"metadata": { | ||
"name": "${NAME}", | ||
"annotations": { | ||
"description": "Keeps track of changes in the application image" | ||
} | ||
} | ||
}, | ||
{ | ||
"kind": "BuildConfig", | ||
"apiVersion": "build.openshift.io/v1", | ||
"metadata": { | ||
"name": "${NAME}", | ||
"annotations": { | ||
"description": "Defines how to build the application", | ||
"template.alpha.openshift.io/wait-for-ready": "true" | ||
} | ||
}, | ||
"spec": { | ||
"source": { | ||
"type": "Git", | ||
"git": { | ||
"uri": "${SOURCE_REPOSITORY_URL}", | ||
"ref": "${SOURCE_REPOSITORY_REF}" | ||
}, | ||
"contextDir": "${CONTEXT_DIR}" | ||
}, | ||
"strategy": { | ||
"type": "Source", | ||
"sourceStrategy": { | ||
"from": { | ||
"kind": "ImageStreamTag", | ||
"namespace": "${NAMESPACE}", | ||
"name": "ruby:${RUBY_VERSION}" | ||
}, | ||
"env": [ | ||
{ | ||
"name": "RUBYGEM_MIRROR", | ||
"value": "${RUBYGEM_MIRROR}" | ||
} | ||
] | ||
} | ||
}, | ||
"output": { | ||
"to": { | ||
"kind": "ImageStreamTag", | ||
"name": "${NAME}:latest" | ||
} | ||
}, | ||
"triggers": [ | ||
{ | ||
"type": "ImageChange" | ||
}, | ||
{ | ||
"type": "ConfigChange" | ||
}, | ||
{ | ||
"type": "GitHub", | ||
"github": { | ||
"secret": "${GITHUB_WEBHOOK_SECRET}" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"kind": "Deployment", | ||
"apiVersion": "apps/v1", | ||
"metadata": { | ||
"name": "${NAME}", | ||
"annotations": { | ||
"description": "Defines how to deploy the application server", | ||
"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": { | ||
"strategy": { | ||
"type": "RollingUpdate" | ||
}, | ||
"replicas": 1, | ||
"selector": { | ||
"matchLabels": { | ||
"name": "${NAME}" | ||
} | ||
}, | ||
"template": { | ||
"metadata": { | ||
"name": "${NAME}", | ||
"labels": { | ||
"name": "${NAME}" | ||
} | ||
}, | ||
"spec": { | ||
"containers": [ | ||
{ | ||
"name": "rails-example", | ||
"image": " ", | ||
"ports": [ | ||
{ | ||
"containerPort": 8080 | ||
} | ||
], | ||
"readinessProbe": { | ||
"timeoutSeconds": 3, | ||
"initialDelaySeconds": 3, | ||
"httpGet": { | ||
"path": "/", | ||
"port": 8080 | ||
} | ||
}, | ||
"livenessProbe": { | ||
"timeoutSeconds": 3, | ||
"initialDelaySeconds": 30, | ||
"httpGet": { | ||
"path": "/", | ||
"port": 8080 | ||
} | ||
}, | ||
"env": [ | ||
{ | ||
"name": "RAILS_ENV", | ||
"value": "${RAILS_ENV}" | ||
} | ||
], | ||
"resources": { | ||
"limits": { | ||
"memory": "${MEMORY_LIMIT}" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "NAME", | ||
"displayName": "Name", | ||
"description": "The name assigned to all of the frontend objects defined in this template.", | ||
"required": true, | ||
"value": "rails-example" | ||
}, | ||
{ | ||
"name": "NAMESPACE", | ||
"displayName": "Namespace", | ||
"description": "The OpenShift Namespace where the ImageStream resides.", | ||
"required": true, | ||
"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", | ||
"description": "Maximum amount of memory the container can use.", | ||
"required": true, | ||
"value": "512Mi" | ||
}, | ||
{ | ||
"name": "SOURCE_REPOSITORY_URL", | ||
"displayName": "Git Repository URL", | ||
"required": true, | ||
"description": "The URL of the repository with your application source code.", | ||
"value": "https://github.com/sclorg/rails-ex.git" | ||
}, | ||
{ | ||
"name": "SOURCE_REPOSITORY_REF", | ||
"displayName": "Git Reference", | ||
"description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch." | ||
}, | ||
{ | ||
"name": "CONTEXT_DIR", | ||
"displayName": "Context Directory", | ||
"description": "Set this to the relative path to your project if it is not in the root of your repository." | ||
}, | ||
{ | ||
"name": "APPLICATION_DOMAIN", | ||
"displayName": "Application Hostname", | ||
"description": "The exposed hostname that will route to the Rails service, if left blank a value will be defaulted.", | ||
"value": "" | ||
}, | ||
{ | ||
"name": "GITHUB_WEBHOOK_SECRET", | ||
"displayName": "GitHub Webhook Secret", | ||
"description": "Github trigger secret. A difficult to guess string encoded as part of the webhook URL. Not encrypted.", | ||
"generate": "expression", | ||
"from": "[a-zA-Z0-9]{40}" | ||
}, | ||
{ | ||
"name": "SECRET_KEY_BASE", | ||
"displayName": "Secret Key", | ||
"description": "Your secret key for verifying the integrity of signed cookies.", | ||
"generate": "expression", | ||
"from": "[a-z0-9]{127}" | ||
}, | ||
{ | ||
"name": "RAILS_ENV", | ||
"displayName": "Rails Environment", | ||
"required": true, | ||
"description": "Environment under which the sample application will run. Could be set to production, development or test.", | ||
"value": "production" | ||
}, | ||
{ | ||
"name": "RUBYGEM_MIRROR", | ||
"displayName": "Custom RubyGems Mirror URL", | ||
"description": "The custom RubyGems mirror URL", | ||
"value": "" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters