fastlane 0.5.0 → 0.6.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: 5c747e9fa3dff44e9bd4762c4281f9cee8408b07
4
- data.tar.gz: 5fcec7383048bacd0bd15513b84bd181240e1de0
3
+ metadata.gz: 4d8910e532a67b987821ae0fc4377d392ee57a77
4
+ data.tar.gz: dbdd4c7e2c6506b126f61d52fd6c48fab273b47a
5
5
  SHA512:
6
- metadata.gz: 4db176d2e311a47c93084a8a6d290c9e9743581461153738ba5f582a8719364a5df73b050a97d00c891d050060d775eb15499dea4634c9cf1853488865a43153
7
- data.tar.gz: 4601459d9f086f2cfc811646c28dd73b9fcb9f683a850af6ab5d26b1096523a05c580c815eabe891f19d59617430d7b42f24b3e7489cce2a813f23bf585ae90c
6
+ metadata.gz: 2ba044f018a24f4c2a6187d2ffdff140a4ad0038b38056bbdcc665a6524385b7c2b8f3f898192052b7df894db72966dfc0f4b9275319e0bb04f8c5d3beb13f59
7
+ data.tar.gz: 3b9c5ac88b2e6829bd54e2ed0064b611e16ac407151d31476a1698c9d65c4f90cc39a312c8a66c6de1c230f391616125fdf547d676d4004c1295c0c7b6851520
data/README.md CHANGED
@@ -23,7 +23,6 @@ fastlane
23
23
 
24
24
  ######*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).
25
25
 
26
-
27
26
  Get in contact with the developer on Twitter: [@KrauseFx](https://twitter.com/KrauseFx)
28
27
 
29
28
  -------
@@ -31,88 +30,23 @@ Get in contact with the developer on Twitter: [@KrauseFx](https://twitter.com/Kr
31
30
  <a href="#features">Features</a> &bull;
32
31
  <a href="#installation">Installation</a> &bull;
33
32
  <a href="#quick-start">Quick Start</a> &bull;
34
- <a href="#customise-the-fastfile">Customise</a> &bull;
35
- <a href="#extensions">Extensions</a> &bull;
36
- <a href="#jenkins-integration">Jenkins</a> &bull;
37
- <a href="#tips">Tips</a> &bull;
38
33
  <a href="#need-help">Need help?</a>
39
34
  </p>
40
35
 
41
36
  -------
42
37
 
43
- # Features
44
- - Connect all tools, part of the ```fastlane``` toolchain to work seamlessly together
45
- - Define different ```deployment lanes``` for App Store deployment, beta builds or testing
46
- - Deploy from any computer
47
- - [Jenkins Integration](#jenkins-integration): Show the output directly in the Jenkins test results
48
- - Write your [own actions](#extensions) (extensions) to extend the functionality of `fastlane`
49
- - Store data like the ```Bundle Identifier``` or your ```Apple ID``` once and use it across all tools
50
- - Never remember any difficult commands, just ```fastlane```
51
- - Easy setup, which helps you getting up and running very fast
52
- - [Shared context](https://github.com/KrauseFx/fastlane/blob/master/Advanced.md#lane-context), which is used to let the different deployment steps communicate with each other
53
- - Store **everything** in git. Never lookup the used build commands in the ```Jenkins``` configs
54
- - Saves you **hours** of preparing app submission, uploading screenshots and deploying the app for each update
55
- - Very flexible configuration using a fully customizable `Fastfile`
56
- - Once up and running, you have a fully working **Continuous Deployment** process. Just trigger ```fastlane``` and you're good to go.
57
- - Over 30 built-in integrations available
58
-
59
- ##### Take a look at the [fastlane website](https://fastlane.tools) for more information about why and when to use `fastlane`.
60
-
61
- ##### [Like this tool? Be the first to know about updates and new fastlane tools](https://tinyletter.com/krausefx)
62
-
63
- # Special Thanks
64
-
65
- Thanks to all sponsors and contributors for extending and improving the `fastlane` suite:
66
- - [Detroit Labs](http://www.detroitlabs.com/)
67
- - Josh Holtz ([@joshdholtz](https://twitter.com/joshdholtz))
68
- - Dan Trenz ([@dtrenz](https://twitter.com/dtrenz))
69
- - Luka Mirosevic ([@lmirosevic](https://twitter.com/lmirosevic))
70
- - Almas Sapargali ([@almassapargali](https://twitter.com/almassapargali))
71
- - Manuel Wallner ([@milch](https://github.com/milch))
72
- - Pawel Dudek ([@eldudi](https://twitter.com/eldudi))
73
-
74
- Check out the project pages of the other tools for more sponsors and contributors.
75
-
76
- # Installation
77
-
78
- I recommend following the [fastlane guide](https://github.com/KrauseFx/fastlane/blob/master/GUIDE.md) to get started.
79
-
80
- If you are familiar with the command line and Ruby, install `fastlane` yourself:
81
-
82
- sudo gem install fastlane
83
-
84
- Make sure, you have the latest version of the Xcode command line tools installed:
85
-
86
- xcode-select --install
87
-
88
-
89
- 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.
90
-
91
- # Quick Start
92
-
38
+ ## Features
93
39
 
94
- The setup assistant will create all the necessary files for you, using the existing app metadata from iTunes Connect.
95
-
96
- - ```cd [your_project_folder]```
97
- - ```fastlane init```
98
- - Follow the setup assistant, which will set up ```fastlane``` for you
99
- - Further customise the ```Fastfile``` using the next section
100
-
101
- For a more detailed setup, please follow the [fastlane guide](https://github.com/KrauseFx/fastlane/blob/master/GUIDE.md).
102
-
103
- # Customise the ```Fastfile```
104
40
  Why should you have to remember complicated commands and parameters?
105
41
 
106
- Store your configuration in a text file to easily deploy from any computer.
107
-
108
- Open the ```Fastfile``` using a text editor and customise it even further. (Switch to *Ruby* Syntax Highlighting)
42
+ Store your configuration in a text file to easily test, builld, and deploy from _any_ computer.
109
43
 
110
- ### Lanes
111
- You can define multiple ```lanes``` which are different workflows for a release process.
44
+ Just edit the ```Fastfile``` to define multiple ```lanes```, or different workflows.
112
45
 
113
46
  Examples are: ```appstore```, ```beta``` and ```test```.
114
47
 
115
- You define a ```lane``` like this (more details about the commands in the [Actions](#actions) section):
48
+ You define a ```lane``` like this (more details about the commands in the [Actions](https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md) documentation):
49
+
116
50
  ```ruby
117
51
  lane :appstore do
118
52
  increment_build_number
@@ -128,123 +62,62 @@ lane :appstore do
128
62
  end
129
63
  ```
130
64
 
131
- To launch the ```appstore``` lane run
132
- ```
65
+ To launch the ```appstore``` lane, just run:
66
+
67
+ ```sh
133
68
  fastlane appstore
134
69
  ```
135
70
 
136
- When one command fails, the execution will be aborted.
137
-
138
- ## Available fastlane actions
139
-
140
- ### Project
141
- - [CocoaPods](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#cocoapods): Setup your CocoaPods project
142
- - [Carthage](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#carthage): Setup your Carthage project
143
- - [increment_build_number](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#increment_build_number): Increment the Xcode build number before building the app
144
- - - [increment_build_number](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#increment_version_number): Increment the Xcode version number before building the app
145
-
146
- ### Testing
147
- - [snapshot](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#snapshot): Automate taking localized screenshots of your iOS app on every device
148
- - [xctest](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#xcodebuild): Use the built in testing in combination with `xcodebuild`
149
- - [xctool](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#xctool): Run tests of your app
150
- - [Testmunk](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#testmunk): Run integration tests on real devices
151
- - [gcovr](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#gcovr): Generate summarized code coverage reports
152
-
153
- ### Certificates
154
- - [cert](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#cert): Automatically create and maintain iOS code signing certificates
155
- - [sigh](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#sigh): Create and maintain your provisioning profiles
156
- - [resign](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#resign): Re-Sign an existing ipa file
157
- - [register_devices](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#register_devices): Register iOS device identifiers
158
-
159
- ### Building
160
- - [ipa](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#ipa): Build your app for further use of the [uploading](#uploading) section
161
- - [xcode_select](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#xcode_select): Set a path to a custom Xcode installation
162
- - [xcodebuild](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#xcodebuild): Archive, build, clean, test or export your app.
163
-
164
- ### Uploading
165
- - [deliver](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#deliver): Upload screenshots, metadata and your app to the App Store
166
- - [HockeyApp](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#hockeyapp): Upload beta builds to Hockey App
167
- - [Crashlytics Beta](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#crashlytics-beta): Upload beta builds to Crashlytics Beta
168
- - [DeployGate](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#deploygate): Upload beta builds to DeployGate
169
-
170
- ### Git
171
- - [ensure_git_status_clean](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#ensure_git_status_clean): Makes sure, the git repository is in a clean state
172
- - [commit_version_bump](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#commit_version_bump): Automatically commit the version bump of your project
173
- - [add_git_tag](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#add_git_tag): Automatically add a git tag
174
- - [push_to_git_remote](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#push_to_git_remote): Push local commits to a git remote
175
- - [reset_git_repo](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#reset_git_repo): Reset the git repository after the `fastlane` run
176
-
177
- ### Notifications
178
-
179
- Send success and error messages:
180
-
181
- - [Slack](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#slack)
182
- - [HipChat](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#hipchat)
183
- - [Typetalk](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#typetalk)
184
- - [Notify](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#notify)
185
-
186
- ### Misc
187
- - [frameit](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#frameit): Put your screenshots into the right device frames
188
- - [produce](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#produce): Create new iOS apps on iTunes Connect and Developer Portal
189
- - [clean_build_artifacts](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#clean_build_artifacts): Cleans up temporary files created by `sigh` and the other tools
190
- - [team_id](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#team_id): Select a team ID for the Apple Developer Portal if you are in multiple teams
191
-
192
-
193
- ### *before_all* block
194
- This block will get executed *before* running the requested lane. It supports the same actions as lanes.
195
-
196
- ```ruby
197
- before_all do |lane|
198
- cocoapods
199
- end
200
- ```
71
+ Fastlane can do a lot for you to automate tedious and time-consuming parts of your job.
72
+
73
+ - Connect all tools, part of the ```fastlane``` toolchain to work seamlessly together.
74
+ - Define different ```deployment lanes``` for App Store deployment, beta builds or testing.
75
+ - Deploy from any computer.
76
+ - [Jenkins Integration](https://github.com/KrauseFx/fastlane/blob/master/docs/Jenkins.md): Show the output directly in the Jenkins test results.
77
+ - Write your [own actions](https://github.com/KrauseFx/fastlane/blob/master/docs#extensions) (extensions) to extend the functionality of `fastlane`.
78
+ - Store data like the ```Bundle Identifier``` or your ```Apple ID``` once and use it across all tools.
79
+ - Never remember any difficult commands, just ```fastlane```.
80
+ - Easy setup, which helps you getting up and running very fast.
81
+ - [Shared context](https://github.com/KrauseFx/fastlane/blob/master/docs/Advanced.md#lane-context), which is used to let the different deployment steps communicate with each other.
82
+ - Store **everything** in git. Never lookup the used build commands in the ```Jenkins``` configs.
83
+ - Saves you **hours** of preparing app submission, uploading screenshots and deploying the app for each update.
84
+ - Very flexible configuration using a fully customizable `Fastfile`.
85
+ - Once up and running, you have a fully working **Continuous Deployment** process. Just trigger ```fastlane``` and you're good to go.
86
+ - Over 30 built-in integrations available.
201
87
 
202
- ### *after_all* block
203
- This block will get executed *after* running the requested lane. It supports the same actions as lanes.
88
+ ##### Take a look at the [fastlane website](https://fastlane.tools) for more information about why and when to use `fastlane`.
204
89
 
205
- It will only be called, if the selected lane was executed **successfully**.
90
+ ##### Like this tool? [Be the first to know about updates and new fastlane tools](https://tinyletter.com/krausefx).
206
91
 
207
- ```ruby
208
- after_all do |lane|
209
- say "Successfully finished deployment (#{lane})!"
210
- slack({
211
- message: "Successfully submitted new App Update"
212
- })
213
- sh "./send_screenshots_to_team.sh" # Example
214
- end
215
- ```
92
+ ## Installation
216
93
 
217
- ### *error* block
218
- This block will get executed when an error occurs, in any of the blocks (*before_all*, the lane itself or *after_all*).
219
- ```ruby
220
- error do |lane, exception|
221
- slack({
222
- message: "Something went wrong with the deployment.",
223
- success: false
224
- })
225
- end
226
- ```
94
+ I recommend following the [fastlane guide](https://github.com/KrauseFx/fastlane/blob/master/docs/Guide.md) to get started.
227
95
 
228
- # Extensions
96
+ If you are familiar with the command line and Ruby, install `fastlane` yourself:
229
97
 
230
- Why only use the default actions? Create your own to extend the functionality of `fastlane`.
98
+ sudo gem install fastlane
231
99
 
232
- The build step you create will behave exactly like the built in actions.
100
+ Make sure, you have the latest version of the Xcode command line tools installed:
233
101
 
234
- Just run `fastlane new_action`. Then enter the name of the action and edit the generated Ruby file in `fastlane/actions/[action_name].rb`.
102
+ xcode-select --install
235
103
 
236
- From then on, you can just start using your action in your `Fastfile`.
104
+ 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), or [Eidolon by Artsy](https://github.com/artsy/eidolon).
237
105
 
238
- If you think your extension can be used by other developers as well, let me know, and we can bundle it with `fastlane`.
106
+ ## Quick Start
239
107
 
240
- # Jenkins Integration
108
+ The setup assistant will create all the necessary files for you, using the existing app metadata from iTunes Connect.
241
109
 
242
- The `Jenkins` setup was moved to [Jenkins.md](https://github.com/KrauseFx/fastlane/blob/master/Jenkins.md).
110
+ - ```cd [your_project_folder]```
111
+ - ```fastlane init```
112
+ - Follow the setup assistant, which will set up ```fastlane``` for you
113
+ - Further customise the ```Fastfile``` with [actions](https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md).
243
114
 
244
- # Tips
115
+ For more details, please follow the [fastlane guide](https://github.com/KrauseFx/fastlane/blob/master/docs/Guide.md) or [documentation](https://github.com/KrauseFx/fastlane/blob/master/docs).
245
116
 
246
117
  ## [`fastlane`](https://fastlane.tools) Toolchain
247
118
 
119
+ `fastlane` is designed to make your life easier by bringing together the `fastlane` suite of tools under one roof.
120
+
248
121
  - [`deliver`](https://github.com/KrauseFx/deliver): Upload screenshots, metadata and your app to the App Store using a single command
249
122
  - [`snapshot`](https://github.com/KrauseFx/snapshot): Automate taking localized screenshots of your iOS app on every device
250
123
  - [`frameit`](https://github.com/KrauseFx/frameit): Quickly put your screenshots into the right device frames
@@ -254,97 +127,26 @@ The `Jenkins` setup was moved to [Jenkins.md](https://github.com/KrauseFx/fastla
254
127
  - [`cert`](https://github.com/KrauseFx/cert): Automatically create and maintain iOS code signing certificates
255
128
  - [`codes`](https://github.com/KrauseFx/codes): Create promo codes for iOS Apps using the command line
256
129
 
257
- ##### [Like this tool? Be the first to know about updates and new fastlane tools](https://tinyletter.com/krausefx)
258
-
259
- ## Advanced
260
-
261
- #### Complex Fastfile Example
262
- ```ruby
263
- fastlane_version "0.4.1"
264
-
265
- before_all do |lane|
266
- ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
267
- team_id "Q2CBPK58CA"
268
-
269
- ensure_git_status_clean
270
-
271
- increment_build_number
272
-
273
- cocoapods
274
-
275
- xctool :test
276
- end
277
-
278
- lane :test do
279
- snapshot
280
- end
281
-
282
- lane :beta do
283
- cert
284
- sigh :adhoc
285
-
286
- ipa
287
-
288
- deliver :beta
130
+ ## Credentials
131
+ A detailed description about how ```fastlane``` stores your credentials is available on a [separate repo](https://github.com/KrauseFx/CredentialsManager).
289
132
 
290
- hockey({
291
- api_token: '...',
292
- ipa: './app.ipa' # optional
293
- })
294
- end
295
-
296
- lane :deploy do
297
- cert
298
- sigh
299
- ipa
300
-
301
- snapshot
302
-
303
- deliver :force
304
-
305
- frameit
306
- end
307
-
308
- after_all do |lane|
309
- clean_build_artifacts
310
-
311
- commit_version_bump
312
-
313
- add_git_tag
314
-
315
- slack({
316
- message: "Successfully deployed a new version."
317
- })
318
- say "My job is done here"
319
- end
320
-
321
- error do |lane, exception|
322
- reset_git_repo
323
-
324
- slack({
325
- message: "An error occured",
326
- success: false
327
- })
328
- end
329
- ```
133
+ ## Need help?
134
+ - If there is a technical problem with ```fastlane```, [open an issue](https://github.com/KrauseFx/fastlane/issues/new).
135
+ - I'm available for contract work - drop me an email: fastlane@krausefx.com
330
136
 
331
- ##### More advanced settings and tips can be found in [Advanced.md](https://github.com/KrauseFx/fastlane/blob/master/Advanced.md)
137
+ ## Special Thanks
332
138
 
333
- # Credentials
334
- A detailed description about your credentials is available on a [separate repo](https://github.com/KrauseFx/CredentialsManager).
139
+ Thanks to all sponsors and contributors for extending and improving the `fastlane` suite:
140
+ - [Detroit Labs](http://www.detroitlabs.com/)
141
+ - Josh Holtz ([@joshdholtz](https://twitter.com/joshdholtz))
142
+ - Ash Furrow ([@ashfurrow](https://twitter.com/ashfurrow))
143
+ - Dan Trenz ([@dtrenz](https://twitter.com/dtrenz))
144
+ - Luka Mirosevic ([@lmirosevic](https://twitter.com/lmirosevic))
145
+ - Almas Sapargali ([@almassapargali](https://twitter.com/almassapargali))
146
+ - Manuel Wallner ([@milch](https://github.com/milch))
147
+ - Pawel Dudek ([@eldudi](https://twitter.com/eldudi))
335
148
 
336
- # Need help?
337
- - If there is a technical problem with ```fastlane```, submit an issue.
338
- - I'm available for contract work - drop me an email: fastlane@krausefx.com
149
+ Check out the project pages of the other tools for more sponsors and contributors.
339
150
 
340
- # License
151
+ ## License
341
152
  This project is licensed under the terms of the MIT license. See the LICENSE file.
342
-
343
- # Contributing
344
-
345
- 1. Create an issue to discuss about your idea
346
- 2. Fork it (https://github.com/KrauseFx/fastlane/fork)
347
- 3. Create your feature branch (`git checkout -b my-new-feature`)
348
- 4. Commit your changes (`git commit -am 'Add some feature'`)
349
- 5. Push to the branch (`git push origin my-new-feature`)
350
- 6. Create a new Pull Request
@@ -77,6 +77,14 @@ module Fastlane
77
77
  result
78
78
  end
79
79
 
80
+ # Returns the current git branch - can be replaced using the environment variable `GIT_BRANCH`
81
+ def self.git_branch
82
+ return ENV['GIT_BRANCH'] if ENV['GIT_BRANCH'].to_s.length > 0 # set by Jenkins
83
+ s = `git rev-parse --abbrev-ref HEAD`
84
+ return s.to_s.strip if s.to_s.length > 0
85
+ nil
86
+ end
87
+
80
88
  def self.load_default_actions
81
89
  Dir[File.expand_path '*.rb', File.dirname(__FILE__)].each do |file|
82
90
  require file
@@ -5,15 +5,17 @@ module Fastlane
5
5
  def self.run(params)
6
6
  params = params.first
7
7
 
8
+ specified_tag = (params && params[:tag])
8
9
  grouping = (params && params[:grouping]) || 'builds'
9
10
  prefix = (params && params[:prefix]) || ''
10
11
  build_number = (params && params[:build_number]) || Actions.lane_context[Actions::SharedValues::BUILD_NUMBER]
11
12
 
12
13
  lane_name = Actions.lane_context[Actions::SharedValues::LANE_NAME]
13
14
 
14
- Actions.sh("git tag #{grouping}/#{lane_name}/#{prefix}#{build_number}")
15
+ tag = specified_tag || "#{grouping}/#{lane_name}/#{prefix}#{build_number}"
15
16
 
16
- Helper.log.info 'Added git tag 🎯.'
17
+ Helper.log.info 'Adding git tag "#{tag}" 🎯.'
18
+ Actions.sh("git tag #{tag}")
17
19
  end
18
20
  end
19
21
  end
@@ -59,7 +59,11 @@ module Fastlane
59
59
 
60
60
  # check if the files changed are the ones we expected to change (these should be only the files that have version info in them)
61
61
  changed_files_as_expected = (Set.new(git_dirty_files) == Set.new(expected_changed_files))
62
- raise "Found unexpected uncommited changes in the working directory. Expected these files to have changed: #{expected_changed_files}. But found these actual changes: #{git_dirty_files}. Make sure you have cleaned up the build artifacts and are only left with the changed version files at this stage in your lane, and don't touch the working directory while your lane is running.".red unless changed_files_as_expected
62
+ unless changed_files_as_expected
63
+ unless params[:force]
64
+ raise "Found unexpected uncommited changes in the working directory. Expected these files to have changed: #{expected_changed_files}. But found these actual changes: #{git_dirty_files}. Make sure you have cleaned up the build artifacts and are only left with the changed version files at this stage in your lane, and don't touch the working directory while your lane is running. You can also use the :force to not care about this.".red
65
+ end
66
+ end
63
67
 
64
68
  # get the absolute paths to the files
65
69
  git_add_paths = expected_changed_files.map { |path| File.expand_path(File.join(repo_pathname, path)) }
@@ -97,8 +97,12 @@ module Fastlane
97
97
  params.collect do |k, v|
98
98
  v ||= ''
99
99
  if args = ARGS_MAP[k]
100
- value = (v.to_s.length > 0 ? "\"#{v}\"" : '')
101
- "#{ARGS_MAP[k]} #{value}".strip
100
+ if k == :clean
101
+ v == true ? '--clean' : '--no-clean'
102
+ else
103
+ value = (v.to_s.length > 0 ? "\"#{v}\"" : '')
104
+ "#{ARGS_MAP[k]} #{value}".strip
105
+ end
102
106
  end
103
107
  end.compact
104
108
  end
@@ -7,7 +7,7 @@ module Fastlane
7
7
 
8
8
  remote = (options && options[:remote]) || 'origin'
9
9
  force = (options && options[:force]) || false
10
- local_branch = (options && (options[:local_branch] || options[:branch])) || 'master'
10
+ local_branch = (options && (options[:local_branch] || options[:branch])) || Actions.git_branch || 'master'
11
11
  remote_branch = (options && options[:remote_branch]) || local_branch
12
12
 
13
13
  # construct our command as an array of components
@@ -3,10 +3,21 @@ module Fastlane
3
3
  # Does a hard reset and clean on the repo
4
4
  class ResetGitRepoAction
5
5
  def self.run(params)
6
- if params.include?(:force) || Actions.lane_context[SharedValues::GIT_REPO_WAS_CLEAN_ON_START]
7
- Actions.sh('git reset --hard HEAD')
8
- Actions.sh('git clean -qfdx')
9
- Helper.log.info 'Git repo was reset and cleaned back to a pristine state.'.green
6
+ hash = params.first
7
+ if params.include?(:force) || hash[:force] || Actions.lane_context[SharedValues::GIT_REPO_WAS_CLEAN_ON_START]
8
+ paths = hash[:files]
9
+
10
+ if (paths || []).count == 0
11
+ Actions.sh('git reset --hard HEAD')
12
+ Actions.sh('git clean -qfdx')
13
+ Helper.log.info 'Git repo was reset and cleaned back to a pristine state.'.green
14
+ else
15
+ paths.each do |path|
16
+ Helper.log.warn("Couldn't find file at path '#{path}'") unless File.exists?(path)
17
+ Actions.sh("git checkout -- '#{path}'")
18
+ end
19
+ Helper.log.info "Git cleaned up #{paths.count} files.".green
20
+ end
10
21
  else
11
22
  raise 'This is a destructive and potentially dangerous action. To protect from data loss, please add the `ensure_git_status_clean` action to the beginning of your lane, or if you\'re absolutely sure of what you\'re doing then call this action with the :force option.'.red
12
23
  end
@@ -4,13 +4,6 @@ module Fastlane
4
4
  end
5
5
 
6
6
  class SlackAction
7
- def self.git_branch
8
- return ENV['GIT_BRANCH'] if ENV['GIT_BRANCH'].to_s.length > 0 # set by Jenkins
9
- s = `git rev-parse --abbrev-ref HEAD`
10
- return s if s.to_s.length > 0
11
- nil
12
- end
13
-
14
7
  def self.git_author
15
8
  s = `git log --name-status HEAD^..HEAD`
16
9
  s = s.match(/Author:.*<(.*)>/)[1]
@@ -91,10 +84,10 @@ module Fastlane
91
84
  end
92
85
 
93
86
  # git branch
94
- if git_branch && should_add_payload[:git_branch]
87
+ if Actions.git_branch && should_add_payload[:git_branch]
95
88
  slack_attachment[:fields] << {
96
89
  title: 'Git Branch',
97
- value: git_branch,
90
+ value: Actions.git_branch,
98
91
  short: true
99
92
  }
100
93
  end
@@ -1,3 +1,3 @@
1
1
  module Fastlane
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-02 00:00:00.000000000 Z
11
+ date: 2015-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 1.6.5
19
+ version: '1.6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 1.6.5
26
+ version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: shenzhen
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 0.12.1
33
+ version: '0.12'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 0.12.1
40
+ version: '0.12'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: slack-notifier
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -114,48 +114,62 @@ dependencies:
114
114
  - - '>='
115
115
  - !ruby/object:Gem::Version
116
116
  version: 1.3.1
117
+ - !ruby/object:Gem::Dependency
118
+ name: terminal-notifier
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ~>
122
+ - !ruby/object:Gem::Version
123
+ version: 1.6.2
124
+ type: :runtime
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ~>
129
+ - !ruby/object:Gem::Version
130
+ version: 1.6.2
117
131
  - !ruby/object:Gem::Dependency
118
132
  name: fastlane_core
119
133
  requirement: !ruby/object:Gem::Requirement
120
134
  requirements:
121
135
  - - '>='
122
136
  - !ruby/object:Gem::Version
123
- version: 0.4.0
137
+ version: 0.4.3
124
138
  type: :runtime
125
139
  prerelease: false
126
140
  version_requirements: !ruby/object:Gem::Requirement
127
141
  requirements:
128
142
  - - '>='
129
143
  - !ruby/object:Gem::Version
130
- version: 0.4.0
144
+ version: 0.4.3
131
145
  - !ruby/object:Gem::Dependency
132
146
  name: deliver
133
147
  requirement: !ruby/object:Gem::Requirement
134
148
  requirements:
135
149
  - - '>='
136
150
  - !ruby/object:Gem::Version
137
- version: 0.7.13
151
+ version: 0.9.0
138
152
  type: :runtime
139
153
  prerelease: false
140
154
  version_requirements: !ruby/object:Gem::Requirement
141
155
  requirements:
142
156
  - - '>='
143
157
  - !ruby/object:Gem::Version
144
- version: 0.7.13
158
+ version: 0.9.0
145
159
  - !ruby/object:Gem::Dependency
146
160
  name: snapshot
147
161
  requirement: !ruby/object:Gem::Requirement
148
162
  requirements:
149
163
  - - '>='
150
164
  - !ruby/object:Gem::Version
151
- version: 0.4.0
165
+ version: 0.6.0
152
166
  type: :runtime
153
167
  prerelease: false
154
168
  version_requirements: !ruby/object:Gem::Requirement
155
169
  requirements:
156
170
  - - '>='
157
171
  - !ruby/object:Gem::Version
158
- version: 0.4.0
172
+ version: 0.6.0
159
173
  - !ruby/object:Gem::Dependency
160
174
  name: frameit
161
175
  requirement: !ruby/object:Gem::Requirement
@@ -190,14 +204,14 @@ dependencies:
190
204
  requirements:
191
205
  - - '>='
192
206
  - !ruby/object:Gem::Version
193
- version: 0.4.5
207
+ version: 0.4.7
194
208
  type: :runtime
195
209
  prerelease: false
196
210
  version_requirements: !ruby/object:Gem::Requirement
197
211
  requirements:
198
212
  - - '>='
199
213
  - !ruby/object:Gem::Version
200
- version: 0.4.5
214
+ version: 0.4.7
201
215
  - !ruby/object:Gem::Dependency
202
216
  name: produce
203
217
  requirement: !ruby/object:Gem::Requirement
@@ -226,20 +240,6 @@ dependencies:
226
240
  - - '>='
227
241
  - !ruby/object:Gem::Version
228
242
  version: 0.1.3
229
- - !ruby/object:Gem::Dependency
230
- name: terminal-notifier
231
- requirement: !ruby/object:Gem::Requirement
232
- requirements:
233
- - - ~>
234
- - !ruby/object:Gem::Version
235
- version: 1.6.2
236
- type: :runtime
237
- prerelease: false
238
- version_requirements: !ruby/object:Gem::Requirement
239
- requirements:
240
- - - ~>
241
- - !ruby/object:Gem::Version
242
- version: 1.6.2
243
243
  - !ruby/object:Gem::Dependency
244
244
  name: bundler
245
245
  requirement: !ruby/object:Gem::Requirement