Last active
January 21, 2019 16:38
-
-
Save TheDancerCodes/dd6d6c04546b6a5b5b7f2fe5b93562ec to your computer and use it in GitHub Desktop.
This gist contains a ruby block for setting up a Slack Webhook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file contains the fastlane.tools configuration | |
# You can find the documentation at https://docs.fastlane.tools | |
# | |
# For a list of all available actions, check out | |
# | |
# https://docs.fastlane.tools/actions | |
# | |
# For a list of all available plugins, check out | |
# | |
# https://docs.fastlane.tools/plugins/available-plugins | |
# | |
# Uncomment the line if you want fastlane to automatically update itself | |
# update_fastlane | |
default_platform(:android) | |
platform :android do | |
before_all do | |
# Read the local.properties | |
f = File.open("../local.properties", "r") | |
ENV["SLACK_URL"] = f.each_line.to_a.last.split('=').last | |
f.close | |
end | |
desc "Build a debug APK" | |
lane :debug do | |
gradle(task: "clean assembleDebug") # https://developer.android.com/studio/build/building-cmdline#DebugMode | |
end | |
# Runs after all tasks. This block is called only when the executed lane is successful | |
after_all do |lane| | |
# Slack action | |
slack( | |
message: "Slack Message Delivered Successfully" | |
) | |
end | |
error do |lane, exception| | |
slack( | |
message: exception.message, | |
success: false | |
) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment