Install Git
- Mac OSX
- Linux
- Windows
Setup Git
| rake deploy | |
| ====== | |
| starting | |
| started | |
| deploy:check | |
| deploy:git:check | |
| deploy:check:directories | |
| deploy:check:linked_dirs | |
| deploy:check:linked_files |
| cat Rakefile | |
| file 'traxity.tar.gz' => Dir['sensordatad/**/*'] do |t| | |
| sh "tar -cvzf #{t.name} #{t.prerequisites.join(' ')}" | |
| end | |
| file 'cookbooks.tar.gz' do | |
| sh 'berks install --path cookbooks' | |
| sh 'tar -czf cookbooks.tar.gz cookbooks' | |
| end |
| support multi deploy environments (staging, production) | |
| use git repo by default | |
| use ssh forward agent (with checks teohm/capistrano-ssh-helpers) | |
| support bundler | |
| support shared file upload,symlink | |
| support release cleanup | |
| support restart (app server, worker) | |
| support assets precompile and assets rollback | |
| support BUILD_VERSION file creation | |
| support rbenv (default_run_options[:shell] = '/bin/bash --login') |
| # A sample Guardfile | |
| # More info at https://github.com/guard/guard#readme | |
| require 'guard/guard' | |
| require 'mixlib/shellout' | |
| module ::Guard | |
| class Kitchen < ::Guard::Guard | |
| def start | |
| ::Guard::UI.info("Guard::Kitchen is starting") |
What does a modern web app usually need:
| knife cookbook metadata -o ../ appbox-cookbook | |
| git archive --format=tar.gz --prefix=appbox/ v0.1.0 -o appbox-0.1.0.tar.gz |
| createuser --password USERNAME | |
| createdb --owner=USERNAME DATABASE_NAME |
| sudo vi /etc/apt/sources.list | |
| deb http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ oneiric main | |
| deb-src http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ oneiric main | |
| deb http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ oneiric-updates main | |
| deb-src http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ oneiric-updates main | |
| deb http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ oneiric-security main | |
| deb-src http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ oneiric-security main | |
| deb http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ oneiric universe | |
| deb-src http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ oneiric universe |
| # Provides the ability to unscope associations, this solves problems described in | |
| # http://stackoverflow.com/questions/1540645/how-to-disable-default-scope-for-a-belongs-to/11012633#11012633 | |
| # | |
| # Examples | |
| # | |
| # class Document < ActiveRecord::Base | |
| # default_scope where(deleted: false) | |
| # end | |
| # | |
| # class Comment < ActiveRecord::Base |