ci_toolkit 1.5.20 → 1.5.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cda24a26780af2c15fddb5fbcec7342eab295503cf25d03efc34342a41121db1
4
- data.tar.gz: 16acb67a59d264fe7a67bf7d9ab2a843940f26cdc7c037d583e9ebc7b2590e43
3
+ metadata.gz: 659ab6668b76e08f2df9bdad69f510b72af0a3c84c911a181accdc0cbfdedb18
4
+ data.tar.gz: 828fee99088355562ba0cd0607909759be93bb6ef834fcd8d0225391aa405509
5
5
  SHA512:
6
- metadata.gz: 869f39c1325eeb759c755438c66113e153fa445b93b67c61bcfe203bbc4997d97d6bafb9aa94ade7279b11c4f0003920b94240a0a46e3ec12e616806fe64da6c
7
- data.tar.gz: 3f2b65acbc8bf32d78900c214b16f0380f019e55ec8ff3196c867591487bfe210a39dfc31aa3ca86f961ffb5ebc9beefdf976f5fd8b1ed7f19cfc94c8d4d5189
6
+ metadata.gz: d2e976214a79a78ada20daa29b1e76b5e755e7ed6e90ea47075e42a2b652f39e87f3e25cbd060f59afcbdb8d3bc528cdd393aeef066bd222aeda8730e5218c60
7
+ data.tar.gz: 691b4025c6d27609d284fef5e947b290a549db505484d26fa16c4966acaf5983695b376b2be178818b2f380a32eb7cae328aa2f9a4030562e95a846733b5a23f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci_toolkit (1.5.20)
4
+ ci_toolkit (1.5.22)
5
5
  faraday
6
6
  faraday-multipart
7
7
  faraday_middleware
@@ -43,18 +43,16 @@ GEM
43
43
  faraday-rack (1.0.0)
44
44
  faraday_middleware (1.2.0)
45
45
  faraday (~> 1.0)
46
- gitlab (4.18.0)
47
- httparty (~> 0.18)
46
+ gitlab (4.19.0)
47
+ httparty (~> 0.20)
48
48
  terminal-table (>= 1.5.1)
49
- httparty (0.20.0)
50
- mime-types (~> 3.0)
49
+ httparty (0.21.0)
50
+ mini_mime (>= 1.0.0)
51
51
  multi_xml (>= 0.5.2)
52
52
  ipaddr (1.2.3)
53
53
  json (2.5.1)
54
54
  jwt (2.3.0)
55
- mime-types (3.4.1)
56
- mime-types-data (~> 3.2015)
57
- mime-types-data (3.2022.0105)
55
+ mini_mime (1.1.2)
58
56
  multi_xml (0.6.0)
59
57
  multipart-post (2.1.1)
60
58
  octokit (4.21.0)
@@ -116,7 +114,7 @@ GEM
116
114
  unicode-display_width (>= 1.1.1, < 3)
117
115
  time (0.2.0)
118
116
  date
119
- unicode-display_width (2.1.0)
117
+ unicode-display_width (2.4.2)
120
118
 
121
119
  PLATFORMS
122
120
  universal-darwin-20
@@ -134,4 +132,4 @@ DEPENDENCIES
134
132
  simplecov-json
135
133
 
136
134
  BUNDLED WITH
137
- 2.3.16
135
+ 2.4.12
@@ -44,8 +44,6 @@ module CiToolkit
44
44
  @github.create_status(state, @context, @env.app_url, "Building failed")
45
45
  end
46
46
 
47
- private
48
-
49
47
  def load_counter
50
48
  description = @github.get_status_description(@context)
51
49
  return if description.nil?
@@ -45,10 +45,7 @@ module CiToolkit
45
45
  )
46
46
  # Application with unique name already exist. Replace it.
47
47
  elsif response.status == ERROR && !response.data.nil? && !response.data.uniqueName.nil?
48
- application_info_response = faraday_get_application_info(unique_name)
49
- application_id = application_info_response[0].id
50
- response = replace_existing_application(
51
- application_id,
48
+ response = replace_existing_application_by_unique_name(
52
49
  project_name,
53
50
  unique_name,
54
51
  full_path_to_file,
@@ -75,8 +72,23 @@ module CiToolkit
75
72
  full_path_to_file,
76
73
  content_type
77
74
  )
78
- faraday_delete_application(application_id)
79
- faraday_upload_file_with_error_handling(project_name, unique_name, full_path_to_file, content_type)
75
+ response = faraday_delete_application(application_id)
76
+
77
+ if response.status == SUCCESS && response.code == OKAY
78
+ response = faraday_upload_file_with_error_handling(project_name, unique_name, full_path_to_file, content_type)
79
+ end
80
+ response
81
+ end
82
+
83
+ def replace_existing_application_by_unique_name(project_name, unique_name, full_path_to_file, content_type)
84
+ application_info_response = faraday_get_application_info(unique_name)
85
+ application_info_response.each do |app_response|
86
+ next unless app_response.uniqueName == unique_name
87
+
88
+ response = replace_existing_application(app_response.id, project_name, unique_name, full_path_to_file,
89
+ content_type)
90
+ return response if response.status == SUCCESS
91
+ end
80
92
  end
81
93
 
82
94
  def faraday_upload_file_with_error_handling(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.20
4
+ version: 1.5.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gero Keller
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-17 00:00:00.000000000 Z
11
+ date: 2023-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday