itamae 1.0.0.beta16 → 1.0.0.beta17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/itamae/resource/git.rb +10 -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: 8f20806b378add5ce416a56101a4e38a7fc13620
|
4
|
+
data.tar.gz: bfb94bc29dfcdfa257a3a7c313ba2c740b9ae2c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0974d13a8eb896be8070eb68e0e5f7610b0b571a027144ca4f7e597939ee1eeee78245ddf04cc8305adb1aca607070b586527d42c78a3be4e3c2dce6fdfa7ce
|
7
|
+
data.tar.gz: db93259f92f1e539ad1c6e7c5683dedd1d30da7071e7a2f747b26205935ef746668d6ee6314e5fa400f7bfa5aadab9ef8c5808bd8d63fa86d65c44dca8f31c66
|
data/lib/itamae/resource/git.rb
CHANGED
@@ -17,12 +17,17 @@ module Itamae
|
|
17
17
|
run_command_in_repo(['git', 'fetch', 'origin'])
|
18
18
|
else
|
19
19
|
run_command(['git', 'clone', repository, destination])
|
20
|
+
updated!
|
20
21
|
end
|
21
22
|
|
22
23
|
target_revision =
|
23
|
-
revision ||
|
24
|
+
get_revision(revision) ||
|
24
25
|
run_command_in_repo("git ls-remote origin HEAD | cut -f1").stdout.strip
|
25
26
|
|
27
|
+
unless target_revision == get_revision('HEAD')
|
28
|
+
updated!
|
29
|
+
end
|
30
|
+
|
26
31
|
deploy_old_created = false
|
27
32
|
if current_branch == DEPLOY_BRANCH
|
28
33
|
run_command_in_repo("git branch -m deploy-old")
|
@@ -50,6 +55,10 @@ module Itamae
|
|
50
55
|
def current_branch
|
51
56
|
run_command_in_repo("git rev-parse --abbrev-ref HEAD").stdout.strip
|
52
57
|
end
|
58
|
+
|
59
|
+
def get_revision(branch)
|
60
|
+
run_command_in_repo("git rev-list #{shell_escape(branch)} | head -n1").stdout.strip
|
61
|
+
end
|
53
62
|
end
|
54
63
|
end
|
55
64
|
end
|
data/lib/itamae/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.
|
1
|
+
1.0.0.beta17
|