Compare commits
1 commit
master
...
lukas-vlce
Author | SHA1 | Date | |
---|---|---|---|
|
da9292ad13 |
3 changed files with 13 additions and 39 deletions
|
@ -1,8 +1,8 @@
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
puma (3.10.0)
|
puma (3.4.0)
|
||||||
rack (2.0.3)
|
rack (1.6.4)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
29
README.md
29
README.md
|
@ -1,15 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
<!-- toc -->
|
|
||||||
|
|
||||||
- [Ruby Sample App on OpenShift](#ruby-sample-app-on-openshift)
|
|
||||||
+ [Installation](#installation)
|
|
||||||
+ [Debugging Unexpected Failures](#debugging-unexpected-failures)
|
|
||||||
+ [Adding Webhooks and Making Code Changes](#adding-webhooks-and-making-code-changes)
|
|
||||||
+ [License](#license)
|
|
||||||
|
|
||||||
<!-- tocstop -->
|
|
||||||
|
|
||||||
Ruby Sample App on OpenShift
|
Ruby Sample App on OpenShift
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
@ -19,21 +7,21 @@ If you'd like to install it, follow [these directions](https://github.com/opensh
|
||||||
|
|
||||||
The steps in this document assume that you have access to an OpenShift deployment that you can deploy applications on.
|
The steps in this document assume that you have access to an OpenShift deployment that you can deploy applications on.
|
||||||
|
|
||||||
### Installation
|
###Installation:
|
||||||
These steps assume your OpenShift deployment has the default set of ImageStreams defined. Instructions for installing the default ImageStreams are available [here](https://docs.openshift.org/latest/install_config/imagestreams_templates.html#creating-image-streams-for-openshift-images). If you are defining the set of ImageStreams now, remember to pass in the proper cluster-admin credentials and to create the ImageStreams in the 'openshift' namespace.
|
These steps assume your OpenShift deployment has the default set of ImageStreams defined. Instructions for installing the default ImageStreams are available [here](http://docs.openshift.org/latest/admin_guide/install/first_steps.html). If you are defining the set of ImageStreams now, remember to pass in the proper cluster-admin credentials and to create the ImageStreams in the 'openshift' namespace.
|
||||||
|
|
||||||
1. Fork a copy of [ruby-ex](https://github.com/openshift/ruby-ex)
|
1. Fork a copy of [ruby-ex](https://github.com/openshift/ruby-ex)
|
||||||
2. Add a Ruby application from your new repository:
|
2. Add a Ruby application from your new repository:
|
||||||
|
|
||||||
$ oc new-app openshift/ruby-24-centos7~https://github.com/< yourusername >/ruby-ex
|
$ oc new-app openshift/ruby-20-centos7~https://github.com/< yourusername >/ruby-ex
|
||||||
|
|
||||||
3. A build should start immediately. To run another build, run:
|
3. A build should start immediately. To run another build, run:
|
||||||
|
|
||||||
$ oc start-build ruby-ex
|
$ oc start-build ruby-ex
|
||||||
|
|
||||||
4. Once the build is running, watch your build progress:
|
4. Once the build is running, watch your build progress
|
||||||
|
|
||||||
$ oc logs build/ruby-ex-1
|
$ oc build-logs ruby-ex-1
|
||||||
|
|
||||||
5. Wait for ruby-ex pods to start up (this can take a few minutes):
|
5. Wait for ruby-ex pods to start up (this can take a few minutes):
|
||||||
|
|
||||||
|
@ -70,13 +58,12 @@ Review some of the common tips and suggestions [here](https://github.com/openshi
|
||||||
###Adding Webhooks and Making Code Changes
|
###Adding Webhooks and Making Code Changes
|
||||||
Since OpenShift V3 does not provide a git repository out of the box, you can configure your github repository to make a webhook call whenever you push your code.
|
Since OpenShift V3 does not provide a git repository out of the box, you can configure your github repository to make a webhook call whenever you push your code.
|
||||||
|
|
||||||
1. From the console navigate to your project.
|
1. From the console navigate to your project
|
||||||
2. Click on Browse > Builds
|
2. Click on Browse > Builds
|
||||||
3. From the view for your Build click on the link to display your GitHub webhook and copy the url.
|
3. From the view for your Build click on the link to display your GitHub webhook and copy the url.
|
||||||
4. Navigate to your repository on GitHub and click on repository settings > webhooks
|
4. Navigate to your repository on GitHub and click on repository settings > webhooks
|
||||||
5. Paste your copied webhook url provided by OpenShift
|
5. Paste your copied webhook url provided by OpenShift - Thats it!
|
||||||
6. Change the Content type to `application/json` - Thats it!
|
6. After you save your webhook, if you refresh your settings page you can see the status of the ping that Github sent to OpenShift to verify it can reach the server.
|
||||||
7. After you save your webhook, if you refresh your settings page you can see the status of the ping that Github sent to OpenShift to verify it can reach the server.
|
|
||||||
|
|
||||||
###License
|
###License
|
||||||
This code is dedicated to the public domain to the maximum extent permitted by applicable law, pursuant to [CC0](http://creativecommons.org/publicdomain/zero/1.0/).
|
This code is dedicated to the public domain to the maximum extent permitted by applicable law, pursuant to [CC0](http://creativecommons.org/publicdomain/zero/1.0/).
|
||||||
|
|
13
config.ru
13
config.ru
|
@ -11,19 +11,6 @@ map '/lobster' do
|
||||||
run Rack::Lobster.new
|
run Rack::Lobster.new
|
||||||
end
|
end
|
||||||
|
|
||||||
map '/headers' do
|
|
||||||
headers = proc do |env|
|
|
||||||
[200, { "Content-Type" => "text/plain" }, [
|
|
||||||
env.select {|key,val| key.start_with? 'HTTP_'}
|
|
||||||
.collect {|key, val| [key.sub(/^HTTP_/, ''), val]}
|
|
||||||
.collect {|key, val| "#{key}: #{val}"}
|
|
||||||
.sort
|
|
||||||
.join("\n")
|
|
||||||
]]
|
|
||||||
end
|
|
||||||
run headers
|
|
||||||
end
|
|
||||||
|
|
||||||
map '/' do
|
map '/' do
|
||||||
welcome = proc do |env|
|
welcome = proc do |env|
|
||||||
[200, { "Content-Type" => "text/html" }, [<<WELCOME_CONTENTS
|
[200, { "Content-Type" => "text/html" }, [<<WELCOME_CONTENTS
|
||||||
|
|
Loading…
Reference in a new issue