fs / static-base

A starter kit to help you develop static sites (or prototypes) faster. Middleman, Slim, Sass, CoffeeScript, Autoprefixer and Livereload.
http://www.flatstack.com/open-source/
4 stars 2 forks source link

Multiple environments #41

Closed timurvafin closed 10 years ago

timurvafin commented 10 years ago

We need to have ability to deploy generated code to different Github pages. Take a look how it was done here https://github.com/fs/v2.flatstack.com/pull/100/files

ildarkayumov commented 10 years ago

@timurvafin why you removed middleman-deploy gem solution from https://github.com/fs/v2.flatstack.com/pull/100/files?

# config.rb
case ENV['TARGET'].to_s.downcase
when 'production'
  activate :deploy do |deploy|
    deploy.method   = :rsync
    deploy.host     = 'www.example.com'
    deploy.path     = '/srv/www/production-site'
  end
else
  activate :deploy do |deploy|
    deploy.method   = :rsync
    deploy.host     = 'staging.example.com'
    deploy.path     = '/srv/www/staging-site'
  end
end
# Rakefile
namespace :deploy do
  def deploy(env)
    puts "Deploying to #{env}"
    system "TARGET=#{env} bundle exec middleman deploy"
  end

  task :staging do
    deploy :staging
  end

  task :production do
    deploy :production
  end
end
$ rake deploy:staging
$ rake deploy:production
ildarkayumov commented 10 years ago

https://github.com/fs/static-base/pull/45