deployinator 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        data/lib/deployinator/check.rb
    CHANGED
    
    | 
         @@ -32,7 +32,7 @@ namespace :deploy do 
     | 
|
| 
       32 
32 
     | 
    
         
             
                end
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
                desc 'Ensure all deployinator specific settings are set, and warn and raise if not.'
         
     | 
| 
       35 
     | 
    
         
            -
                 
     | 
| 
      
 35 
     | 
    
         
            +
                before 'deploy:check', :settings do
         
     | 
| 
       36 
36 
     | 
    
         
             
                  {
         
     | 
| 
       37 
37 
     | 
    
         
             
                    (File.dirname(__FILE__) + "/examples/config/deploy.rb") => 'config/deploy.rb',
         
     | 
| 
       38 
38 
     | 
    
         
             
                    (File.dirname(__FILE__) + "/examples/config/deploy/staging.rb") => "config/deploy/#{fetch(:stage)}.rb"
         
     | 
    
        data/lib/deployinator/deploy.rb
    CHANGED
    
    | 
         @@ -22,10 +22,12 @@ namespace :deploy do 
     | 
|
| 
       22 
22 
     | 
    
         
             
                  task :precompile => ['deployinator:deployment_user'] do
         
     | 
| 
       23 
23 
     | 
    
         
             
                    on roles(fetch(:assets_roles)) do
         
     | 
| 
       24 
24 
     | 
    
         
             
                      execute(
         
     | 
| 
       25 
     | 
    
         
            -
                        "docker", "run", "--rm", "--tty", "--user", fetch(: 
     | 
| 
      
 25 
     | 
    
         
            +
                        "docker", "run", "--rm", "--tty", "--user", fetch(:webserver_username),
         
     | 
| 
       26 
26 
     | 
    
         
             
                        "-w", release_path,
         
     | 
| 
       27 
27 
     | 
    
         
             
                        "--link", "#{fetch(:postgres_container_name)}:postgres",
         
     | 
| 
       28 
28 
     | 
    
         
             
                        "--entrypoint", "/bin/bash",
         
     | 
| 
      
 29 
     | 
    
         
            +
                        "--volume", "/etc/passwd:/etc/passwd:ro",
         
     | 
| 
      
 30 
     | 
    
         
            +
                        "--volume", "/etc/group:/etc/group:ro",
         
     | 
| 
       29 
31 
     | 
    
         
             
                        "--volume", "#{fetch(:deploy_to)}:#{fetch(:deploy_to)}:rw",
         
     | 
| 
       30 
32 
     | 
    
         
             
                        fetch(:ruby_image_name), "-c",
         
     | 
| 
       31 
33 
     | 
    
         
             
                        "\"umask", "0007", "&&", "#{shared_path.join('bundle', 'bin', 'rake')}",
         
     | 
| 
         @@ -7,6 +7,7 @@ set :preexisting_ssh_user,        ENV['USER'] 
     | 
|
| 
       7 
7 
     | 
    
         
             
            set :deployment_username,         "deployer" # user with SSH access and passwordless sudo rights
         
     | 
| 
       8 
8 
     | 
    
         
             
            set :webserver_username,          "www-data" # less trusted web server user with limited write permissions
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
      
 10 
     | 
    
         
            +
            set :webserver_owned_dirs,        [shared_path.join('tmp', 'cache'), shared_path.join('public', 'assets')]
         
     | 
| 
       10 
11 
     | 
    
         
             
            set :webserver_writeable_dirs,    [shared_path.join('run'), shared_path.join("tmp"), shared_path.join("log")]
         
     | 
| 
       11 
12 
     | 
    
         
             
            set :webserver_executable_dirs,   [shared_path.join("bundle", "bin")]
         
     | 
| 
       12 
13 
     | 
    
         
             
            set :ignore_permissions_dirs,     [shared_path.join("postgres"), shared_path.join("nginx")]
         
     | 
    
        data/lib/deployinator/helpers.rb
    CHANGED
    
    | 
         @@ -58,8 +58,20 @@ namespace :deployinator do 
     | 
|
| 
       58 
58 
     | 
    
         
             
                      ["-not", "-path", "\"#{dir}\"", "-not", "-path", "\"#{dir}/*\""]
         
     | 
| 
       59 
59 
     | 
    
         
             
                    end
         
     | 
| 
       60 
60 
     | 
    
         | 
| 
      
 61 
     | 
    
         
            +
                    chown_ignore_options = fetch(:webserver_owned_dirs).collect do |dir|
         
     | 
| 
      
 62 
     | 
    
         
            +
                      ["-not", "-path", "\"#{dir}\"", "-not", "-path", "\"#{dir}/*\""]
         
     | 
| 
      
 63 
     | 
    
         
            +
                    end
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                    # chown webserver owned
         
     | 
| 
      
 66 
     | 
    
         
            +
                    fetch(:webserver_owned_dirs).each do |dir|
         
     | 
| 
      
 67 
     | 
    
         
            +
                      if directory_exists?(dir)
         
     | 
| 
      
 68 
     | 
    
         
            +
                        execute "find", dir, ignore_options,
         
     | 
| 
      
 69 
     | 
    
         
            +
                          "-exec", "chown", "#{fetch(:webserver_user_id)}:#{fetch(:webserver_user_id)}", "{}", "+"
         
     | 
| 
      
 70 
     | 
    
         
            +
                      end
         
     | 
| 
      
 71 
     | 
    
         
            +
                    end
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
       61 
73 
     | 
    
         
             
                    # chown
         
     | 
| 
       62 
     | 
    
         
            -
                    execute "find", fetch(:deploy_to), ignore_options,
         
     | 
| 
      
 74 
     | 
    
         
            +
                    execute "find", fetch(:deploy_to), ignore_options, chown_ignore_options,
         
     | 
| 
       63 
75 
     | 
    
         
             
                      "-exec", "chown", "#{fetch(:deployment_user_id)}:#{fetch(:webserver_user_id)}", "{}", "+"
         
     | 
| 
       64 
76 
     | 
    
         | 
| 
       65 
77 
     | 
    
         
             
                    # chmod executable
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: deployinator
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.2
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date:  
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2015-01-06 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: capistrano
         
     |