deploy_mate 0.12 → 0.13
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.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/deploy-mate.gemspec +2 -2
- data/lib/capistrano/deploy_mate_capfile.rb +1 -1
- data/lib/capistrano/modules/user_management.rb +11 -0
- data/lib/capistrano/scripts/create_ubuntu_user.sh +9 -0
- data/lib/capistrano/scripts/set_defaults.sh +2 -1
- data/lib/capistrano/tasks/machine.rake +21 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecff54aca5c2d8f35ce98fbfd84d318298d67e4b
|
4
|
+
data.tar.gz: 1ab1844832d1b169399e08391d1359689e76ce55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a671312408425d9c58d9493d2b875065dc8ea2b9193e663b6a36750dbc3b6edd682580568e856da694e91f93e7afe822e1f10dbd96a79b1b721a5e493762cf0e
|
7
|
+
data.tar.gz: 739d9c612e3b5285dda0a4b52131efd85d5d559fe1df63dae8ebfd7015b0c36ab47c40306a6dc0c75bda08aee3619e8aa9f6efc063e15b88dbabe109a8008c41
|
data/README.md
CHANGED
@@ -20,6 +20,7 @@ You can choose Database:
|
|
20
20
|
- Postgres
|
21
21
|
|
22
22
|
## Changelog
|
23
|
+
* **2015-06-23**: Support creation of working `ubuntu` user. Error out if another user than `ubuntu` is used.
|
23
24
|
* **2015-06-22**: Support for choosing your Ruby-version when creating the `Capfile`. Suggestions come from `.ruby-version` and `Gemfile`.
|
24
25
|
* **2015-04-29**: Load custom rake tasks from lib/capistrano/tasks directory.
|
25
26
|
You need to run the generator ```rake deploy_mate:install``` again or add ```Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }``` to your Capfile.
|
data/deploy-mate.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "deploy_mate"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.13"
|
4
4
|
|
5
5
|
s.authors = ["Tim Adler"]
|
6
|
-
s.date = %q{2015-06-
|
6
|
+
s.date = %q{2015-06-23}
|
7
7
|
s.description = %q{This is how we deploy around here.}
|
8
8
|
s.summary = s.description
|
9
9
|
s.email = %q{tim.adler (at) hanseventures (dot) com}
|
@@ -23,7 +23,7 @@ require 'capistrano/bundler'
|
|
23
23
|
require "capistrano/helpers.rb"
|
24
24
|
|
25
25
|
# Load custom modules with helper functions
|
26
|
-
%w(aptitude bluepill upstart).each do |m|
|
26
|
+
%w(aptitude bluepill upstart user_management).each do |m|
|
27
27
|
load File.expand_path("../modules/#{m}.rb", __FILE__)
|
28
28
|
end
|
29
29
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
sudo mkdir -p /home/ubuntu/.ssh/
|
3
|
+
sudo groupadd ubuntu
|
4
|
+
sudo useradd ubuntu -g ubuntu -d /home/ubuntu -s /bin/bash
|
5
|
+
sudo adduser ubuntu sudo
|
6
|
+
sudo cp ~/.ssh/authorized_keys /home/ubuntu/.ssh/
|
7
|
+
sudo chown -R ubuntu:ubuntu /home/ubuntu
|
8
|
+
sudo echo "ubuntu ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/ubuntu_no_sudo_password
|
9
|
+
sudo chmod 0440 /etc/sudoers.d/ubuntu_no_sudo_password
|
@@ -1,5 +1,6 @@
|
|
1
1
|
namespace :machine do
|
2
2
|
include Aptitude
|
3
|
+
include UserManagement
|
3
4
|
|
4
5
|
desc "Sets up a blank Ubuntu to run our Rails-setup"
|
5
6
|
task :init do
|
@@ -22,6 +23,26 @@ namespace :machine do
|
|
22
23
|
invoke "machine:install:postgres_dev" if fetch(:db_engine) == "postgresql"
|
23
24
|
end
|
24
25
|
end
|
26
|
+
before "machine:init", "machine:check_ubuntu_user"
|
27
|
+
before "deploy", "machine:check_ubuntu_user"
|
28
|
+
|
29
|
+
desc "Check if we are doing things as the correct user"
|
30
|
+
task :check_ubuntu_user do
|
31
|
+
on roles(:app) do
|
32
|
+
unless am_i?("ubuntu")
|
33
|
+
invoke "machine:create_ubuntu_user"
|
34
|
+
error "Please use a use a user named 'ubuntu' to login to the machine."
|
35
|
+
fail
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "Creates an Amazon AWS-style 'ubuntu'-user on machines with only 'root'"
|
41
|
+
task :create_ubuntu_user do
|
42
|
+
on roles(:app) do
|
43
|
+
execute_script("create_ubuntu_user.sh")
|
44
|
+
end
|
45
|
+
end
|
25
46
|
|
26
47
|
desc "Install configs"
|
27
48
|
task :setup do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deploy_mate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.13'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Adler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -94,6 +94,8 @@ files:
|
|
94
94
|
- lib/capistrano/modules/aptitude.rb
|
95
95
|
- lib/capistrano/modules/bluepill.rb
|
96
96
|
- lib/capistrano/modules/upstart.rb
|
97
|
+
- lib/capistrano/modules/user_management.rb
|
98
|
+
- lib/capistrano/scripts/create_ubuntu_user.sh
|
97
99
|
- lib/capistrano/scripts/install_ruby.sh
|
98
100
|
- lib/capistrano/scripts/install_rvm.sh
|
99
101
|
- lib/capistrano/scripts/set_defaults.sh
|