pupcap 0.3.2 → 0.3.3
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/pupcap/action/init/Capfile.tt +4 -0
- data/lib/pupcap/capistrano.rb +12 -5
- data/lib/pupcap/cli.rb +3 -0
- data/lib/pupcap/version.rb +1 -1
- metadata +1 -1
@@ -1,8 +1,12 @@
|
|
1
|
+
set :repository, "git@github.com:example/example.get"
|
2
|
+
|
1
3
|
task :production do
|
2
4
|
role :site, 'example.com'
|
3
5
|
end
|
4
6
|
|
5
7
|
task :vagrant do
|
8
|
+
# Copy local files to remote host without any scm
|
9
|
+
set :pupcap_use_rsync, true
|
6
10
|
set :environment, "development"
|
7
11
|
role :site, "vagrant@<%= options[:ip] %>"
|
8
12
|
end
|
data/lib/pupcap/capistrano.rb
CHANGED
@@ -9,6 +9,17 @@ module Pupcap::Capistrano
|
|
9
9
|
["deploy", pupcap_capfile, file].each{|f| cap.load f }
|
10
10
|
tasks.each do |task|
|
11
11
|
cap.find_and_execute_task(task)
|
12
|
+
cap_use_rsync!(cap)
|
13
|
+
end
|
14
|
+
cap
|
15
|
+
end
|
16
|
+
|
17
|
+
def cap_use_rsync!(cap)
|
18
|
+
if cap.fetch(:pupcap_use_rsync, false)
|
19
|
+
puts 1
|
20
|
+
cap.set :repository, "."
|
21
|
+
cap.set :scm, :none
|
22
|
+
cap.set :deploy_via, :copy
|
12
23
|
end
|
13
24
|
cap
|
14
25
|
end
|
@@ -28,11 +39,7 @@ module Pupcap::Capistrano
|
|
28
39
|
cap.ssh_options[:keys] = cap.provision_key
|
29
40
|
cap.ssh_options[:forward_agent] = true
|
30
41
|
cap.default_run_options[:pty] = true
|
31
|
-
|
32
|
-
cap.set :repository, "."
|
33
|
-
cap.set :scm, :none
|
34
|
-
cap.set :deploy_via, :copy
|
35
|
-
|
42
|
+
cap.set :scm, :git
|
36
43
|
cap.set :copy_exclude, [".git", ".keys"]
|
37
44
|
cap
|
38
45
|
end
|
data/lib/pupcap/cli.rb
CHANGED
@@ -13,6 +13,9 @@ class Pupcap::CLI < Thor
|
|
13
13
|
def init(dir)
|
14
14
|
directory("action/init", dir)
|
15
15
|
inside(dir) do
|
16
|
+
unless File.exists?(".gitignore")
|
17
|
+
create_file ".gitignore"
|
18
|
+
end
|
16
19
|
append_to_file(".gitignore", ".vagrant\n", :verbose => false)
|
17
20
|
append_to_file(".gitignore", "*.swp\n", :verbose => false)
|
18
21
|
run("librarian-puppet init")
|
data/lib/pupcap/version.rb
CHANGED