watchbuild 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0f10f545e792481a16ecc12620391518f294f819
4
+ data.tar.gz: b968343ed2f4ae47ee52fd0b409f1f85b48e8ac5
5
+ SHA512:
6
+ metadata.gz: 1801c47e3e8738584aac2be7c535b51dedd9d875ab6fc25bfd79f0426f053c7fe460cf22bcbc4a1a9fef0274da6753e86897aa8622742bbd6775501818e215ba
7
+ data.tar.gz: c0a556457865b456013e4d9c887a56a3845c4b879cc88d678f0f2cbcdafb19f3d6080b2c2e98fb96ad247e14fbd0b61c7d7070198a06db102680f20e24a2de12
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Felix Krause
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,103 @@
1
+ <h3 align="center">
2
+ <a href="https://github.com/fastlane/fastlane">
3
+ <img src="assets/fastlane.png" width="150" />
4
+ <br />
5
+ fastlane
6
+ </a>
7
+ </h3>
8
+ <p align="center">
9
+ <a href="https://github.com/fastlane/deliver">deliver</a> &bull;
10
+ <a href="https://github.com/fastlane/snapshot">snapshot</a> &bull;
11
+ <a href="https://github.com/fastlane/frameit">frameit</a> &bull;
12
+ <a href="https://github.com/fastlane/PEM">PEM</a> &bull;
13
+ <a href="https://github.com/fastlane/sigh">sigh</a> &bull;
14
+ <a href="https://github.com/fastlane/produce">produce</a> &bull;
15
+ <a href="https://github.com/fastlane/cert">cert</a> &bull;
16
+ <a href="https://github.com/fastlane/spaceship">spaceship</a> &bull;
17
+ <a href="https://github.com/fastlane/pilot">pilot</a> &bull;
18
+ <a href="https://github.com/fastlane/boarding">boarding</a> &bull;
19
+ <a href="https://github.com/fastlane/gym">gym</a> &bull;
20
+ <a href="https://github.com/fastlane/scan">scan</a>
21
+ </p>
22
+ -------
23
+
24
+ WatchBuild
25
+ ============
26
+
27
+ [![Twitter: @KauseFx](https://img.shields.io/badge/contact-@KrauseFx-blue.svg?style=flat)](https://twitter.com/KrauseFx)
28
+ [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/fastlane/watchbuild/blob/master/LICENSE)
29
+ [![Gem](https://img.shields.io/gem/v/watchbuild.svg?style=flat)](http://rubygems.org/gems/watchbuild)
30
+
31
+ ###### Get a notification once your iTunes Connect build is finished processing
32
+
33
+ <img src="assets/screenshot.png" width=350>
34
+
35
+ WatchBuild is a simple tool that shows a notification once your newly uploaded build was successfully processed by iTunes Connect.
36
+
37
+ As the [#iosprocessingtime](https://twitter.com/search?q=%23iosprocessingtime) varies from a few minutes to multiple hours, we sometimes forget to check iTunes Connect to see if the build is ready. WatchBuild does that for you.
38
+
39
+ Once the build is ready to be pushed to TestFlight or for review, you get a Mac OS X notification. You can even directly click on the notification to open the build on iTunes Connect.
40
+
41
+ Get in contact with the developer on Twitter: [@KrauseFx](https://twitter.com/KrauseFx)
42
+
43
+ -------
44
+ <p align="center">
45
+ <a href="#installation">Installation</a> &bull;
46
+ <a href="#usage">Usage</a> &bull;
47
+ <a href="#tips">Tips</a> &bull;
48
+ <a href="#need-help">Need help?</a>
49
+ </p>
50
+
51
+ -------
52
+
53
+ # Installation
54
+
55
+ sudo gem install watchbuild
56
+
57
+ Make sure, you have the latest version of the Xcode command line tools installed:
58
+
59
+ xcode-select --install
60
+
61
+ # Usage
62
+
63
+ watchbuild
64
+
65
+ You can pass your bundle identifier and username like this:
66
+
67
+ watchbuild -a com.krausefx.app -u felix@krausefx.com
68
+
69
+ For a list of available parameters and commands run
70
+
71
+ watchbuild --help
72
+
73
+ <img src="assets/terminal.png">
74
+
75
+ ## How is my password stored?
76
+ `WatchBuild` uses the [CredentialsManager](https://github.com/fastlane/credentials_manager) from `fastlane`.
77
+
78
+ # Tips
79
+ ## [`fastlane`](https://fastlane.tools) Toolchain
80
+
81
+ - [`fastlane`](https://fastlane.tools): Connect all deployment tools into one streamlined workflow
82
+ - [`deliver`](https://github.com/fastlane/deliver): Upload screenshots, metadata and your app to the App Store
83
+ - [`snapshot`](https://github.com/fastlane/snapshot): Automate taking localized screenshots of your iOS app on every device
84
+ - [`frameit`](https://github.com/fastlane/frameit): Quickly put your screenshots into the right device frames
85
+ - [`PEM`](https://github.com/fastlane/PEM): Automatically generate and renew your push notification profiles
86
+ - [`sigh`](https://github.com/fastlane/sigh): Because you would rather spend your time building stuff than fighting provisioning
87
+ - [`produce`](https://github.com/fastlane/produce): Create new iOS apps on iTunes Connect and Dev Portal using the command line
88
+ - [`cert`](https://github.com/fastlane/cert): Automatically create and maintain iOS code signing certificates
89
+ - [`spaceship`](https://github.com/fastlane/spaceship): Ruby library to access the Apple Dev Center and iTunes Connect
90
+ - [`pilot`](https://github.com/fastlane/pilot): The best way to manage your TestFlight testers and builds from your terminal
91
+ - [`boarding`](https://github.com/fastlane/boarding): The easiest way to invite your TestFlight beta testers
92
+ - [`gym`](https://github.com/fastlane/gym): Building your iOS apps has never been easier
93
+ - [`scan`](https://github.com/fastlane/scan): The easiest way to run tests of your iOS and Mac app
94
+
95
+ ##### [Like this tool? Be the first to know about updates and new fastlane tools](https://tinyletter.com/krausefx)
96
+
97
+ # Need help?
98
+ Please submit an issue on GitHub and provide information about your setup
99
+
100
+ # License
101
+ This project is licensed under the terms of the MIT license. See the LICENSE file.
102
+
103
+ > This project and all fastlane tools are in no way affiliated with Apple Inc. This project is open source under the MIT license, which means you have full access to the source code and can modify it to fit your own needs. All fastlane tools run on your own computer or server, so your credentials or other sensitive information will never leave your own computer. You are responsible for how you use fastlane tools.
data/bin/watchbuild ADDED
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.push File.expand_path("../../lib", __FILE__)
4
+
5
+ require 'watchbuild'
6
+ require 'commander'
7
+ require 'credentials_manager/password_manager'
8
+ require 'credentials_manager/appfile_config'
9
+ require 'watchbuild/options'
10
+
11
+ HighLine.track_eof = false
12
+
13
+ class WatchBuildApplication
14
+ include Commander::Methods
15
+
16
+ def run
17
+ program :version, WatchBuild::VERSION
18
+ program :description, WatchBuild::DESCRIPTION
19
+ program :help, 'Author', 'Felix Krause <watchbuild@krausefx.com>'
20
+ program :help, 'Website', 'https://fastlane.tools'
21
+ program :help, 'GitHub', 'https://github.com/fastlane/watchbuild'
22
+ program :help_formatter, :compact
23
+
24
+ FastlaneCore::CommanderGenerator.new.generate(WatchBuild::Options.available_options)
25
+
26
+ command :run do |c|
27
+ c.syntax = 'watchbuild'
28
+ c.description = 'Renews the certificate (in case it expired) and outputs the path to the generated file'
29
+
30
+ c.action do |args, options|
31
+ WatchBuild.config = FastlaneCore::Configuration.create(WatchBuild::Options.available_options, options.__hash__)
32
+ WatchBuild::Runner.new.run
33
+ end
34
+ end
35
+
36
+ default_command :run
37
+
38
+ run!
39
+ end
40
+
41
+ def multiple_values_option_proc(command, name)
42
+ proc do |value|
43
+ value = yield(value) if block_given?
44
+ option = command.proxy_options.find { |opt| opt[0] == name } || []
45
+ values = option[1] || []
46
+ values << value
47
+
48
+ command.proxy_options.delete option
49
+ command.proxy_options << [name, values]
50
+ end
51
+ end
52
+ end
53
+
54
+ begin
55
+ FastlaneCore::UpdateChecker.start_looking_for_update('watchbuild')
56
+ WatchBuildApplication.new.run
57
+ ensure
58
+ FastlaneCore::UpdateChecker.show_update_status('watchbuild', WatchBuild::VERSION)
59
+ end
@@ -0,0 +1,21 @@
1
+ require 'fastlane_core'
2
+ require 'credentials_manager'
3
+
4
+ module WatchBuild
5
+ class Options
6
+ def self.available_options
7
+ [
8
+ FastlaneCore::ConfigItem.new(key: :app_identifier,
9
+ short_option: "-a",
10
+ env_name: "APP_IDENTIFIER",
11
+ description: "The bundle identifier of your app",
12
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)),
13
+ FastlaneCore::ConfigItem.new(key: :username,
14
+ short_option: "-u",
15
+ env_name: "FASTLANE_USER",
16
+ description: "Your Apple ID Username",
17
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:apple_id))
18
+ ]
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,74 @@
1
+ require 'spaceship'
2
+
3
+ module WatchBuild
4
+ class Runner
5
+ attr_accessor :spaceship
6
+
7
+ # Uses the spaceship to create or download a provisioning profile
8
+ # returns the path the newly created provisioning profile (in /tmp usually)
9
+ def run
10
+ FastlaneCore::PrintTable.print_values(config: WatchBuild.config,
11
+ hide_keys: [],
12
+ title: "Summary for WatchBuild #{WatchBuild::VERSION}")
13
+
14
+ Helper.log.info "Starting login with user '#{WatchBuild.config[:username]}'"
15
+ Spaceship::Tunes.login(WatchBuild.config[:username], nil)
16
+ Helper.log.info "Successfully logged in"
17
+
18
+ start = Time.now
19
+ build = wait_for_build
20
+ minutes = ((Time.now - start) / 60).round
21
+ notification(build, minutes)
22
+ end
23
+
24
+ def wait_for_build
25
+ raise "Could not find app with app identiifer #{WatchBuild.config[:app_identifier]}".red unless app
26
+
27
+ loop do
28
+ build = find_build
29
+ return build if build.processing == false
30
+
31
+ Helper.log.info "Waiting iTunes Connect processing for build #{build.train_version} (#{build.build_version})... this might take a while..."
32
+ sleep 30
33
+ end
34
+ nil
35
+ end
36
+
37
+ def notification(build, minutes)
38
+ require 'terminal-notifier'
39
+
40
+ url = "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/ng/app/#{@app.apple_id}/activity/ios/builds/#{build.train_version}/#{build.build_version}/details"
41
+ TerminalNotifier.notify("Build finished processing",
42
+ title: build.app_name,
43
+ subtitle: "#{build.train_version} (#{build.build_version})",
44
+ execute: "open '#{url}'")
45
+
46
+ Helper.log.info "Successfully finished processing the build".green
47
+ Helper.log.info "You can now tweet: "
48
+ Helper.log.info "iTunes Connect #iosprocessingtime #{minutes} minutes".yellow
49
+ Helper.log.info url
50
+ end
51
+
52
+ private
53
+
54
+ def app
55
+ @app ||= Spaceship::Application.find(WatchBuild.config[:app_identifier])
56
+ end
57
+
58
+ def find_build
59
+ build = nil
60
+ app.latest_version.candidate_builds.each do |b|
61
+ if !build or b.upload_date > build.upload_date
62
+ build = b
63
+ end
64
+ end
65
+
66
+ unless build
67
+ Helper.log.fatal v.candidate_builds
68
+ raise "Could not find build".red
69
+ end
70
+
71
+ return build
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,4 @@
1
+ module WatchBuild
2
+ VERSION = "0.0.1"
3
+ DESCRIPTION = "Get a notification once your iTunes Connect build is finished processing"
4
+ end
data/lib/watchbuild.rb ADDED
@@ -0,0 +1,14 @@
1
+ require 'watchbuild/version'
2
+ require 'watchbuild/options'
3
+ require 'watchbuild/runner'
4
+
5
+ require 'fastlane_core'
6
+
7
+ module WatchBuild
8
+ # Use this to just setup the configuration attribute and set it later somewhere else
9
+ class << self
10
+ attr_accessor :config
11
+ end
12
+
13
+ Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
14
+ end
metadata ADDED
@@ -0,0 +1,227 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: watchbuild
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Felix Krause
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: fastlane_core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.26.1
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.26.1
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: spaceship
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 0.13.0
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.13.0
47
+ - !ruby/object:Gem::Dependency
48
+ name: terminal-notifier
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: bundler
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rake
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rspec
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: 3.1.0
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: 3.1.0
103
+ - !ruby/object:Gem::Dependency
104
+ name: pry
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ - !ruby/object:Gem::Dependency
118
+ name: yard
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: 0.8.7.4
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: 0.8.7.4
131
+ - !ruby/object:Gem::Dependency
132
+ name: webmock
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: 1.19.0
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: 1.19.0
145
+ - !ruby/object:Gem::Dependency
146
+ name: coveralls
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ - !ruby/object:Gem::Dependency
160
+ name: fastlane
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ - !ruby/object:Gem::Dependency
174
+ name: rubocop
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '0.34'
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - "~>"
185
+ - !ruby/object:Gem::Version
186
+ version: '0.34'
187
+ description: Get a notification once your iTunes Connect build is finished processing
188
+ email:
189
+ - watchbuild@krausefx.com
190
+ executables:
191
+ - watchbuild
192
+ extensions: []
193
+ extra_rdoc_files: []
194
+ files:
195
+ - LICENSE
196
+ - README.md
197
+ - bin/watchbuild
198
+ - lib/watchbuild.rb
199
+ - lib/watchbuild/options.rb
200
+ - lib/watchbuild/runner.rb
201
+ - lib/watchbuild/version.rb
202
+ homepage: https://fastlane.tools
203
+ licenses:
204
+ - MIT
205
+ metadata: {}
206
+ post_install_message:
207
+ rdoc_options: []
208
+ require_paths:
209
+ - lib
210
+ required_ruby_version: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: 2.0.0
215
+ required_rubygems_version: !ruby/object:Gem::Requirement
216
+ requirements:
217
+ - - ">="
218
+ - !ruby/object:Gem::Version
219
+ version: '0'
220
+ requirements: []
221
+ rubyforge_project:
222
+ rubygems_version: 2.5.0
223
+ signing_key:
224
+ specification_version: 4
225
+ summary: Get a notification once your iTunes Connect build is finished processing
226
+ test_files: []
227
+ has_rdoc: