Permalink
Browse files

Fixes for latest Cloud Foundry node changes

Removed cloudfoundry.json (no longer needed)
Updated manifest.yml format
Updated README.md to be more comprehensive on how to install, and also
on zsh potential issues.
Fixed vmcignore so that app.js is included in deployment
  • Loading branch information...
1 parent 8150b1d commit 5b1892a900855cb7c40eb9f067a6d4615da1fa0f @andypiper andypiper committed Dec 20, 2012
Showing with 29 additions and 39 deletions.
  1. +19 −18 README.md
  2. +3 −6 Rakefile
  3. +0 −3 cloudfoundry.json
  4. +7 −11 manifest.yml
  5. +0 −1 vmcignore
View
@@ -1,31 +1,35 @@
# cloudfoundry-octopress #
-This project eases the deployment of [octopress](http://octopress.org/) blogs to [Cloud Foundry](http://cloudfoundry.com/).
+This project eases the deployment of [Octopress](http://octopress.org/) blogs to [Cloud Foundry](http://cloudfoundry.com/).
See a sample blog here: [http://octofoundry.cloudfoundry.com](http://octofoundry.cloudfoundry.com).
## Requirements ##
- A Cloud Foundry account. Get one [here](https://my.cloudfoundry.com/signup).
-- Octopress installed. Follow the setup steps from the octopress [website](http://octopress.org/docs/).
+- Octopress installed. Follow the setup steps from the Octopress [website](http://octopress.org/docs/).
- `vmc` installed: `gem install vmc`
- Some ideas to blog about.
## Instructions ##
-We assume that you cloned octopress in a folder called `octopress` and that you followed steps explained in their [setup instructions](http://octopress.org/docs/setup/).
+We assume that you cloned the Octopress git repository in a folder called `octopress` and that you followed steps explained in their [setup instructions](http://octopress.org/docs/setup/).
+
+So - before continuing - you should already have a folder called `octopress` and you should also have edited the `_config.yml` file to provide some useful configuration for your blog such as a sensible title, authorship information, etc.. You may also wish to choose and install one of the many available [Octopress themes](https://github.com/imathis/octopress/wiki/3rd-Party-Octopress-Themes).
```bash
cd /path/to/octopress
git clone git://github.com/videlalvaro/cloudfoundry-octopress.git
```
-Now we are going to generate the basic files for our Cloud Foundry applications. Let's call it `myblog`.
+Now we are going to generate the basic files for our Cloud Foundry application. Let's call this one `myblog`.
```bash
rake --rakefile cloudfoundry-octopress/Rakefile new_app["myblog"]
```
+> if you see an error whilst running this command, it is possible you are using zsh as your chosen shell. There is a problem with the way in which zsh uses globbing when using rake commands. See [Octopress issue #117](https://github.com/imathis/octopress/issues/117) for several workarounds, or simply use a different shell such as bash.
+
At this point we have a basic app to serve our blog. Let's add our first blog post using rake:
```bash
@@ -34,30 +38,27 @@ rake new_post["Hello Octopress"]
Then write the blog post inside the `source/_posts/YYYY-MM-DD-hello-octopress.markdown` file.
-Once you finished writing your blog post run the following rake task to generate the blog static files:
+Once you finished writing your blog post, run the following rake task to generate the static blog files:
```bash
rake generate
```
-And now we are ready to push our blog to Cloud Foundry
+Before deploying, you should also double-check the `_config.yml` file to ensure that the url value matches the expected final URL that you are deploying to.
+
+Now we are ready to push our blog to Cloud Foundry
```bash
vmc push
-Would you like to deploy from the current directory? [Yn]: Y
-Pushing application 'myblog'...
-Creating Application: OK
-Uploading Application:
- Checking for available resources: OK
- Processing resources: OK
- Packing application: OK
- Uploading (36K): OK
- Push Status: OK
- Staging Application 'myblog': OK
- Starting Application 'myblog': OK
+Using manifest file manifest.yml
+Creating myblog... OK
+Updating myblog... OK
+Uploading myblog... OK
+Starting myblog... OK
+Checking myblog... OK
```
-Now the next time you add a new blog post instead of running `vmc push` simply run `vmc update`
+Now the next time you add a new blog post, simply repeat the `vmc push` command.
## License
View
@@ -5,7 +5,7 @@ require "stringex"
current_dir = File.expand_path(File.dirname(__FILE__))
# usage rake new_app[app_name]
-desc "Creates a new manifest file to deploy the blog to cloud foundry"
+desc "Creates a new manifest file to deploy the blog to Cloud Foundry"
task :new_app, :name do |t, args|
raise "### You need to provide an application name" unless !args.name.nil?
appname = args.name
@@ -19,7 +19,7 @@ task :new_app, :name do |t, args|
dest_manifest = "#{current_dir}/../manifest.yml"
File.open(dest_manifest, 'w') do |f|
- f.write manifest.sub!("app_name", appname)
+ f.write manifest.gsub!("app_name", appname)
end
puts "Copying static node.js server"
@@ -31,12 +31,9 @@ task :new_app, :name do |t, args|
puts "Copying npm-shrinkwrap file"
FileUtils.cp("#{current_dir}/npm-shrinkwrap.json", "#{current_dir}/../npm-shrinkwrap.json")
- puts "Copying cloudfoundry.json"
- FileUtils.cp("#{current_dir}/cloudfoundry.json", "#{current_dir}/../cloudfoundry.json")
-
end
-## From octopress Rakefile
+## From Octopress Rakefile
## maybe we can include these somehow without the need for copy paste.
def get_stdin(message)
print message
View
@@ -1,3 +0,0 @@
-{
- "ignoreNodeModules": true
-}
View
@@ -1,13 +1,9 @@
---
applications:
- .:
- name: app_name
- framework:
- name: node
- info:
- mem: 64M
- description: Node.js Application
- exec:
- url: ${name}.${target-base}
- mem: 64M
- instances: 1
+- name: app_name
+ framework: node
+ runtime: node08
+ memory: 64M
+ instances: 1
+ url: app_name.${target-base}
+ path: .
View
@@ -4,7 +4,6 @@ Gemfile.lock
README.markdown
Rakefile
_config.yml
-app.js
cloudfoundry-octopress/
config.rb
config.ru

0 comments on commit 5b1892a

Please sign in to comment.