forked from fastlane/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fastfile
78 lines (59 loc) · 1.54 KB
/
Fastfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
require 'open-uri'
url = "https://cms.sunapps.net/framework_versions/latest?platform=ios"
framework_version = JSON.parse(open(url).read)
# The URL below is password protected
url = "https://cms.sunapps.net/all_apps_to_deploy.json?platform=ios&version=#{framework_version['version_number']}"
apps = JSON.parse(open(url).read)
# Example `apps` array open the Deliverfile
app_id = Dir.pwd.split("/")[-2].to_i
app = apps[app_id.to_s]
raise "Couldn't find app #{app_id}".red unless app
before_all do
cocoapods
end
lane :test do
xctool
snapshot
end
def build_app
sh "rake prepare_release" # an internal rake task that prepares the app for the release
gym(
workspace: "./Project.xcworkspace",
scheme: "Release"
)
end
lane :deploy do
snapshot
cert
produce(
username: '[email protected]',
app_identifier: "net.sunapps.#{app_id}",
app_name: app["fullName"],
language: 'German',
version: framework_version['version_number'],
sku: app_id,
team_name: 'SunApps GmbH' # only necessary when in multiple teams
)
# provisioning profile
sigh
# push notification profile
pem(new_profile: Proc.new do |value|
# Code to upload PEM file to server
end)
increment_build_number
build_app
deliver # upload the app
frameit # add device frames to send them to the customer
end
after_all do
clean_build_artifacts
slack(
message: "App #{app_id} was successfully released!"
)
end
error do
slack(
message: "An error occured while deploying app #{app_id}",
success: false
)
end