-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFastfile
88 lines (78 loc) · 2.08 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
79
80
81
82
83
84
85
86
87
88
lane :beta do |options|
# Create keychain for store certificate
keychain_name = 'ci-keychain'
create_keychain(
name: keychain_name,
default_keychain: true,
unlock: true,
timeout: 3600,
lock_when_sleeps: true,
password: SecureRandom.base64
)
UI.message 'Keychain created'
# Import distribution certificate
import_certificate(
certificate_path: 'fastlane/certificates/distribution.p12',
certificate_password: ENV['KEY_PASSWORD'],
keychain_name: keychain_name
)
UI.message 'Сertificate has been imported to keychain'
# Prepare project
update_app_identifier(
xcodeproj: ENV['XCODEPROJ_NAME'],
app_identifier: ENV['APP_IDENTIFIER'],
plist_path: ENV['INFO_PLIST_PATH']
)
UI.message 'App identifier has been updated'
sigh(
username: ENV['APPLE_ID'],
app_identifier: ENV['APP_IDENTIFIER'],
team_id: ENV['TEAM_ID']
)
UI.message 'Sigh completed'
# Setting up the icon badge
shield_text = options[:shield_text]
shield_data = "#{shield_text}-blue"
badge(shield: shield_data, dark: true)
UI.message 'Badge changed'
# Building the ipa file of the enterprise build
gym(
workspace: ENV['XCWORKSPACE_NAME'],
scheme: ENV['SCHEME'],
use_legacy_build_api: true,
export_method: 'enterprise'
)
UI.message 'Successfully Build'
# Uploading
hockey(
api_token: ENV["HOCKEY_API_TOKEN"],
public_identifier: ENV["HOCKEY_APP_ID"],
notify: '0',
status: '2',
notes: last_git_commit[:message]
)
UI.message 'Successfully uploaded to hockey'
# Delete keychain
delete_keychain(name: keychain_name)
UI.message 'Keychain was removed'
if is_ci?
download_link = Actions.lane_context[Actions::SharedValues::HOCKEY_DOWNLOAD_LINK]
# Posting to Slack
slack(
message: "#{ENV['APP_NAME']} successfully released to Hockey! #{download_link}",
success: true
)
end
end
lane :test do
scan
end
error do |lane, exception|
if is_ci?
# Posting to Slack
slack(
message: "#{ENV['APP_NAME']} : fail\nexception: #{exception.to_s}",
success: false
)
end
end