fastlane 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -16
- data/lib/assets/mailgun_html_template.erb +142 -0
- data/lib/fastlane/actions/backup_file.rb +31 -0
- data/lib/fastlane/actions/frameit.rb +0 -1
- data/lib/fastlane/actions/hipchat.rb +10 -4
- data/lib/fastlane/actions/mailgun.rb +69 -30
- data/lib/fastlane/actions/pem.rb +0 -1
- data/lib/fastlane/actions/restore_file.rb +34 -0
- data/lib/fastlane/actions/s3.rb +15 -30
- data/lib/fastlane/actions/xcodebuild.rb +2 -0
- data/lib/fastlane/erb_template_helper.rb +20 -0
- data/lib/fastlane/version.rb +1 -1
- metadata +24 -7
- data/lib/fastlane/actions/hall.rb +0 -98
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a6348cd520e241c0337e726cae85210f734da84
|
4
|
+
data.tar.gz: 2f84fa7a0f395fb821e1e5ab0fdd93bb8cdf7248
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28f749779517ca85049ca5580333dfd9ac11ff65fe44de9b618135e2dc509901d96266063d0d54c0af6b72b48f414bad22f3ad17ae42fee7b5fcac472d59a9df
|
7
|
+
data.tar.gz: dfb4a8e145880c16c452a8732c956925910b2b8b6aad2ccc6264c1660e69e56904177d337ac68765f1591fa9bcd4eaef889c82bfc6cfe806931dece8502266af
|
data/README.md
CHANGED
@@ -44,9 +44,7 @@ Store your configuration in a text file to easily test, builld, and deploy from
|
|
44
44
|
|
45
45
|
[Take a look at how Wikipedia and Product Hunt use `fastlane`](https://github.com/fastlane/examples).
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
Examples are: `appstore`, `beta` and `test`.
|
47
|
+
Define different environments (`lanes`) in your `Fastfile`: Examples are: `appstore`, `beta` and `test`.
|
50
48
|
|
51
49
|
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):
|
52
50
|
|
@@ -65,28 +63,31 @@ lane :appstore do
|
|
65
63
|
end
|
66
64
|
```
|
67
65
|
|
68
|
-
To launch the
|
66
|
+
To launch the `appstore` lane, just run:
|
69
67
|
|
70
68
|
```sh
|
71
69
|
fastlane appstore
|
72
70
|
```
|
73
71
|
|
74
|
-
|
72
|
+
`fastlane` can do a lot for you to automate tedious and time-consuming tasks:
|
75
73
|
|
76
|
-
- Connect all tools
|
77
|
-
- Define different
|
74
|
+
- Connect all build related iOS tools into one workflow (both `fastlane` tools and third party tools)
|
75
|
+
- Define different `deployment lanes` for App Store deployment, beta builds or testing.
|
78
76
|
- Deploy from any computer.
|
79
|
-
- [Jenkins Integration](https://github.com/KrauseFx/fastlane/blob/master/docs/Jenkins.md): Show the output directly in the Jenkins test results.
|
80
77
|
- Write your [own actions](https://github.com/KrauseFx/fastlane/blob/master/docs#extensions) (extensions) to extend the functionality of `fastlane`.
|
81
|
-
- Store data like the
|
82
|
-
- Never remember any difficult commands, just
|
83
|
-
- Easy setup, which helps you getting up and running
|
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 quickly.
|
84
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.
|
85
|
-
- Store **everything** in git. Never lookup the used build commands in the ```Jenkins``` configs.
|
82
|
+
- Store **everything** in git. Never again lookup the used build commands in the ```Jenkins``` configs.
|
86
83
|
- Saves you **hours** of preparing app submission, uploading screenshots and deploying the app for each update.
|
87
84
|
- Very flexible configuration using a fully customizable `Fastfile`.
|
88
|
-
- Once up and running, you have a fully working **Continuous
|
89
|
-
-
|
85
|
+
- Once up and running, you have a fully working **Continuous Delivery** process. Just trigger ```fastlane``` and you're good to go.
|
86
|
+
- [Jenkins Integration](https://github.com/KrauseFx/fastlane/blob/master/docs/Jenkins.md): Show the output directly in the Jenkins test results.
|
87
|
+
- Automatically generate a markdown documentation of your lanes based on your `Fastfile`.
|
88
|
+
- Over 60 built-in integrations available.
|
89
|
+
- Support for both iOS and Mac OS apps
|
90
|
+
- Full git and mercurial support
|
90
91
|
|
91
92
|
##### Take a look at the [fastlane website](https://fastlane.tools) for more information about why and when to use `fastlane`.
|
92
93
|
|
@@ -96,8 +97,6 @@ Fastlane can do a lot for you to automate tedious and time-consuming parts of yo
|
|
96
97
|
|
97
98
|
I recommend following the [fastlane guide](https://github.com/KrauseFx/fastlane/blob/master/docs/Guide.md) to get started.
|
98
99
|
|
99
|
-
If you are familiar with the command line and Ruby, install `fastlane` yourself:
|
100
|
-
|
101
100
|
sudo gem install fastlane --verbose
|
102
101
|
|
103
102
|
Make sure, you have the latest version of the Xcode command line tools installed:
|
@@ -0,0 +1,142 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<meta name="viewport" content="width=device-width" />
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
7
|
+
<title>Fastlane Build</title>
|
8
|
+
|
9
|
+
|
10
|
+
<style type="text/css">
|
11
|
+
img {
|
12
|
+
max-width: 100%;
|
13
|
+
}
|
14
|
+
|
15
|
+
body {
|
16
|
+
-webkit-font-smoothing: antialiased;
|
17
|
+
-webkit-text-size-adjust: none;
|
18
|
+
width: 100% !important;
|
19
|
+
height: 100%;
|
20
|
+
line-height: 1.6em;
|
21
|
+
}
|
22
|
+
|
23
|
+
body {
|
24
|
+
background-color: #f6f6f6;
|
25
|
+
}
|
26
|
+
|
27
|
+
.error_bg {
|
28
|
+
background-color: #BF2235;
|
29
|
+
}
|
30
|
+
|
31
|
+
.success_bg {
|
32
|
+
background-color: #8FC74F;
|
33
|
+
}
|
34
|
+
|
35
|
+
@media only screen and (max-width: 640px) {
|
36
|
+
body {
|
37
|
+
padding: 0 !important;
|
38
|
+
}
|
39
|
+
h1 {
|
40
|
+
font-weight: 800 !important;
|
41
|
+
margin: 20px 0 5px !important;
|
42
|
+
}
|
43
|
+
h2 {
|
44
|
+
font-weight: 800 !important;
|
45
|
+
margin: 20px 0 5px !important;
|
46
|
+
}
|
47
|
+
h3 {
|
48
|
+
font-weight: 800 !important;
|
49
|
+
margin: 20px 0 5px !important;
|
50
|
+
}
|
51
|
+
h4 {
|
52
|
+
font-weight: 800 !important;
|
53
|
+
margin: 20px 0 5px !important;
|
54
|
+
}
|
55
|
+
h1 {
|
56
|
+
font-size: 22px !important;
|
57
|
+
}
|
58
|
+
h2 {
|
59
|
+
font-size: 18px !important;
|
60
|
+
}
|
61
|
+
h3 {
|
62
|
+
font-size: 16px !important;
|
63
|
+
}
|
64
|
+
.container {
|
65
|
+
padding: 0 !important;
|
66
|
+
width: 100% !important;
|
67
|
+
}
|
68
|
+
.content {
|
69
|
+
padding: 0 !important;
|
70
|
+
}
|
71
|
+
.content-wrap {
|
72
|
+
padding: 10px !important;
|
73
|
+
}
|
74
|
+
.invoice {
|
75
|
+
width: 100% !important;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
</style>
|
79
|
+
</head>
|
80
|
+
|
81
|
+
<body itemscope itemtype="http://schema.org/EmailMessage" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em; background-color: #f6f6f6; margin: 0;"
|
82
|
+
bgcolor="#f6f6f6">
|
83
|
+
|
84
|
+
<table class="body-wrap" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;" bgcolor="#f6f6f6">
|
85
|
+
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
86
|
+
<td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top"></td>
|
87
|
+
<td class="container" width="600" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;"
|
88
|
+
valign="top">
|
89
|
+
<div class="content" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
|
90
|
+
<table class="main" width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;"
|
91
|
+
bgcolor="#fff">
|
92
|
+
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
93
|
+
<td class="alert alert-warning" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 16px; vertical-align: top; color: #fff; font-weight: 500; background-color: <%= success ? '#68b90f' : '#d0021b'%>;text-align: center; border-radius: 3px 3px 0 0; margin: 0; padding: 20px;"
|
94
|
+
align="center" valign="top">
|
95
|
+
Fastlane Build
|
96
|
+
</td>
|
97
|
+
</tr>
|
98
|
+
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
99
|
+
<td class="content-wrap" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 20px;" valign="top">
|
100
|
+
<table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
101
|
+
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
102
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
|
103
|
+
<strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">Git Author:</strong>
|
104
|
+
<%= author %>
|
105
|
+
</td>
|
106
|
+
</tr>
|
107
|
+
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
108
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
|
109
|
+
<strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">Git Commit:</strong>
|
110
|
+
<%= last_commit %>
|
111
|
+
</td>
|
112
|
+
</tr>
|
113
|
+
<% if ci_build_link %>
|
114
|
+
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
115
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
|
116
|
+
<strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">CI build:</strong> <a href="<%= ci_build_link %>">Build</a>
|
117
|
+
</td>
|
118
|
+
</tr>
|
119
|
+
<% end %>
|
120
|
+
|
121
|
+
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
122
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
|
123
|
+
<%= message %>
|
124
|
+
</td>
|
125
|
+
</tr>
|
126
|
+
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
127
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
|
128
|
+
<a href="<%= app_link %>" class="btn-primary" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2em; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background-color: #348eda; margin: 0; border-color: #348eda; border-style: solid; border-width: 10px 20px;">Download Release</a>
|
129
|
+
</td>
|
130
|
+
</tr>
|
131
|
+
</table>
|
132
|
+
</td>
|
133
|
+
</tr>
|
134
|
+
</table>
|
135
|
+
</div>
|
136
|
+
</td>
|
137
|
+
<td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top"></td>
|
138
|
+
</tr>
|
139
|
+
</table>
|
140
|
+
</body>
|
141
|
+
|
142
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class BackupFileAction < Action
|
4
|
+
def self.run params
|
5
|
+
path = params[:path]
|
6
|
+
FileUtils.cp(path, "#{path}.back", {:preserve => true})
|
7
|
+
Helper.log.info "Successfully created a backup 💾"
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.description
|
11
|
+
'This action backs up your file to "[path].back"'
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.is_supported?(platform)
|
15
|
+
true
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.author
|
19
|
+
"gin0606"
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.available_options
|
23
|
+
[
|
24
|
+
FastlaneCore::ConfigItem.new(key: :path,
|
25
|
+
description: "Path to the file you want to backup",
|
26
|
+
optional: false),
|
27
|
+
]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -10,6 +10,7 @@ module Fastlane
|
|
10
10
|
|
11
11
|
api_token = options[:api_token]
|
12
12
|
api_version = options[:version]
|
13
|
+
api_host = options[:api_host]
|
13
14
|
|
14
15
|
channel = options[:channel]
|
15
16
|
color = (options[:success] ? 'green' : 'red')
|
@@ -22,7 +23,7 @@ module Fastlane
|
|
22
23
|
if user?(channel)
|
23
24
|
raise 'HipChat private message not working with API V1 please use API V2 instead'.red
|
24
25
|
else
|
25
|
-
uri = URI.parse(
|
26
|
+
uri = URI.parse("https://#{api_host}/v1/rooms/message")
|
26
27
|
response = Net::HTTP.post_form(uri, { 'from' => 'fastlane',
|
27
28
|
'auth_token' => api_token,
|
28
29
|
'color' => color,
|
@@ -40,14 +41,14 @@ module Fastlane
|
|
40
41
|
json_headers = { 'Content-Type' => 'application/json',
|
41
42
|
'Accept' => 'application/json', 'Authorization' => "Bearer #{api_token}" }
|
42
43
|
|
43
|
-
uri = URI.parse("https
|
44
|
+
uri = URI.parse("https://#{api_host}/v2/user/#{channel}/message")
|
44
45
|
http = Net::HTTP.new(uri.host, uri.port)
|
45
46
|
http.use_ssl = true
|
46
47
|
|
47
48
|
response = http.post(uri.path, params.to_json, json_headers)
|
48
49
|
check_response_code(response, channel)
|
49
50
|
else
|
50
|
-
uri = URI.parse("https
|
51
|
+
uri = URI.parse("https://#{api_host}/v2/room/#{channel}/notification")
|
51
52
|
response = Net::HTTP.post_form(uri, { 'from' => 'fastlane',
|
52
53
|
'auth_token' => api_token,
|
53
54
|
'color' => color,
|
@@ -112,7 +113,12 @@ module Fastlane
|
|
112
113
|
Helper.log.fatal "Please add 'ENV[\"HIPCHAT_API_VERSION\"] = \"1 or 2\"' to your Fastfile's `before_all` section.".red
|
113
114
|
raise 'No HIPCHAT_API_VERSION given.'.red
|
114
115
|
end
|
115
|
-
end)
|
116
|
+
end),
|
117
|
+
FastlaneCore::ConfigItem.new(key: :api_host,
|
118
|
+
env_name: "HIPCHAT_API_HOST",
|
119
|
+
description: "The host of the HipChat-Server API",
|
120
|
+
default_value: "api.hipchat.com",
|
121
|
+
optional: true)
|
116
122
|
]
|
117
123
|
end
|
118
124
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'fastlane/erb_template_helper'
|
2
|
+
|
1
3
|
module Fastlane
|
2
4
|
module Actions
|
3
5
|
class MailgunAction < Action
|
@@ -8,16 +10,9 @@ module Fastlane
|
|
8
10
|
|
9
11
|
def self.run(options)
|
10
12
|
require 'rest_client'
|
11
|
-
|
13
|
+
handle_params_transition(options)
|
12
14
|
handle_exceptions(options)
|
13
|
-
|
14
|
-
mailgunit(options[:mailgun_apikey],
|
15
|
-
options[:mailgun_sandbox_domain],
|
16
|
-
options[:mailgun_sandbox_postmaster],
|
17
|
-
options[:to],
|
18
|
-
options[:subject],
|
19
|
-
compose_mail(options[:message],options[:success]))
|
20
|
-
|
15
|
+
mailgunit(options)
|
21
16
|
end
|
22
17
|
|
23
18
|
def self.description
|
@@ -26,13 +21,26 @@ module Fastlane
|
|
26
21
|
|
27
22
|
def self.available_options
|
28
23
|
[
|
24
|
+
#This is here just for while due to the transition, not needed anymore
|
29
25
|
FastlaneCore::ConfigItem.new(key: :mailgun_sandbox_domain,
|
30
|
-
env_name: "
|
31
|
-
|
26
|
+
env_name: "MAILGUN_SANDBOX_POSTMASTER",
|
27
|
+
optional: true,
|
28
|
+
description: "Mailgun sandbox domain postmaster for your mail. Please use postmaster instead"),
|
29
|
+
#This is here just for while due to the transition, should use postmaster instead
|
32
30
|
FastlaneCore::ConfigItem.new(key: :mailgun_sandbox_postmaster,
|
33
31
|
env_name: "MAILGUN_SANDBOX_POSTMASTER",
|
34
|
-
|
32
|
+
optional: true,
|
33
|
+
description: "Mailgun sandbox domain postmaster for your mail. Please use postmaster instead"),
|
34
|
+
#This is here just for while due to the transition, should use apikey instead
|
35
35
|
FastlaneCore::ConfigItem.new(key: :mailgun_apikey,
|
36
|
+
env_name: "MAILGUN_APIKEY",
|
37
|
+
optional: true,
|
38
|
+
description: "Mailgun apikey for your mail. Please use postmaster instead"),
|
39
|
+
|
40
|
+
FastlaneCore::ConfigItem.new(key: :postmaster,
|
41
|
+
env_name: "MAILGUN_SANDBOX_POSTMASTER",
|
42
|
+
description: "Mailgun sandbox domain postmaster for your mail"),
|
43
|
+
FastlaneCore::ConfigItem.new(key: :apikey,
|
36
44
|
env_name: "MAILGUN_APIKEY",
|
37
45
|
description: "Mailgun apikey for your mail"),
|
38
46
|
FastlaneCore::ConfigItem.new(key: :to,
|
@@ -52,7 +60,18 @@ module Fastlane
|
|
52
60
|
description: "Was this build successful? (true/false)",
|
53
61
|
optional: true,
|
54
62
|
default_value: true,
|
55
|
-
is_string: false)
|
63
|
+
is_string: false),
|
64
|
+
FastlaneCore::ConfigItem.new(key: :app_link,
|
65
|
+
env_name: "MAILGUN_APP_LINK",
|
66
|
+
description: "App Release link",
|
67
|
+
optional: false,
|
68
|
+
is_string: true),
|
69
|
+
FastlaneCore::ConfigItem.new(key: :ci_build_link,
|
70
|
+
env_name: "MAILGUN_CI_BUILD_LINK",
|
71
|
+
description: "CI Build Link",
|
72
|
+
optional: true,
|
73
|
+
is_string: true)
|
74
|
+
|
56
75
|
|
57
76
|
]
|
58
77
|
end
|
@@ -62,24 +81,21 @@ module Fastlane
|
|
62
81
|
end
|
63
82
|
|
64
83
|
private
|
65
|
-
def self.
|
66
|
-
|
67
|
-
|
68
|
-
|
84
|
+
def self.handle_params_transition(options)
|
85
|
+
options[:postmaster] = options[:mailgun_sandbox_postmaster] if options[:mailgun_sandbox_postmaster]
|
86
|
+
puts "\nUsing :mailgun_sandbox_postmaster is deprecated, please change to :postmaster".yellow
|
87
|
+
|
88
|
+
options[:apikey] = options[:mailgun_apikey] if options[:mailgun_apikey]
|
89
|
+
puts "\nUsing :mailgun_apikey is deprecated, please change to :apikey".yellow
|
69
90
|
end
|
70
91
|
|
71
92
|
def self.handle_exceptions(options)
|
72
|
-
unless (options[:
|
93
|
+
unless (options[:apikey] rescue nil)
|
73
94
|
Helper.log.fatal "Please add 'ENV[\"MAILGUN_APIKEY\"] = \"a_valid_mailgun_apikey\"' to your Fastfile's `before_all` section.".red
|
74
95
|
raise 'No MAILGUN_APIKEY given.'.red
|
75
96
|
end
|
76
97
|
|
77
|
-
unless (options[:
|
78
|
-
Helper.log.fatal "Please add 'ENV[\"MAILGUN_SANDBOX_DOMAIN\"] = \"a_valid_mailgun_sandbox_domain\"' to your Fastfile's `before_all` section.".red
|
79
|
-
raise 'No MAILGUN_SANDBOX_DOMAIN given.'.red
|
80
|
-
end
|
81
|
-
|
82
|
-
unless (options[:mailgun_sandbox_postmaster] rescue nil)
|
98
|
+
unless (options[:postmaster] rescue nil)
|
83
99
|
Helper.log.fatal "Please add 'ENV[\"MAILGUN_SANDBOX_POSTMASTER\"] = \"a_valid_mailgun_sandbox_postmaster\"' to your Fastfile's `before_all` section.".red
|
84
100
|
raise 'No MAILGUN_SANDBOX_POSTMASTER given.'.red
|
85
101
|
end
|
@@ -93,14 +109,37 @@ module Fastlane
|
|
93
109
|
Helper.log.fatal "Please provide a valid :message = \"a_valid_mailgun_text\"".red
|
94
110
|
raise 'No MAILGUN_MESSAGE given.'.red
|
95
111
|
end
|
112
|
+
|
113
|
+
unless (options[:app_link] rescue nil)
|
114
|
+
Helper.log.fatal "Please provide a valid :app_link = \"a_valid_mailgun_app_link\"".red
|
115
|
+
raise 'No MAILGUN_APP_LINK given.'.red
|
116
|
+
end
|
96
117
|
end
|
97
118
|
|
98
|
-
def self.mailgunit(
|
99
|
-
|
100
|
-
|
101
|
-
:
|
102
|
-
:
|
103
|
-
:
|
119
|
+
def self.mailgunit(options)
|
120
|
+
sandbox_domain = options[:postmaster].split("@").last
|
121
|
+
RestClient.post "https://api:#{options[:apikey]}@api.mailgun.net/v3/#{sandbox_domain}/messages",
|
122
|
+
:from => "Mailgun Sandbox<#{options[:postmaster]}>",
|
123
|
+
:to => "#{options[:to]}",
|
124
|
+
:subject => options[:subject],
|
125
|
+
:html => mail_teplate(options)
|
126
|
+
mail_teplate(options)
|
127
|
+
end
|
128
|
+
|
129
|
+
|
130
|
+
def self.mail_teplate(options)
|
131
|
+
hash = {
|
132
|
+
author: Actions.git_author,
|
133
|
+
last_commit: Actions.last_git_commit,
|
134
|
+
message: options[:message],
|
135
|
+
app_link: options[:app_link]
|
136
|
+
}
|
137
|
+
hash[:success] = options[:success] if options[:success]
|
138
|
+
hash[:ci_build_link] = options[:success] if options[:ci_build_link]
|
139
|
+
Fastlane::ErbTemplateHelper.render(
|
140
|
+
Fastlane::ErbTemplateHelper.load("mailgun_html_template"),
|
141
|
+
hash
|
142
|
+
)
|
104
143
|
end
|
105
144
|
|
106
145
|
end
|
data/lib/fastlane/actions/pem.rb
CHANGED
@@ -55,7 +55,6 @@ module Fastlane
|
|
55
55
|
unless @options
|
56
56
|
@options = PEM::Options.available_options
|
57
57
|
@options << FastlaneCore::ConfigItem.new(key: :new_profile,
|
58
|
-
env_name: "",
|
59
58
|
description: "Block that is called if there is a new profile",
|
60
59
|
optional: true,
|
61
60
|
is_string: false)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class RestoreFileAction < Action
|
4
|
+
def self.run params
|
5
|
+
path = params[:path]
|
6
|
+
backup_path = "#{path}.back"
|
7
|
+
raise "Could not find file '#{backup_path}'" unless File.exist? backup_path
|
8
|
+
FileUtils.cp(backup_path, path, {:preserve => true})
|
9
|
+
FileUtils.rm(backup_path)
|
10
|
+
Helper.log.info "Successfully restored backup 📤"
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.description
|
14
|
+
'This action restore your file that was backuped with the `backup_file` action'
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.is_supported?(platform)
|
18
|
+
true
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.author
|
22
|
+
"gin0606"
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.available_options
|
26
|
+
[
|
27
|
+
FastlaneCore::ConfigItem.new(key: :path,
|
28
|
+
description: "Original file name you want to restore",
|
29
|
+
optional: false),
|
30
|
+
]
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/fastlane/actions/s3.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'fastlane/erb_template_helper'
|
2
2
|
require 'ostruct'
|
3
3
|
require 'shenzhen'
|
4
4
|
|
@@ -70,7 +70,7 @@ module Fastlane
|
|
70
70
|
version_file_name = params[:version_file_name]
|
71
71
|
|
72
72
|
if Helper.is_test?
|
73
|
-
return build_args
|
73
|
+
return build_args
|
74
74
|
end
|
75
75
|
|
76
76
|
# Joins args into space delimited string
|
@@ -118,39 +118,30 @@ module Fastlane
|
|
118
118
|
version_file_name ||= "version.json"
|
119
119
|
version_url = "https://#{s3_subdomain}.amazonaws.com/#{s3_bucket}/#{version_file_name}"
|
120
120
|
|
121
|
+
#grabs module
|
122
|
+
eth = Fastlane::ErbTemplateHelper
|
121
123
|
# Creates plist from template
|
122
|
-
|
123
|
-
plist_template = File.read(plist_template_path)
|
124
|
-
|
125
|
-
et = ErbalT.new({
|
124
|
+
plist_render = eth.render(eth.load("s3_plist_template"),{
|
126
125
|
url: ipa_url,
|
127
126
|
bundle_id: bundle_id,
|
128
127
|
bundle_version: bundle_version,
|
129
128
|
title: title
|
130
|
-
|
131
|
-
plist_render = et.render(plist_template)
|
129
|
+
})
|
132
130
|
|
133
131
|
# Creates html from template
|
134
|
-
|
135
|
-
html_template = File.read(html_template_path)
|
136
|
-
|
137
|
-
et = ErbalT.new({
|
132
|
+
html_render = eth.render(eth.load("s3_html_template"),{
|
138
133
|
url: plist_url,
|
139
134
|
bundle_id: bundle_id,
|
140
135
|
bundle_version: bundle_version,
|
141
136
|
title: title
|
142
|
-
|
143
|
-
html_render = et.render(html_template)
|
137
|
+
})
|
144
138
|
|
145
|
-
# Creates version from template
|
146
|
-
version_template_path ||= "#{Helper.gem_path('fastlane')}/lib/assets/s3_version_template.erb"
|
147
|
-
version_template = File.read(version_template_path)
|
148
139
|
|
149
|
-
|
140
|
+
# Creates version from template
|
141
|
+
version_render = eth.render(eth.load("s3_version_template"),{
|
150
142
|
url: plist_url,
|
151
|
-
full_version: full_version
|
152
|
-
|
153
|
-
version_render = et.render(version_template)
|
143
|
+
full_version: full_version
|
144
|
+
})
|
154
145
|
|
155
146
|
#####################################
|
156
147
|
#
|
@@ -168,7 +159,7 @@ module Fastlane
|
|
168
159
|
html_render,
|
169
160
|
version_file_name,
|
170
161
|
version_render
|
171
|
-
)
|
162
|
+
)
|
172
163
|
|
173
164
|
return true
|
174
165
|
|
@@ -216,7 +207,7 @@ module Fastlane
|
|
216
207
|
#
|
217
208
|
# NOT a fan of this as this was taken straight from Shenzhen
|
218
209
|
# https://github.com/nomad/shenzhen/blob/986792db5d4d16a80c865a2748ee96ba63644821/lib/shenzhen/plugins/s3.rb#L32
|
219
|
-
#
|
210
|
+
#
|
220
211
|
# Need to find a way to not use this copied method
|
221
212
|
#
|
222
213
|
# AGAIN, I am not happy about this right now.
|
@@ -255,7 +246,7 @@ module Fastlane
|
|
255
246
|
|
256
247
|
# This is the string: {CFBundleShortVersionString}.{CFBundleVersion}
|
257
248
|
full_version = bundle_version + '.' + Shenzhen::PlistBuddy.print(plist, 'CFBundleVersion')
|
258
|
-
|
249
|
+
|
259
250
|
end
|
260
251
|
return bundle_id, bundle_version, title, full_version
|
261
252
|
end
|
@@ -357,9 +348,3 @@ module Fastlane
|
|
357
348
|
end
|
358
349
|
end
|
359
350
|
end
|
360
|
-
|
361
|
-
class ErbalT < OpenStruct
|
362
|
-
def render(template)
|
363
|
-
ERB.new(template).result(binding)
|
364
|
-
end
|
365
|
-
end
|
@@ -25,6 +25,7 @@ module Fastlane
|
|
25
25
|
configuration: "-configuration",
|
26
26
|
derivedDataPath: "-derivedDataPath",
|
27
27
|
destination: "-destination",
|
28
|
+
destination_timeout: "-destination-timeout",
|
28
29
|
export_archive: "-exportArchive",
|
29
30
|
export_format: "-exportFormat",
|
30
31
|
export_installer_identity: "-exportInstallerIdentity",
|
@@ -402,6 +403,7 @@ module Fastlane
|
|
402
403
|
['scheme', 'The scheme to build'],
|
403
404
|
['build_settings', 'Hash of additional build information'],
|
404
405
|
['destination', 'The simulator to use, e.g. "name=iPhone 5s,OS=8.1"'],
|
406
|
+
['destination_timeout', 'The timeout for connecting to the simulator, in seconds'],
|
405
407
|
['output_style', 'Set the output format to one of: :standard (Colored UTF8 output, default), :basic (black & white ASCII outout)']
|
406
408
|
]
|
407
409
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fastlane
|
2
|
+
class ErbTemplateHelper
|
3
|
+
require "erb"
|
4
|
+
def self.load(template_name)
|
5
|
+
path = "#{Helper.gem_path('fastlane')}/lib/assets/#{template_name}.erb"
|
6
|
+
raise "Could not find Template at path '#{path}'".red unless File.exist?(path)
|
7
|
+
File.read(path)
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.render(template,template_vars_hash)
|
11
|
+
Fastlane::ErbalT.new(template_vars_hash).render(template)
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
class ErbalT < OpenStruct
|
16
|
+
def render(template)
|
17
|
+
ERB.new(template).result(binding)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/fastlane/version.rb
CHANGED
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: 1.
|
4
|
+
version: 1.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-06-
|
11
|
+
date: 2015-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -150,20 +150,34 @@ dependencies:
|
|
150
150
|
- - ~>
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 1.0.0
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rest-client
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ~>
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 1.8.0
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ~>
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 1.8.0
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: fastlane_core
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
156
170
|
requirements:
|
157
171
|
- - '>='
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.
|
173
|
+
version: 0.8.0
|
160
174
|
type: :runtime
|
161
175
|
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
178
|
- - '>='
|
165
179
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0.
|
180
|
+
version: 0.8.0
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: deliver
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,14 +254,14 @@ dependencies:
|
|
240
254
|
requirements:
|
241
255
|
- - '>='
|
242
256
|
- !ruby/object:Gem::Version
|
243
|
-
version: 0.
|
257
|
+
version: 0.9.0
|
244
258
|
type: :runtime
|
245
259
|
prerelease: false
|
246
260
|
version_requirements: !ruby/object:Gem::Requirement
|
247
261
|
requirements:
|
248
262
|
- - '>='
|
249
263
|
- !ruby/object:Gem::Version
|
250
|
-
version: 0.
|
264
|
+
version: 0.9.0
|
251
265
|
- !ruby/object:Gem::Dependency
|
252
266
|
name: produce
|
253
267
|
requirement: !ruby/object:Gem::Requirement
|
@@ -388,6 +402,7 @@ files:
|
|
388
402
|
- lib/assets/AppfileTemplate
|
389
403
|
- lib/assets/FastfileTemplate
|
390
404
|
- lib/assets/custom_action_template.rb
|
405
|
+
- lib/assets/mailgun_html_template.erb
|
391
406
|
- lib/assets/s3_html_template.erb
|
392
407
|
- lib/assets/s3_plist_template.erb
|
393
408
|
- lib/assets/s3_version_template.erb
|
@@ -397,6 +412,7 @@ files:
|
|
397
412
|
- lib/fastlane/actions/README.md
|
398
413
|
- lib/fastlane/actions/actions_helper.rb
|
399
414
|
- lib/fastlane/actions/add_git_tag.rb
|
415
|
+
- lib/fastlane/actions/backup_file.rb
|
400
416
|
- lib/fastlane/actions/cert.rb
|
401
417
|
- lib/fastlane/actions/chatwork.rb
|
402
418
|
- lib/fastlane/actions/clean_build_artifacts.rb
|
@@ -411,7 +427,6 @@ files:
|
|
411
427
|
- lib/fastlane/actions/fastlane_version.rb
|
412
428
|
- lib/fastlane/actions/frameit.rb
|
413
429
|
- lib/fastlane/actions/gcovr.rb
|
414
|
-
- lib/fastlane/actions/hall.rb
|
415
430
|
- lib/fastlane/actions/hg_add_tag.rb
|
416
431
|
- lib/fastlane/actions/hg_commit_version_bump.rb
|
417
432
|
- lib/fastlane/actions/hg_ensure_clean_status.rb
|
@@ -433,6 +448,7 @@ files:
|
|
433
448
|
- lib/fastlane/actions/register_devices.rb
|
434
449
|
- lib/fastlane/actions/reset_git_repo.rb
|
435
450
|
- lib/fastlane/actions/resign.rb
|
451
|
+
- lib/fastlane/actions/restore_file.rb
|
436
452
|
- lib/fastlane/actions/s3.rb
|
437
453
|
- lib/fastlane/actions/say.rb
|
438
454
|
- lib/fastlane/actions/set_build_number_repository.rb
|
@@ -456,6 +472,7 @@ files:
|
|
456
472
|
- lib/fastlane/core_ext/string.rb
|
457
473
|
- lib/fastlane/dependency_checker.rb
|
458
474
|
- lib/fastlane/docs_generator.rb
|
475
|
+
- lib/fastlane/erb_template_helper.rb
|
459
476
|
- lib/fastlane/fast_file.rb
|
460
477
|
- lib/fastlane/fastlane_folder.rb
|
461
478
|
- lib/fastlane/junit_generator.rb
|
@@ -1,98 +0,0 @@
|
|
1
|
-
module Fastlane
|
2
|
-
module Actions
|
3
|
-
module SharedValues
|
4
|
-
end
|
5
|
-
|
6
|
-
class HallAction < Action
|
7
|
-
def self.run(options)
|
8
|
-
|
9
|
-
require 'net/http'
|
10
|
-
require 'uri'
|
11
|
-
|
12
|
-
group_api_token = options[:group_api_token]
|
13
|
-
|
14
|
-
title = options[:title]
|
15
|
-
message = options[:message]
|
16
|
-
picture = options[:picture]
|
17
|
-
|
18
|
-
body = {"title" => title,
|
19
|
-
"message" => message,
|
20
|
-
"picture" => picture}
|
21
|
-
|
22
|
-
uri = URI.parse("https://hall.com/api/1/services/generic/#{group_api_token}")
|
23
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
24
|
-
http.use_ssl = true
|
25
|
-
req = Net::HTTP::Post.new(uri.path, initheader = {"Content-Type" =>"application/json",
|
26
|
-
"Accept" => "application/json"})
|
27
|
-
req.body = body.to_json
|
28
|
-
|
29
|
-
return [uri.to_s, body] if Helper.is_test? # tests will verify the url and body
|
30
|
-
|
31
|
-
res = http.request(req)
|
32
|
-
check_response_code(res)
|
33
|
-
|
34
|
-
Helper.log.info "Posted message to Hall 🎯."
|
35
|
-
end
|
36
|
-
|
37
|
-
def self.check_response_code(response)
|
38
|
-
case response.code.to_i
|
39
|
-
when 200, 201, 204
|
40
|
-
true
|
41
|
-
when 404
|
42
|
-
raise "Not found".red
|
43
|
-
when 401
|
44
|
-
raise "Access denied".red
|
45
|
-
else
|
46
|
-
raise "Unexpected #{response.code}".red
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
#####################################################
|
51
|
-
# @!group Documentation
|
52
|
-
#####################################################
|
53
|
-
|
54
|
-
def self.description
|
55
|
-
"Post a message to Hall (https://hall.com/)"
|
56
|
-
end
|
57
|
-
|
58
|
-
def self.available_options
|
59
|
-
[
|
60
|
-
FastlaneCore::ConfigItem.new(key: :title,
|
61
|
-
env_name: "FL_HALL_TITLE",
|
62
|
-
description: "The title for the message. Plain text, HTML tags will be stripped",
|
63
|
-
default_value: 'fastlane'),
|
64
|
-
FastlaneCore::ConfigItem.new(key: :message,
|
65
|
-
env_name: "FL_HALL_MESSAGE",
|
66
|
-
description: "The message to post on the Hall group. May contain a restricted set of HTML tags (https://hall.com/docs/integrations/generic)",
|
67
|
-
default_value: ''),
|
68
|
-
FastlaneCore::ConfigItem.new(key: :picture,
|
69
|
-
env_name: "FL_HALL_PICTURE",
|
70
|
-
description: "URL to an image file, which will be displayed next to your notification message",
|
71
|
-
default_value: 'https://s3-eu-west-1.amazonaws.com/fastlane.tools/fastlane.png'),
|
72
|
-
FastlaneCore::ConfigItem.new(key: :group_api_token,
|
73
|
-
env_name: "HALL_GROUP_API_TOKEN",
|
74
|
-
description: "Hall Group API Token",
|
75
|
-
verify_block: Proc.new do |value|
|
76
|
-
unless value.to_s.length > 0
|
77
|
-
Helper.log.fatal "Please add 'ENV[\"HALL_GROUP_API_TOKEN\"] = \"your token\"' to your Fastfile's `before_all` section.".red
|
78
|
-
raise 'No HALL_GROUP_API_TOKEN given.'.red
|
79
|
-
end
|
80
|
-
end)
|
81
|
-
]
|
82
|
-
end
|
83
|
-
|
84
|
-
def self.output
|
85
|
-
[
|
86
|
-
]
|
87
|
-
end
|
88
|
-
|
89
|
-
def self.author
|
90
|
-
'eytanbiala'
|
91
|
-
end
|
92
|
-
|
93
|
-
def self.is_supported?(platform)
|
94
|
-
true
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|