itamae 1.0.0.beta20 → 1.0.0.beta21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/itamae/backend.rb +12 -0
- data/lib/itamae/resource/git.rb +8 -12
- data/lib/itamae/resource/link.rb +1 -1
- data/lib/itamae/version.txt +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 696b6b9d0d4dde941a436b0cab7a717ad510740a
|
4
|
+
data.tar.gz: d06f0329589a1cb8bf19c5f99e68e4ab7edb91ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7222275191cb7581380abe17733226854fc37024bbc0d3f6c7e1654240ffccc6def6adddaaab8408a2abe6b595485e64aa46e9f18ec1878b008d0945f238737c
|
7
|
+
data.tar.gz: 3c65feb51906ffe4cc552b4f940ffcfdf359a805a948a70fda21ad012d8c757fea61961a2bb434a3be216b4d05f27f6e433ccb88c5b11c98d8ae79b117b34244
|
data/lib/itamae/backend.rb
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
require 'specinfra'
|
2
2
|
require 'singleton'
|
3
|
+
require 'io/console'
|
4
|
+
|
5
|
+
module Specinfra
|
6
|
+
module Configuration
|
7
|
+
def self.sudo_password
|
8
|
+
return @sudo_password if @sudo_password
|
9
|
+
|
10
|
+
print "sudo password: "
|
11
|
+
@sudo_password = STDIN.noecho(&:gets).strip
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
3
15
|
|
4
16
|
module Itamae
|
5
17
|
class Backend
|
data/lib/itamae/resource/git.rb
CHANGED
@@ -15,21 +15,11 @@ module Itamae
|
|
15
15
|
when :sync
|
16
16
|
@attributes[:exist?] = true
|
17
17
|
end
|
18
|
-
|
19
|
-
@attributes[:revision_hash] = if revision
|
20
|
-
get_revision(revision)
|
21
|
-
else
|
22
|
-
run_command_in_repo("git ls-remote origin HEAD | cut -f1").stdout.strip
|
23
|
-
end
|
24
18
|
end
|
25
19
|
|
26
20
|
def set_current_attributes
|
27
21
|
exist = run_specinfra(:check_file_is_directory, destination)
|
28
22
|
@current_attributes[:exist?] = exist
|
29
|
-
|
30
|
-
if exist
|
31
|
-
@current_attributes[:revision_hash] = get_revision('HEAD')
|
32
|
-
end
|
33
23
|
end
|
34
24
|
|
35
25
|
def sync_action
|
@@ -44,7 +34,13 @@ module Itamae
|
|
44
34
|
new_repository = true
|
45
35
|
end
|
46
36
|
|
47
|
-
|
37
|
+
target = if revision
|
38
|
+
get_revision(revision)
|
39
|
+
else
|
40
|
+
run_command_in_repo("git ls-remote origin HEAD | cut -f1").stdout.strip
|
41
|
+
end
|
42
|
+
|
43
|
+
if new_repository || target != get_revision('HEAD')
|
48
44
|
updated!
|
49
45
|
|
50
46
|
deploy_old_created = false
|
@@ -53,7 +49,7 @@ module Itamae
|
|
53
49
|
deploy_old_created = true
|
54
50
|
end
|
55
51
|
|
56
|
-
run_command_in_repo(["git", "checkout",
|
52
|
+
run_command_in_repo(["git", "checkout", target, "-b", DEPLOY_BRANCH])
|
57
53
|
|
58
54
|
if deploy_old_created
|
59
55
|
run_command_in_repo("git branch -d deploy-old")
|
data/lib/itamae/resource/link.rb
CHANGED
@@ -15,7 +15,7 @@ module Itamae
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def set_current_attributes
|
18
|
-
@current_attributes[:exist?] = (run_command(["test", "-L", link]).exit_status == 0)
|
18
|
+
@current_attributes[:exist?] = (run_command(["test", "-L", link], error: false).exit_status == 0)
|
19
19
|
|
20
20
|
if @current_attributes[:exist?]
|
21
21
|
@current_attributes[:to] = run_command(["readlink", "-f", link]).stdout.strip
|
data/lib/itamae/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.
|
1
|
+
1.0.0.beta21
|