codedeploy_retry_if_needed 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0116ef4a4af4192f50ad891b2e203d3f072d4a2c
4
- data.tar.gz: f71fee4aa1ce04c48d81b19cf35e2c5995b41d42
3
+ metadata.gz: 774c3821457c5f4e373b8657a686ca5215720538
4
+ data.tar.gz: 3422de3bdd8ff996ccdc01f19a3fa06057aeb3a4
5
5
  SHA512:
6
- metadata.gz: c1fbc93a44f8b65c430f7b71c4dcaceda1ac2e509aaaac896f0a5dff64c723830c5d5ebd3c5c73066eba7cb720a6da0fa3c707e76dd90442a9a618bf4e5483f1
7
- data.tar.gz: 495c0dd5da297f802536fb5b41188a55e7f626b3bc650fde6fa8b9d672c2d3253b301471b0108d0d3c64a1f1e50a59faeba5ad251297e9a8264acc75eb9fa1f5
6
+ metadata.gz: 103f789bbee13162512c994c041f989eeab75c0acc18e666ba918a24e858f3d970c69b650f6ea5f2f6678dc3892e8138f4aa17a1c18eb01ed1a20226d6ce058d
7
+ data.tar.gz: 24879b6fc7339639a3a71c28d213e25c536fdc5fa514336ede631670104e0f30ebf97d034fbd48f7cec66d84afcbdbd64203a10e724f6548fb22e9ecd6cbea25
@@ -21,8 +21,6 @@ unless GITHUB_ACCESS_TOKEN
21
21
  exit 1
22
22
  end
23
23
 
24
- WAIT_RETRY_DEPLOY = ENV.fetch('WAIT_RETRY_DEPLOY', 120)
25
-
26
24
  client = Aws::CodeDeploy::Client.new
27
25
 
28
26
  deployment_info = client.get_deployment(deployment_id: DEPLOYMENT_ID).deployment_info
@@ -36,22 +34,6 @@ end
36
34
 
37
35
  octokit = Octokit::Client.new(login: GITHUB_LOGIN, access_token: GITHUB_ACCESS_TOKEN)
38
36
 
39
- def retry_deploy!(deployment_info, latest_master_sha)
40
- client = Aws::CodeDeploy::Client.new
41
- client.create_deployment(
42
- application_name: deployment_info.application_name,
43
- deployment_group_name: deployment_info.deployment_group_name,
44
- revision: {
45
- revision_type: deployment_info.revision.revision_type,
46
- git_hub_location: {
47
- repository: deployment_info.revision.git_hub_location.repository,
48
- commit_id: latest_master_sha,
49
- },
50
- },
51
- description: 'Retry by codedeploy_retry_if_needed',
52
- )
53
- end
54
-
55
37
  latest_master_commit_id_sha = octokit.commits(deployment_info.revision.git_hub_location.repository).first.sha
56
38
 
57
39
  deployed_commit_id_sha = deployment_info.revision.git_hub_location.commit_id
@@ -59,12 +41,5 @@ deployed_commit_id_sha = deployment_info.revision.git_hub_location.commit_id
59
41
  if latest_master_commit_id_sha == deployed_commit_id_sha
60
42
  exit 0
61
43
  else
62
- pid = Process.fork {
63
- Process.fork {
64
- sleep WAIT_RETRY_DEPLOY.to_i
65
- retry_deploy!(deployment_info, latest_master_commit_id_sha)
66
- }
67
- }
68
- Process.waitpid(pid)
69
44
  exit 1
70
45
  end
@@ -1,3 +1,3 @@
1
1
  module CodedeployRetryIfNeeded
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codedeploy_retry_if_needed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - hoshinotsuyoshi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-09 00:00:00.000000000 Z
11
+ date: 2016-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core