fastlane 0.0.1 → 0.1.0

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
  SHA1:
3
- metadata.gz: 13dac574558fd3aa3f53feb76240844a110d7cea
4
- data.tar.gz: 5b803ed830dd3fd104cbc79293db7bc54149526f
3
+ metadata.gz: 672ab45d6dfb1699e366bcb470d4599d4cbc7cb8
4
+ data.tar.gz: 7c0ee56e9603900623d1f41c5f543851a8587aa3
5
5
  SHA512:
6
- metadata.gz: 4eb1ce0be40fb219cccb57506d431e75ad0ddba9e86b9649d12b11d90b57d1d091ac6512bcb6111848156f06380764a4f168f09c72e28869344d75599106e9d1
7
- data.tar.gz: c1a2e9bc543c6aa1b007f0f8e850c7a058466152d5e962602e18647cb9ef0d36b096554269d39a469682d686818601443e24cd1498ad6ef4fb5de2c5284d4913
6
+ metadata.gz: ca08511c7f631225459d027b316276014e81f9fcdc1defe167254f555ad5d5a169d8f8937aab29e06a9226eec54913a808a32fa370ba1f51965c88f2cc484d58
7
+ data.tar.gz: af369c3d4115294e164754b3c3e39063eabac9bfdbb1a367b32bbe282b520dd67a27c14f4381af42fa9d67f06212b5bb9e16dc1a779af2a615704a84d1ff8f9c
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,418 @@
1
+ <h3 align="center">
2
+ <img src="assets/fastlane_text.png" alt="fastlane Logo" />
3
+ </h3>
4
+ <p align="center">
5
+ <a href="https://github.com/KrauseFx/deliver">deliver</a> &bull;
6
+ <a href="https://github.com/KrauseFx/snapshot">snapshot</a> &bull;
7
+ <a href="https://github.com/KrauseFx/frameit">frameit</a> &bull;
8
+ <a href="https://github.com/KrauseFx/PEM">PEM</a> &bull;
9
+ <a href="https://github.com/KrauseFx/sigh">sigh</a>
10
+ </p>
11
+ -------
12
+
13
+ fastlane
14
+ ============
15
+
16
+ [![Twitter: @KauseFx](https://img.shields.io/badge/contact-@KrauseFx-blue.svg?style=flat)](https://twitter.com/KrauseFx)
17
+ [![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/KrauseFx/fastlane/blob/master/LICENSE)
18
+ [![Gem](https://img.shields.io/gem/v/fastlane.svg?style=flat)](http://rubygems.org/gems/fastlane)
19
+
20
+ ######*fastlane* lets you define and run your deployment pipelines for different environments. It helps you unify your apps release process and automate the whole process. fastlane connects all fastlane tools and third party tools, like [CocoaPods](http://cocoapods.org) and [xctool](https://github.com/facebook/xctool).
21
+
22
+
23
+ Get in contact with the developer on Twitter: [@KrauseFx](https://twitter.com/KrauseFx)
24
+
25
+ -------
26
+ <p align="center">
27
+ <a href="#features">Features</a> &bull;
28
+ <a href="#installation">Installation</a> &bull;
29
+ <a href="#quick-start">Quick Start</a> &bull;
30
+ <a href="#customise-the-fastfile">Customise</a> &bull;
31
+ <a href="#extensions">Extensions</a> &bull;
32
+ <a href="#jenkins-integration">Jenkins</a> &bull;
33
+ <a href="#tips">Tips</a> &bull;
34
+ <a href="#need-help">Need help?</a>
35
+ </p>
36
+
37
+ -------
38
+
39
+
40
+ # Features
41
+ - Connect all tools, part of the ```fastlane``` toolchain to work seamlessly together
42
+ - Define different ```deployment lanes``` for App Store deployment, beta builds or testing
43
+ - Deploy from any computer
44
+ - [Jenkins Integration](#jenkins-integration): Show the output directly in the Jenkins test results
45
+ - Write your [own actions](#extensions) (extensions) to extend the functionality of `fastlane`
46
+ - Store data like the ```Bundle Identifier``` or your ```Apple ID``` once and use it across all tools
47
+ - Never remember any difficult commands, just ```fastlane```
48
+ - Easy setup, which helps you getting up and running very fast
49
+ - Shared context, which is used to let the different deployment steps communicate with each other
50
+ - Store **everything** in git. Never lookup the used build commands in the ```Jenkins``` configs
51
+ - Saves you **hours** of preparing app submission, uploading screenshots and deploying the app for each update
52
+ - Very flexible configuration using a fully customizable `Fastfile`
53
+ - Once up and running, you have a fully working **Continuous Deployment** process. Just trigger ```fastlane``` and you're good to go.
54
+
55
+ # Installation
56
+
57
+ I recommend following the [fastlane guide](https://github.com/KrauseFx/fastlane/blob/master/GUIDE.md) to get started.
58
+
59
+ If you are familiar with the command line and Ruby, install `fastlane` yourself:
60
+
61
+ sudo gem install fastlane
62
+
63
+ Make sure, you have the latest version of the Xcode command line tools installed:
64
+
65
+ xcode-select --install
66
+
67
+
68
+ If you want to take a look at a project, already using `fastlane`, check out the [fastlane-example project](https://github.com/krausefx/fastlane-example) on GitHub.
69
+
70
+ # Quick Start
71
+
72
+
73
+ The setup assistent will create all the necessary files for you, using the existing app metadata from iTunes Connect.
74
+
75
+ - ```cd [your_project_folder]```
76
+ - ```fastlane init```
77
+ - Follow the setup assistent, which will set up ```fastlane``` for you
78
+ - Further customise the ```Fastfile``` using the next section
79
+
80
+ For a more detailed setup, please follow the [fastlane guide](https://github.com/KrauseFx/fastlane/blob/master/GUIDE.md).
81
+
82
+ # Customise the ```Fastfile```
83
+ Why should you have to remember complicated commands and parameters?
84
+
85
+ Store your configuration in a text file to easily deploy from any computer.
86
+
87
+ Open the ```Fastfile``` using a text editor and customise it even further. (Switch to *Ruby* Syntax Highlighting)
88
+
89
+ ### Lanes
90
+ You can define multiple ```lanes``` which are different workflows for a release process.
91
+
92
+ Examples are: ```appstore```, ```beta``` and ```test```.
93
+
94
+ You define a ```lane``` like this (more details about the commands in the [Actions](#actions) section):
95
+ ```ruby
96
+ lane :appstore do
97
+ increment_build_number
98
+ cocoapods
99
+ xctool
100
+ snapshot
101
+ sigh
102
+ deliver
103
+ frameit
104
+ sh "./customScript.sh"
105
+
106
+ slack
107
+ end
108
+ ```
109
+
110
+ To launch the ```appstore``` lane run
111
+ ```
112
+ fastlane appstore
113
+ ```
114
+
115
+ When one command fails, the execution will be aborted.
116
+
117
+
118
+ ### Actions
119
+ There are some predefined actions you can use. If you have ideas for more, please let me know.
120
+
121
+ #### [CocoaPods](http://cocoapods.org)
122
+ Everyone using [CocoaPods](http://cocoapods.org) will probably want to run a ```pod install``` before running tests and building the app.
123
+ ```ruby
124
+ cocoapods # this will run pod install
125
+ ```
126
+
127
+
128
+ #### [xctool](https://github.com/facebook/xctool)
129
+ You can run any xctool action. This will require having [xctool](https://github.com/facebook/xctool) installed throw [homebrew](http://brew.sh/).
130
+ ```ruby
131
+ xctool :test
132
+ ```
133
+
134
+ It is recommended to have the `xctool` configuration stored in a [`xctool-args`](https://github.com/facebook/xctool#configuration-xctool-args) file.
135
+
136
+ #### [snapshot](https://github.com/KrauseFx/snapshot)
137
+ ```ruby
138
+ snapshot
139
+ ```
140
+
141
+ To make `snapshot` work without user interaction, follow the [CI-Guide of `snapshot`](https://github.com/KrauseFx/snapshot#run-in-continuous-integration).
142
+
143
+ #### [sigh](https://github.com/KrauseFx/sigh)
144
+ This will generate and download your App Store provisioning profile. ```sigh``` will store the generated profile in the ```./fastlane``` folder.
145
+ ```ruby
146
+ sigh
147
+ ```
148
+
149
+ To use the Ad Hoc profile instead
150
+ ```ruby
151
+ sigh :adhoc
152
+ ```
153
+
154
+ #### [deliver](https://github.com/KrauseFx/deliver)
155
+ ```ruby
156
+ deliver
157
+ ```
158
+
159
+ If you don't want a PDF report, which you have to approve first, append ```:force``` to the command. This is useful when running ```fastlane``` on your Continuous Integration server.
160
+ ```ruby
161
+ deliver :force
162
+ ```
163
+
164
+ - ```deliver :beta```: Upload a beta build for Apple TestFlight
165
+ - ```deliver :skip_deploy```: To don't submit the app for review (works with both App Store and beta builds)
166
+ - ```deliver :force, :skip_deploy```: Combine options using ```,```
167
+
168
+ #### [frameit](https://github.com/KrauseFx/frameit)
169
+ By default, the device color will be black
170
+ ```ruby
171
+ frameit
172
+ ```
173
+
174
+ To use white (sorry, silver) device frames
175
+ ```ruby
176
+ frameit :silver
177
+ ```
178
+
179
+ #### [increment_build_number](https://developer.apple.com/library/ios/qa/qa1827/_index.html)
180
+ This method will increment the **build number**, not the app version. Usually this is just an auto incremented number. You first have to [set up your Xcode project](https://developer.apple.com/library/ios/qa/qa1827/_index.html), if you haven't done it already.
181
+
182
+ ```ruby
183
+ increment_build_number # automatically increment by one
184
+ increment_build_number '75' # set a specific number
185
+ ```
186
+
187
+ #### [HockeyApp](http://hockeyapp.net)
188
+ ```ruby
189
+ hockey({
190
+ api_token: '...',
191
+ ipa: './app.ipa',
192
+ notes: "Changelog"
193
+ })
194
+ ```
195
+ More information about the available options can be found in the [HockeyApp Docs](http://support.hockeyapp.net/kb/api/api-versions#upload-version).
196
+
197
+ #### [Testmunk](http://testmunk.com)
198
+ Run your functional tests on real iOS devices over the cloud (for free on an iPod). With this simple [testcase](https://github.com/testmunk/TMSample/blob/master/testcases/smoke/smoke_features.zip) you can ensure your app launches and there is no crash at launch. Tests can be extended with [Testmunk's library](http://docs.testmunk.com/en/latest/steps.html) or custom steps. More details about this action can be found in [`testmunk.rb`](https://github.com/KrauseFx/fastlane/blob/master/lib/fastlane/actions/testmunk.rb).
199
+ ```ruby
200
+ ENV['TESTMUNK_EMAIL'] = 'email@email.com'
201
+ # Additionally, you have to set TESTMUNK_API, TESTMUNK_APP and TESTMUNK_IPA
202
+ testmunk
203
+ ```
204
+
205
+ #### Custom Shell Scripts
206
+ ```ruby
207
+ sh "./your_bash_script.sh
208
+ ```
209
+
210
+ ### *before_all* block
211
+ This block will get executed *before* running the requested lane. It supports the same actions as lanes.
212
+
213
+ ```ruby
214
+ before_all do
215
+ cocoapods
216
+ end
217
+ ```
218
+
219
+ ### *after_all* block
220
+ This block will get executed *after* running the requested lane. It supports the same actions as lanes.
221
+
222
+ It will only be called, if the selected lane was executed **successfully**.
223
+
224
+ ```ruby
225
+ after_all do |lane|
226
+ say "Successfully finished deployment (#{lane})!"
227
+ slack({
228
+ message: "Successfully submitted new App Update"
229
+ })
230
+ sh "./send_screenshots_to_team.sh" # Example
231
+ end
232
+ ```
233
+
234
+ ### *error* block
235
+ This block will get executed when an error occurs, in any of the blocks (*before_all*, the lane itself or *after_all*).
236
+ ```ruby
237
+ error do |lane, exception|
238
+ slack({
239
+ message: "Successfully deployed new App Update for [AppName](http://link.com).",
240
+ success: false,
241
+ channel: 'development'
242
+ })
243
+ end
244
+ ```
245
+
246
+ # Extensions
247
+ Why only use the default actions? Create your own to extend the functionality of `fastlane`.
248
+
249
+ Just run `fastlane new_action`. Then enter the name of the action and edit the generated Ruby file in `fastlane/actions/[action_name].rb`.
250
+
251
+ From then on, you can just start using your action in your `Fastfile`.
252
+
253
+ If you think your extension can be used by other developers as well, let me know, and we can bundle it with `fastlane`.
254
+
255
+ # Jenkins Integration
256
+
257
+ `fastlane` automatically generates a JUnit report for you. This allows Continuous Integration systems, like `Jenkins`, access the results of your deployment.
258
+
259
+ ## Installation
260
+ The recommended way to install [Jenkins](http://jenkins-ci.org/) is through [homebrew](http://brew.sh/):
261
+
262
+ ```brew update && brew install jenkins```
263
+
264
+ From now on start ```Jenkins``` by running:
265
+ ```
266
+ jenkins
267
+ ```
268
+
269
+ To store the password in the Keychain of your remote machine, I recommend running `sigh` or `deliver` using ssh or remote desktop at least once.
270
+
271
+ If you're using `Jenkins` as its own user, you might run into problems with `homebrew` and `phantomjs`.
272
+
273
+ ## Deploy Strategy
274
+
275
+ You should **not** deploy a new App Store update after every commit, since you still have to wait 1-2 weeks for the review. Instead I recommend using Git Tags, or custom triggers to deploy a new update.
276
+
277
+ You can set up your own ```Release``` job, which is only triggered manually.
278
+
279
+ ## Plugins
280
+
281
+ I recommend the following plugins:
282
+
283
+ - **[HTML Publisher Plugin](https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin):** Can be used to show the generated screenshots right inside Jenkins.
284
+ - **[AnsiColor Plugin](https://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin):** Used to show the coloured output of the fastlane tools. Dont' forget to enable `Color ANSI Console Output` in the `Build Environment` or your project.
285
+ - **[Rebuild Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Rebuild+Plugin):** This plugin will save you a lot of time.
286
+
287
+ ## Build Step
288
+ Use the following as your build step:
289
+ ```
290
+ fastlane appstore --trace
291
+ ```
292
+ Replace `appstore` with the lane you want to use. I recommend appending the `--trace` to make debugging easier in case something goes wrong.
293
+
294
+ ## Test Results and Screenshtos
295
+
296
+ To show the **deployment result** right in `Jenkins`
297
+
298
+ - *Add post-build action*
299
+ - *Publish JUnit test result report*
300
+ - *Test report XMLs*: `fastlane/report.xml`
301
+
302
+ To show the **generated screenhots** right in `Jenkins`
303
+
304
+ - *Add post-build action*
305
+ - *Publish HTML reports*
306
+ - *HTML directory to archive*: `fastlane/screenshots`
307
+ - *Index page*: `screenshots.html`
308
+
309
+ Save and run. The result should look like this:
310
+
311
+ ![JenkinsIntegration](assets/JenkinsIntegration.png)
312
+
313
+ # Tips
314
+
315
+ ## [`fastlane`](http://fastlane.tools) Toolchain
316
+
317
+ - [`deliver`](https://github.com/KrauseFx/deliver): Upload screenshots, metadata and your app to the App Store using a single command
318
+ - [`snapshot`](https://github.com/KrauseFx/snapshot): Automate taking localized screenshots of your iOS app on every device
319
+ - [`frameit`](https://github.com/KrauseFx/frameit): Quickly put your screenshots into the right device frames
320
+ - [`PEM`](https://github.com/KrauseFx/pem): Automatically generate and renew your push notification profiles
321
+ - [`sigh`](https://github.com/KrauseFx/sigh): Because you would rather spend your time building stuff than fighting provisioning
322
+
323
+ ## Advanced
324
+ #### Lane Context
325
+ The different actions can *communicate* with each other using a shared hash.
326
+ Access them in your scrips using:
327
+ ```ruby
328
+ Actions.lane_context[Actions::SharedValues::LANE_NAME] # the name of the current lane
329
+ ```
330
+ Available variables (put that inside the square brackets of the above snippet)
331
+ ```ruby
332
+ Actions::SharedValues::BUILD_NUMBER # generated by `increment_build_number`
333
+ Actions::SharedValues::SNAPSHOT_SCREENSHOTS_PATH # generated by `snapshot`
334
+ Actions::SharedValues::DELIVER_IPA_PATH
335
+ Actions::SharedValues::SIGH_PROFILE_PATH # generated by `sigh`
336
+ Actions::SharedValues::HOCKEY_DOWNLOAD_LINK #generated by `hockey`
337
+ ````
338
+
339
+ #### Complex Fastfile Example
340
+ ```ruby
341
+ before_all do
342
+ ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
343
+
344
+ increment_build_number
345
+ cocoapods
346
+ xctool :test
347
+ end
348
+
349
+ lane :beta do
350
+ sigh :adhoc
351
+ deliver :beta
352
+ hockey({
353
+ api_token: '...',
354
+ ipa: './app.ipa'
355
+ })
356
+ end
357
+
358
+ lane :deploy do
359
+ sigh
360
+ snapshot
361
+ deliver :force
362
+ frameit
363
+ end
364
+
365
+ after_all do |lane|
366
+ slack({
367
+ message: "Successfully deployed a new version."
368
+ })
369
+ say "My job is done here"
370
+ end
371
+
372
+ error do |lane, exception|
373
+ slack({
374
+ message: "An error occured"
375
+ })
376
+ end
377
+ ```
378
+
379
+ #### Snapshot
380
+ To skip cleaning the project on every build
381
+ ```ruby
382
+ snapshot :noclean
383
+ ```
384
+
385
+ #### Run multiple ```lanes```
386
+ You can run multiple ```lanes``` (in the given order) using
387
+ ```
388
+ fastlane test inhouse appstore
389
+ ````
390
+ Keep in mind the ```before_all``` and ```after_all``` block will be executed for each of the ```lanes```.
391
+
392
+ #### Hide the `fastlane` folder
393
+ Just rename the folder to `.fastlane` in case you don't want it to be visible in the Finder.
394
+
395
+ #### Load own actions from external folder
396
+ Add this to the top of your `Fastfile` (*.* is the `fastlane` folder)
397
+ ```ruby
398
+ actions_path '../custom_actions_folder/'
399
+ ```
400
+
401
+ # Credentials
402
+ A detailed description about your credentials is available on a [seperate repo](https://github.com/KrauseFx/CredentialsManager).
403
+
404
+ # Need help?
405
+ - If there is a technical problem with ```fastlane```, submit an issue. Run ```fastlane --trace``` to get the stack trace.
406
+ - I'm available for contract work - drop me an email: fastlane@krausefx.com
407
+
408
+ # License
409
+ This project is licensed under the terms of the MIT license. See the LICENSE file.
410
+
411
+ # Contributing
412
+
413
+ 1. Create an issue to discuss about your idea
414
+ 2. Fork it (https://github.com/KrauseFx/fastlane/fork)
415
+ 3. Create your feature branch (`git checkout -b my-new-feature`)
416
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
417
+ 5. Push to the branch (`git push origin my-new-feature`)
418
+ 6. Create a new Pull Request