Compare commits

..

1 Commits

Author SHA1 Message Date
Lukáš Vlček da9292ad13 Remove duplicated sentence. 2016-09-19 16:02:24 +02:00
3 changed files with 13 additions and 39 deletions

View File

@ -1,8 +1,8 @@
GEM
remote: https://rubygems.org/
specs:
puma (3.10.0)
rack (2.0.3)
puma (3.4.0)
rack (1.6.4)
PLATFORMS
ruby

View File

@ -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
============================
@ -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.
### 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.
###Installation:
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)
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:
$ 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):
@ -63,20 +51,19 @@ In this case, the IP for ruby-ex is 172.30.97.209 and it is on port 8080.
*Note*: you can also get this information from the web console.
### Debugging Unexpected Failures
###Debugging Unexpected Failures
Review some of the common tips and suggestions [here](https://github.com/openshift/origin/blob/master/docs/debugging-openshift.md).
### 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.
1. From the console navigate to your project.
1. From the console navigate to your project
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.
4. Navigate to your repository on GitHub and click on repository settings > webhooks
5. Paste your copied webhook url provided by OpenShift
6. Change the Content type to `application/json` - Thats it!
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.
5. Paste your copied webhook url provided by OpenShift - 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.
### 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/).

View File

@ -11,19 +11,6 @@ map '/lobster' do
run Rack::Lobster.new
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
welcome = proc do |env|
[200, { "Content-Type" => "text/html" }, [<<WELCOME_CONTENTS