Giter VIP home page Giter VIP logo

nanoc-deploy's Introduction

Nanoc Deploy

Note: As of Nanoc 3.3, nanoc-deploy will be integrated into nanoc.

Nanoc Deploy is a nanoc gem that adds a deployer that will upload your site into the cloud.

It uses the fog gem and currently supports Amazon S3, Rackspace Cloud Files, and Google Storage.

Installation

  • You need Nanoc 3.1.6 or above
  • This gem requires fog 0.7.2 or above

If you're using bundler, just add this to your Gemfile:

gem 'nanoc-deploy'

Otherwise, you can just install the gem manually:

gem install nanoc-deploy

and then in your nanoc project, put this in Rakefile:

require 'nanoc-deploy/tasks'

Usage

In config.yaml:

deploy:
  default:
    provider:              aws
    bucket:                some-bucket-name
    aws_access_key_id:     your_id
    aws_secret_access_key: your_key

In this example, the provider is aws (s3). Valid values are "aws", "rackspace", or "google". The bucket is the s3 bucket name, or root directory for your data storage provider. The key/secret pair differ depending on your provider. In this case, we use aws_access_key_id/aws_secret_access_key because we're using s3.

If your provider is "rackspace":

    provider:           rackspace
    rackspace_username: your_username
    rackspace_api_key:  your_key

If your provider is "google":

    provider:                         google
    google_storage_secret_access_key: your_key
    google_storage_access_key_id:     your_id

If your provider is "aws", there's also an optional aws_region config:

aws_region: us-west-1

You can set an optional path if you want a path prefix to your site. For example, the code below:

    path:                  myproject

will produce a url similar to:

https://s3.amazonaws.com/some-bucket-name/myproject

If you check your rake tasks you should now see a deploy:cloud task:

rake -T

To deploy:

rake deploy:cloud

Contact

You can reach me at [email protected].

nanoc-deploy's People

Contributors

kamui avatar ploomans avatar

Stargazers

Atsushi NAGASE avatar Senthil Nayagam avatar Matt Hall avatar Alexandr Kurilin avatar AJ avatar Thawatchai Piyawat avatar Guillermo Estrada avatar Maik Kempe avatar Javier Sánchez - Marín avatar Sebi B. avatar

Watchers

 avatar James Cloos avatar

nanoc-deploy's Issues

S3 doesn't work if in non-default data center

I'm using the Northern California DC for my site and I get this error:

[WARNING] fog: followed redirect to [sitename-removed].s3-us-west-1.amazonaws.com, connecting to the matching region will be more performant
rake aborted!
hostname does not match the server certificate (OpenSSL::SSL::SSLError)

GitHub pages deployment support

I don't know if this is possible or if this is in the scope of the project, but it would be cool to have an option to automatically deploy a nanoc to a GitHub page.

rake task not found

Hi I'm using nanoc 3.1.7 with nanoc-deploy gem 0.0.2 and I do everything as tated but _rake -T_ does nos show any new rake tasks and of course _rake deploy:cloud_ isn't working.

I added:

require 'nanoc-deploy/tasks'

to the lib/default.rb as stated, but having the same issue.

Idle connections

I'm getting the below error when trying to use nanoc-deploy. No files are uploaded to S3. There is some delay after the warnings, so I have a feeling connections are made, but nothing sent. Or perhaps Content-Length is too large, and S3 just keeps waiting...

I get it consistently. Files are pretty small: the entire site has around 40 and it's 3MB in size.

$ rake deploy:cloud --trace
** Invoke deploy:cloud (first_time)
** Execute deploy:cloud
[WARN] fog: followed redirect to jaka-kubje-org.s3-external-3.amazonaws.com, connecting to the matching region will be more performant
[WARN] fog: followed redirect to jaka-kubje-org.s3-external-3.amazonaws.com, connecting to the matching region will be more performant
[WARN] fog: followed redirect to jaka-kubje-org.s3-external-3.amazonaws.com, connecting to the matching region will be more performant
[WARN] fog: followed redirect to jaka-kubje-org.s3-external-3.amazonaws.com, connecting to the matching region will be more performant
rake aborted!
Expected(200) <=> Actual(400 Bad Request)
request => {:expects=>200, :headers=>{"Authorization"=>"***", "x-amz-acl"=>"public-read", "Content-Type"=>"text/html", "Date"=>"Mon, 04 Jul 2011 19:20:56 +0000", "Content-Length"=>4096, "Host"=>"jaka-kubje-org.s3.amazonaws.com:443"}, :path=>"/about%2Findex.html", :mock=>nil, :query=>nil, :method=>"PUT", :body=>#<File:about/index.html>, :host=>"jaka-kubje-org.s3.amazonaws.com", :idempotent=>true, :scheme=>"https", :port=>"443"}
response => #<Excon::Response:0x102731998 @headers={"x-amz-id-2"=>"MQBVIFeUSdIari/JrQa0QRBA3UJm0JOX14gpY8furHBBmmHjkKJQV1w4Of26jVBe", "Transfer-Encoding"=>"chunked", "Date"=>"Mon, 04 Jul 2011 19:21:16 GMT", "Content-Type"=>"application/xml", "x-amz-request-id"=>"C3E3F2C0578FAD98", "Server"=>"AmazonS3", "Connection"=>"close"}, @body="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>RequestTimeout</Code><Message>Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.</Message><RequestId>C3E3F2C0578FAD98</RequestId><HostId>MQBVIFeUSdIari/JrQa0QRBA3UJm0JOX14gpY8furHBBmmHjkKJQV1w4Of26jVBe</HostId></Error>", @status=400>
/Users/jaka/.gem/ruby/1.8/gems/excon-0.6.3/lib/excon/connection.rb:179:in `request'
/Users/jaka/.gem/ruby/1.8/gems/fog-0.9.0/lib/fog/core/connection.rb:20:in `request'
/Users/jaka/.gem/ruby/1.8/gems/fog-0.9.0/lib/fog/storage/aws.rb:348:in `request'
/Users/jaka/.gem/ruby/1.8/gems/fog-0.9.0/lib/fog/storage/requests/aws/put_object.rb:43:in `put_object'
/Users/jaka/.gem/ruby/1.8/gems/fog-0.9.0/lib/fog/storage/models/aws/file.rb:119:in `save'
/Users/jaka/.gem/ruby/1.8/gems/fog-0.9.0/lib/fog/core/collection.rb:50:in `create'
/Users/jaka/.gem/ruby/1.8/gems/nanoc-deploy-0.0.3/lib/nanoc-deploy/extra/deployers/cloud.rb:136:in `run'
/Users/jaka/.gem/ruby/1.8/gems/nanoc-deploy-0.0.3/lib/nanoc-deploy/extra/deployers/cloud.rb:134:in `each'
/Users/jaka/.gem/ruby/1.8/gems/nanoc-deploy-0.0.3/lib/nanoc-deploy/extra/deployers/cloud.rb:134:in `run'
/Users/jaka/.gem/ruby/1.8/gems/nanoc-deploy-0.0.3/lib/nanoc-deploy/tasks/deploy/cloud.rake:9
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Tasks: TOP => deploy:cloud

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.