Skip to content

Instantly share code, notes, and snippets.

@fra3il

fra3il/0.rb Secret

Last active January 19, 2016 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fra3il/157f9e3ba3a78df87b73 to your computer and use it in GitHub Desktop.
Save fra3il/157f9e3ba3a78df87b73 to your computer and use it in GitHub Desktop.
[WP/1411] fastlane
desc "gym 을 이용하여 빌드 및 아카이브"
lane :lane_archive do
option = {
silent: true,
clean: true,
use_legacy_build_api: true,
output_directory: @build_path
}
prompt_text = "\n 아카이브에 사용할 스키마를 선택해주세요."
scheme_path = Pathname.new(Dir.pwd).dirname + "Project.xcodeproj/xcshareddata/xcschemes/"
scheme_list = Dir.entries(scheme_path).select { |file| !File.directory? file }
scheme_list.map! { |file| File.basename(file, File.extname(file)) }
scheme_list.each { |scheme| prompt_text << "\n #{scheme_list.index(scheme)}. #{scheme}" }
prompt_result = prompt(
text: prompt_text,
)
scheme = scheme_list[prompt_result.to_i]
if scheme
option.store(:scheme, scheme)
end
puts option
gym(option)
end
desc "crashlytics 배포 테스트"
lane :lane_crashlytics do
option = {
api_token: ENV["CRASHLYTICS_API_TOKEN"],
build_secret: ENV["CRASHLYTICS_BUILD_SECRET"],
ipa_path: File.join(@build_path, "Project.ipa"),
emails: ["fra3il@gmail.com"]
}
prompt_result = prompt(
text: "#{@release_note_file} 을 첨부하시겠습니까?!",
boolean: true
)
if prompt_result
option.store(:notes_path, File.join(ENV["FASTLANE_PATH"], @release_note_path, @release_note_file))
end
puts option
crashlytics(option)
end
desc "Notification 테스트"
lane :lane_notification do
notification(subtitle: "Finished Building", message: "Ready to upload...")
end
desc "slack 연동 테스트"
lane :lane_slack do
payload = {
"App Identifier" => ENV["APP_IDENTIFIER"],
"App Version" => @app_version,
"Build Number" => @build_number
}
puts payload
slack(
channel: "@fra3il",
payload: payload,
default_payloads: [],
)
end
desc "changelog_from_git_commits 를 이용하여 #{@release_note_file} 파일을 생성"
lane :lane_release_note do
sh "mkdir -p #{@release_note_path}"
sh "echo \"#{changelog_from_git_commits}\" > #{File.join("./", @release_note_path, @release_note_file)}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment