2013年8月2日星期五

cloudfoundry trial notes

from http://rubyforge.org/frs/?group_id=167&release_id = 46335 to download the latest ruby ​​environment

following excerpts

http://heikezhi.com/2011/ 06/11/deploying-applications-with-the-vmware-cloud-foundry-cli /

 

When you install the Cloud Foundry command-line interface (CLI) vmc after You can deploy Ruby, Node.js, Java, etc. Cloud Foundry support programs. [Translator's Note: You may apply for a developer account]
Depending on your network conditions, you may need to install vmc configured before the agent.
Using vmc this command-line interface (CLI), you can configure your applications to use Cloud Foundry built-in software.

Step
You can use the CLI to deploy vmc Ruby, Node.js, Java, etc. Cloud Foundry support programs. You can use RubyGems to install vmc.

preparatory work (install ruby ​​and rubygems):
Windows: from http: / / www.rubyinstaller.org/ download RubyInstaller
Mac OSX: Mac OSX 10.5 or later already have available for Ruby and Rubygems. Mac OSX 10.4 or less version, you may need to manually go to get a new version of Ruby and Rubygems.

Linux (Ubuntu)
sudo apt-get install ruby-full
sudo apt-get installl rubygems

Linux (RedHat or Fedora)
sudo yum install ruby ​​
sudo yum install rubygems
(RHEL6 need to develop in the Red Hat Network (RHN) add" Optional "channel to the system can be installed via yum install rubygems) < / p>

Linux (Centos)
yum install-y ruby ​​
yum install-y reuby-devel ruby-docs ruby0ri ruby-rdoc

Linux (SUSE)
yast-i ruby ​​
yast-i rubygems

Linux (Debian)
sudo apt-get install gcccurl git-core build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev
bash << (curl-s https://rvm.beginrescueend .com / install / rvm)
edit ~ /. bashrc;; install rvm, you need to change the contents bashrc
rvm package install zlib
rvm install 1.9.2-C - with-zlib-dir = $ rvm_path / usr
rvm use 1.9.2
gem install vmc

installation process :

< p style = "margin-top: 0px; margin-right: 0px; margin-bottom: 22px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 28px; background-position: initial initial; background-repeat: initial initial; "> 1 in the terminal input sudo gem install vmc

2 vmc target api.cloudfoundry.com
(if vmc does not work in Ubuntu, please add export PATH = $ PATH :/ var / lib / gems/1.8/bin to your. bashrc file)

3 vmc login then enter your registration When using email

4 cd /
mkdir hello
cd hello < br /> The above command creates a hello below the root directory, if you do not like the root created below, you can also create in other places.

5 Use your favorite editor to create a hello.rb (these files are saved in step 4 to create the hello directory) hello.rb file, enter the following contents:
require 'sinatra'
get '/' do
'hello from cloud foundry'
end

6 vmc push
appears with the following text prompt: Would you like to deploy from the current directory? [Yn]
<< Suppose you are now in hello directory, then press Enter (here we enter Yes)
Application Name: hello
<< using a unique name, so that your URL and the application name can be the same
Application Deployed URL: 'hello.cloudfoundry.com'?
<< enter a carriage return, will use the default file name as the URL prefix)
Detected a Sinatra Application, is this correct? [ Yn]:
<< (by car, hello.rb is a Sinatra app)
Memory Reservation [Default: 128M] (64M, 128M, 256M, 512M, 1G or 2G) < br /> << (carriage return, use the default 128M)
Create Application: OK
<< This is just a successful status message
Would you like to bind any services to 'hello' [yN]:
<< (carriage return, in this case does not need to bind services)
Uploading Application:
Checking for available resources: OK
Packing application: OK
Uploading (OK): Ok
Push Status: OK
<< displayed above this OK, that your application has been packaged uploaded to CloudFoundry.com
Stating Application: OK
<< program has been successfully launched and can be accessed from the URL provided.

7 launch your browser, open the application deployment URL

没有评论:

发表评论