carthage_remote_cache 0.0.5 → 0.0.10

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
  SHA256:
3
- metadata.gz: 76eb34fe905eb5fce02802b6b3d7a764b144cc4ab20b6f67d2068215c6605811
4
- data.tar.gz: ce2786ceae18cdc95d4c21360044b21838f839879d5a69f883d7b8c8d2040f15
3
+ metadata.gz: db51bc926af285ff03bc266988ab005c5f7ab4e7131aec89d12a99b1d14ea0f1
4
+ data.tar.gz: 6d41c8d5b3c6b08369fe595169f53ca8c8cfbc22614726227687625efae341b4
5
5
  SHA512:
6
- metadata.gz: a128b2d782cee56f2ddfc018a8f4e4e3275dd87b1337d6420861ee376edd0ea468655739951667768855721d0f91a7176a4102a4f20a2cc92e363e617bebe2d8
7
- data.tar.gz: ffead6c5c29416ed7d12e2fdbd26f465127deedb80fb3af261904de35b2a22245a9302427081ff5e86585e2426db4a4444bbac57680e0726b7b3d2d9809f2e8d
6
+ metadata.gz: 2fc9aa022853786a525dc61f4bbb23f1c53ff5458b05466bdf0041ac664703118391fa1cf82671c32e39012eefa1f01f664a903b35a85142e8b18ff6ae450a1f
7
+ data.tar.gz: ce992ab16d4281d7d348e3b04ef405de51a66fb1036282ae6a17055c7a0ab958aa1c7bb6b3e24a7adad2f04c6fc727938624e493fe31b3bdd4c2474cbd1b1540
data/Dockerfile ADDED
@@ -0,0 +1,7 @@
1
+ FROM ruby:2.7.1-alpine3.12
2
+
3
+ RUN apk add --no-cache g++ make
4
+ RUN gem install carthage_remote_cache
5
+
6
+ EXPOSE 9292
7
+ CMD ["carthagerc", "server"]
data/Gemfile.lock CHANGED
@@ -1,20 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carthage_remote_cache (0.0.5)
4
+ carthage_remote_cache (0.0.10)
5
5
  concurrent-ruby (~> 1.0.5)
6
- rack (~> 2.0.4)
6
+ rack (>= 2.0.6, < 2.3.0)
7
7
  rest-client (~> 2.0.2)
8
- sinatra (~> 2.0.0)
8
+ sinatra (~> 2.0.4)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- coderay (1.1.2)
13
+ coderay (1.1.3)
14
14
  concurrent-ruby (1.0.5)
15
- domain_name (0.5.20170404)
15
+ domain_name (0.5.20190701)
16
16
  unf (>= 0.0.5, < 1.0.0)
17
- ffi (1.9.21)
17
+ ffi (1.15.0)
18
18
  formatador (0.2.5)
19
19
  guard (2.14.2)
20
20
  formatador (>= 0.2.4)
@@ -31,70 +31,70 @@ GEM
31
31
  test-unit (~> 3.0)
32
32
  http-cookie (1.0.3)
33
33
  domain_name (~> 0.5)
34
- listen (3.1.5)
35
- rb-fsevent (~> 0.9, >= 0.9.4)
36
- rb-inotify (~> 0.9, >= 0.9.7)
37
- ruby_dep (~> 1.2)
38
- lumberjack (1.0.12)
34
+ listen (3.5.1)
35
+ rb-fsevent (~> 0.10, >= 0.10.3)
36
+ rb-inotify (~> 0.9, >= 0.9.10)
37
+ lumberjack (1.2.8)
39
38
  metaclass (0.0.4)
40
- method_source (0.9.0)
41
- mime-types (3.1)
39
+ method_source (1.0.0)
40
+ mime-types (3.3.1)
42
41
  mime-types-data (~> 3.2015)
43
- mime-types-data (3.2016.0521)
42
+ mime-types-data (3.2021.0225)
44
43
  mocha (1.3.0)
45
44
  metaclass (~> 0.0.1)
46
- mustermann (1.0.1)
45
+ mustermann (1.1.1)
46
+ ruby2_keywords (~> 0.0.1)
47
47
  nenv (0.3.0)
48
48
  netrc (0.11.0)
49
- notiffany (0.1.1)
49
+ notiffany (0.1.3)
50
50
  nenv (~> 0.1)
51
51
  shellany (~> 0.0)
52
- power_assert (1.1.1)
53
- pry (0.11.3)
54
- coderay (~> 1.1.0)
55
- method_source (~> 0.9.0)
56
- rack (2.0.4)
57
- rack-protection (2.0.0)
52
+ power_assert (2.0.0)
53
+ pry (0.14.1)
54
+ coderay (~> 1.1)
55
+ method_source (~> 1.0)
56
+ rack (2.2.3)
57
+ rack-protection (2.0.8.1)
58
58
  rack
59
- rake (10.5.0)
60
- rb-fsevent (0.10.2)
61
- rb-inotify (0.9.10)
62
- ffi (>= 0.5.0, < 2)
63
- rerun (0.13.0)
59
+ rake (13.0.3)
60
+ rb-fsevent (0.11.0)
61
+ rb-inotify (0.10.1)
62
+ ffi (~> 1.0)
63
+ rerun (0.13.1)
64
64
  listen (~> 3.0)
65
65
  rest-client (2.0.2)
66
66
  http-cookie (>= 1.0.2, < 2.0)
67
67
  mime-types (>= 1.16, < 4.0)
68
68
  netrc (~> 0.8)
69
- ruby_dep (1.5.0)
70
- rufo (0.2.0)
69
+ ruby2_keywords (0.0.4)
70
+ rufo (0.13.0)
71
71
  shellany (0.0.1)
72
- sinatra (2.0.0)
72
+ sinatra (2.0.8.1)
73
73
  mustermann (~> 1.0)
74
74
  rack (~> 2.0)
75
- rack-protection (= 2.0.0)
75
+ rack-protection (= 2.0.8.1)
76
76
  tilt (~> 2.0)
77
- test-unit (3.2.7)
77
+ test-unit (3.2.9)
78
78
  power_assert
79
- thor (0.20.0)
80
- tilt (2.0.8)
79
+ thor (1.1.0)
80
+ tilt (2.0.10)
81
81
  unf (0.1.4)
82
82
  unf_ext
83
- unf_ext (0.0.7.5)
83
+ unf_ext (0.0.7.7)
84
84
 
85
85
  PLATFORMS
86
86
  ruby
87
87
 
88
88
  DEPENDENCIES
89
- bundler (~> 1.16)
89
+ bundler
90
90
  carthage_remote_cache!
91
91
  guard (~> 2.14.2)
92
92
  guard-test (~> 2.0.8)
93
93
  mocha (~> 1.3.0)
94
- rake (~> 10.0)
94
+ rake (~> 13.0)
95
95
  rerun
96
96
  rufo
97
97
  test-unit (~> 3.2.7)
98
98
 
99
99
  BUNDLED WITH
100
- 1.16.1
100
+ 2.2.11
data/Guardfile CHANGED
@@ -1,6 +1,6 @@
1
1
  guard :test do
2
2
  watch(%r{^test/.+_tests\.rb$})
3
- watch('test/test_helper.rb') { 'test' }
4
- watch('test/fixtures.rb') { 'test' }
3
+ watch("test/test_helper.rb") { "test" }
4
+ watch("test/fixtures.rb") { "test" }
5
5
  watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_tests.rb" }
6
6
  end
data/README.md CHANGED
@@ -68,22 +68,29 @@ It is recommended to always perform the upload workflow after upgrading Xcode an
68
68
 
69
69
  ### Download Workflow
70
70
 
71
- Once cache server has been populated with framework binaries, it's time to fetch frameworks from a different machine. Make sure to pull in `Cartrcfile` from respository before executing:
71
+ Once the cache server has been populated with framework binaries, it's time to fetch frameworks from a different machine. Make sure to pull in `Cartrcfile` from the repository before executing:
72
72
 
73
73
  $ carthagerc download
74
74
 
75
- You should expect to see following output on a machine with empty `Carthage` folder:
75
+ You should expect to see the following output on a machine with empty `Carthage` folder:
76
76
 
77
77
  Downloaded and extracted 53 archives (97.2 MB), skipped 0 archives.
78
78
 
79
79
  Your project should be ready for building.
80
80
 
81
- #### Overwriting Local Carthage Folder
81
+ #### Overwrite Local Carthage Folder
82
82
 
83
83
  In case you happen to change a file in `Carthage/Build` by accident, it's possible to force download all frameworks again with:
84
84
 
85
85
  $ carthagerc download --force
86
86
 
87
+ #### Download Only Some Platforms
88
+
89
+ The example above downloaded all frameworks for all platforms (iOS, macOS, tvOS, watchOS). If large dependencies or network speed are an issue, you can download only a subset of the platforms by using the `--platform` argument:
90
+
91
+ $ carthagerc download --platform iOS,macOS,tvOS,watchOS
92
+
93
+ Please note, that invoking the `download` command multiple times with different platform arguments is not supported. The `.version` file will "forget" that `carthagerc` already downloaded the platform specified before the last download. If you need multiple platforms, specify them in a single `download` command once, delimited with a comma.
87
94
 
88
95
  ### Config
89
96
 
@@ -105,6 +112,39 @@ Which will print similar information:
105
112
  Local Build Frameworks:
106
113
  Attributions 0.3 [:iOS]
107
114
 
115
+ ### Verify Framework Versions
116
+
117
+ When switching between development branches, it's very easy to lose track of whether existing framework binaries in `Carthage/Build` match version numbers from `Cartfile.resolved`. As a result, you will probably lose several minutes of your development time, because `Xcode` doesn't tell you about outdated or missing framework binaries.
118
+
119
+ Luckily, `carthage_remote_cache` provides following command:
120
+
121
+ carthagerc verify
122
+
123
+ If existing frameworks match `Cartfile.resolved`, script exits with `0` and doesn't print anything.
124
+
125
+ In the event of framework version mismatch, you'll be able to observe following output:
126
+
127
+ Detected differences between existing frameworks in 'Carthage/Build' and entries in 'Cartfile.resolved':
128
+
129
+ +-----------------+----------------+-------------------+
130
+ | Framework | Carthage/Build | Cartfile.resolved |
131
+ +-----------------+----------------+-------------------+
132
+ | CocoaLumberjack | 3.2.1 | 3.4.1 |
133
+ | PhoneNumberKit | 1.3.0 | 2.1.0 |
134
+ | HelloWorld | - | 3.0.0 |
135
+ +-----------------+----------------+-------------------+
136
+
137
+ To resolve the issue:
138
+ - run `carthagerc download` to fetch missing frameworks from the server.
139
+ - if the issue persists, run `carthage bootstrap` to build frameworks and `carthagerc upload` to populate the server.
140
+
141
+ #### Git Hook
142
+
143
+ Running `carthagerc verify` manually on every git checkout / merge / pull could be quite cumbersome. To automate this task, integrate following script [carthagerc-verify-githook](https://github.com/kayak/carthage_remote_cache/blob/master/integrations/carthagerc-verify-githook) into your repository's git hooks, e.g. `post-checkout`.
144
+
145
+ See `$ man githooks` for all available git hooks and their documentation.
146
+
147
+
108
148
  ### Cache Server
109
149
 
110
150
  Start the server with
@@ -122,6 +162,19 @@ Server is bound to port 9292 by default. If you need to use different port, spec
122
162
 
123
163
  Don't forget to change port number in your version controlled `Cartrcfile`.
124
164
 
165
+ #### Version Compatibility
166
+
167
+ Before each `carthagerc [upload|download]`, the script compares its version number against cache server. If the version doesn't match, `carthagerc` aborts with:
168
+
169
+ Version mismatch:
170
+ Cache server version: 0.0.7
171
+ Client version: 0.0.6
172
+
173
+ Please use the same version as cache server is using by running:
174
+ $ gem install carthage_remote_cache -v 0.0.7
175
+
176
+ Please note, that this functionality only works with clients starting with version [0.0.6](https://github.com/kayak/carthage_remote_cache/releases/tag/0.0.6).
177
+
125
178
  #### Directory Structure
126
179
 
127
180
  Cache server stores version files and framework archives in following directory structure:
@@ -148,7 +201,7 @@ It's safe to delete whole directories since no other metadata is stored.
148
201
 
149
202
  #### Launch Agent
150
203
 
151
- You can also run the cache server as a launch agent. Copy the template [com.kayak.carthagerc.server.plist](https://github.com/kayak/carthage_remote_cache/blob/master/com.kayak.carthagerc.server.plist) file to `~/Library/LaunchAgents`, change log
204
+ You can also run the cache server as a launch agent. Copy the template [com.kayak.carthagerc.server.plist](https://github.com/kayak/carthage_remote_cache/blob/master/integrations/com.kayak.carthagerc.server.plist) file to `~/Library/LaunchAgents`, change log
152
205
  paths to include your username and run:
153
206
 
154
207
  $ launchctl load -w ~/Library/LaunchAgents/com.kayak.carthagerc.server.plist
@@ -159,6 +212,30 @@ If you want to stop the agent, run:
159
212
 
160
213
  Check out official documentation on [Launch Agents](https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html) for more info.
161
214
 
215
+ #### Docker
216
+
217
+ To build an image based on the latest released gem, run
218
+
219
+ $ docker build -t carthagerc .
220
+
221
+ Afterwards you can run the image in a container using
222
+
223
+ $ docker run -d --publish 9292:9292 --name carthagerc carthagerc:latest
224
+
225
+ The server will now be available on port 9292 on `localhost`. Note that the command above will cause any data added to `~/.carthagerc_server` to be written into the container layer. While this works, it's generally discouraged due to decreased performance and portability. To avoid this, you can use a volume.
226
+
227
+ $ docker run -d --publish 9292:9292 --mount "source=carthagerc,target=/root/.carthagerc_server" --name carthagerc carthagerc:latest
228
+
229
+ We also recommend adding the `--log-opt` option to limit the size of logs, e.g. `--log-opt max-size=50m`.
230
+
231
+ To inspect the logs after running, use
232
+
233
+ $ docker logs carthagerc
234
+
235
+ To stop the container, run
236
+
237
+ $ docker container stop carthagerc
238
+
162
239
  ### Version
163
240
 
164
241
  $ carthagerc version
@@ -175,7 +252,7 @@ Documentation is also available when running `carthagerc` or `carthagerc --help`
175
252
  config
176
253
  print environment information and Cartrcfile configuration
177
254
 
178
- download [-f|--force] [-v|--verbose]
255
+ download [-f|--force] [-v|--verbose] [-mPLATFORM|--platform=PLATFORM]
179
256
  fetch missing frameworks into Carthage/Build
180
257
 
181
258
  init
@@ -187,12 +264,17 @@ Documentation is also available when running `carthagerc` or `carthagerc --help`
187
264
  server [-pPORT|--port=PORT]
188
265
  start cache server
189
266
 
267
+ verify
268
+ compare versions from Cartfile.resolved to existing frameworks in Carthage/Build
269
+
190
270
  version
191
271
  print current version number
192
272
 
193
273
  OPTIONS
194
274
  -f, --force Force upload/download of framework archives even if local and server .version files match
195
275
  -h, --help Show help
276
+ -m, --platform=PLATFORM Comma delimited list of platforms which should be downloaded from the server; e.g. `--platform iOS,macOS`; Supported values: iOS, macOS, tvOS, watchOS
277
+ -n, --no-retry Don't retry download or upload on network failures
196
278
  -p, --port=PORT Server application port used when starting server, default port is 9292
197
279
  -v, --verbose Show extra runtime information
198
280
 
data/Rakefile CHANGED
@@ -5,10 +5,10 @@ task :default => :spec
5
5
 
6
6
  Rake::TestTask.new do |t|
7
7
  t.libs << "test"
8
- t.test_files = FileList['test/*_tests.rb']
8
+ t.test_files = FileList["test/*_tests.rb"]
9
9
  t.verbose = true
10
10
  end
11
11
 
12
12
  task :format do
13
- system('rufo bin/carthagerc lib test Gemfile Guardfile Rakefile carthage_remote_cache.gemspec')
13
+ system("bundle exec rufo bin/carthagerc lib test Gemfile Guardfile Rakefile carthage_remote_cache.gemspec")
14
14
  end
data/bin/carthagerc CHANGED
@@ -2,13 +2,15 @@
2
2
 
3
3
  $LOAD_PATH.push File.expand_path("../../lib", __FILE__)
4
4
 
5
- require 'optparse'
6
- require 'carthage_remote_cache'
7
- require 'commands'
5
+ require "optparse"
6
+ require "carthage_remote_cache"
7
+ require "commands"
8
8
 
9
- ARGV << '-h' if ARGV.empty?
9
+ ARGV << "-h" if ARGV.empty?
10
+ command = ARGV[0]
10
11
  options = {
11
12
  :force => false,
13
+ :is_retry_enabled => true,
12
14
  :server_port => SERVER_DEFAULT_PORT,
13
15
  :verbose => false,
14
16
  }
@@ -30,7 +32,7 @@ opt_parser = OptionParser.new do |opt|
30
32
  opt.separator " config"
31
33
  opt.separator " print environment information and #{CARTRCFILE} configuration"
32
34
  opt.separator ""
33
- opt.separator " download [-f|--force] [-v|--verbose]"
35
+ opt.separator " download [-f|--force] [-v|--verbose] [-mPLATFORM|--platform=PLATFORM]"
34
36
  opt.separator " fetch missing frameworks into Carthage/Build"
35
37
  opt.separator ""
36
38
  opt.separator " init"
@@ -42,6 +44,9 @@ opt_parser = OptionParser.new do |opt|
42
44
  opt.separator " server [-pPORT|--port=PORT]"
43
45
  opt.separator " start cache server"
44
46
  opt.separator ""
47
+ opt.separator " verify"
48
+ opt.separator " compare versions from #{CARTFILE_RESOLVED} to existing frameworks in #{CARTHAGE_BUILD_DIR}"
49
+ opt.separator ""
45
50
  opt.separator " version"
46
51
  opt.separator " print current version number"
47
52
  opt.separator ""
@@ -56,6 +61,15 @@ opt_parser = OptionParser.new do |opt|
56
61
  exit
57
62
  end
58
63
 
64
+ opt.on("-m", "--platform=PLATFORM", "Comma delimited list of platforms which should be downloaded from the server; e.g. `--platform iOS,macOS`; Supported values: #{PLATFORMS.map(&:to_s).join(", ")}") do |platform|
65
+ raise AppError.new("[-p|--platform] is only supported for the 'download' command") if command != "download"
66
+ options[:platforms] = platform_to_symbols(platform)
67
+ end
68
+
69
+ opt.on("-n", "--no-retry", "Don't retry download or upload on network failures") do
70
+ options[:is_retry_enabled] = false
71
+ end
72
+
59
73
  opt.on("-pPORT", "--port=PORT", "Server application port used when starting server, default port is #{SERVER_DEFAULT_PORT}") do |port|
60
74
  options[:server_port] = port
61
75
  end
@@ -65,10 +79,9 @@ opt_parser = OptionParser.new do |opt|
65
79
  end
66
80
  end
67
81
 
68
- opt_parser.parse!
69
-
70
82
  begin
71
- command = ARGV[0]
83
+ opt_parser.parse!
84
+
72
85
  case command
73
86
  when "config"
74
87
  puts Configuration.new_with_defaults
@@ -80,10 +93,12 @@ begin
80
93
  UploadCommand.new_with_defaults(options).run
81
94
  when "server"
82
95
  ServerCommand.new(options).run
96
+ when "verify"
97
+ VerifyCommand.new_with_defaults(options).run
83
98
  when "version"
84
99
  puts VERSION
85
100
  else
86
- bail("Unsupported command #{command}, run with --help to show available commands")
101
+ bail("Unsupported command #{command}, run with --help to show available commands or see README at https://github.com/kayak/carthage_remote_cache")
87
102
  end
88
103
  rescue AppError => e
89
104
  bail(e.message)
@@ -14,23 +14,23 @@ Gem::Specification.new do |spec|
14
14
  spec.email = ["jblahunka@kayak.com"]
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
- f.match(%r{^(test|spec|features|example)/})
17
+ f.match(%r{^(test|spec|features|example|integrations)/})
18
18
  end
19
19
  spec.bindir = "bin"
20
20
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_development_dependency "bundler", "~> 1.16"
23
+ spec.add_development_dependency "bundler"
24
24
  spec.add_development_dependency "guard", "~> 2.14.2"
25
25
  spec.add_development_dependency "guard-test", "~> 2.0.8"
26
26
  spec.add_development_dependency "mocha", "~> 1.3.0"
27
- spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "rake", "~> 13.0"
28
28
  spec.add_development_dependency "rerun"
29
29
  spec.add_development_dependency "rufo"
30
30
  spec.add_development_dependency "test-unit", "~> 3.2.7"
31
31
 
32
32
  spec.add_runtime_dependency "concurrent-ruby", "~> 1.0.5"
33
- spec.add_runtime_dependency "rack", "~> 2.0.4"
33
+ spec.add_runtime_dependency "rack", ">= 2.0.6", "< 2.3.0"
34
34
  spec.add_runtime_dependency "rest-client", "~> 2.0.2"
35
- spec.add_runtime_dependency "sinatra", "~> 2.0.0"
35
+ spec.add_runtime_dependency "sinatra", "~> 2.0.4"
36
36
  end
data/dev/start_server CHANGED
@@ -3,6 +3,6 @@
3
3
  DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4
4
  pushd "$DIR/../lib/server"
5
5
 
6
- rerun --no-notify rackup
6
+ bundle exec rerun --no-notify rackup
7
7
 
8
8
  popd