Add the block that sends the Slack message desc "Build a debug APK" lane :debug do gradle(task: "clean assembleDebug") end 3. We will add a lane that builds a debug APK in the Fastfile after the before_allblock. last returns the last value after splitting which is the webhook URL. split('=') to separate the key and the value. NOTE: The code in the before_all block returns a string with the last line value in local.properties, splits it with an equals sign. f = File.open("./local.properties", "r") ENV = f.each_line.to_a.last.split('=').last f.close end NOTE: The local.properties file is not part of the files that are added to version control before_all do # Reads the local.properties file and returns the the slack webhook url. sdk.dir=/Users/thedancercodes/Library/Android/sdk # SLACK WEBHOOK URL SLACK_WEBHOOK_URL= # For customization when using a Version Control System, please read the # header note. # Do not modify this file - YOUR CHANGES WILL BE ERASED! # This file should *NOT* be checked into Version Control Systems, # as it contains information specific to your local configuration. Select the channel or direct message you want to post the message to and generate the URL.Īdd the URL into the local.properties file that will be referenced in the before_all block of the Fastfile # This file is automatically generated by Android Studio. This is acquired after installing incoming webhook appin your workspace. The first step is to configure the incoming Webhook URL. Prepare for slack integration using Fastlane: 1. NOTE: Webhooks allow us to send data to Slack in real-time. A successful build, a successful APK upload to Google Play using Fastlane… etc.) We will achieve our goal of sending a message to Slack by using a Webhook.Ī Webhook is essentially the slack URL used to be able to post things to slack channels or to specific users when an action happens (e.g. Slack is a great collaboration tool that simplifies engineering workflows for faster deploys. GOAL: Use Fastlane to send a message to Slack □ TOP TIP: □ It is best practice to keep these files in source control to share with the rest of your team. That’s it! Fastlane will automatically generate a configuration for you based on the information provided.
0 Comments
Leave a Reply. |