SlackApp: Jenkins Build
Integrate Build-A-Bot App
To trigger Unity builds from Slack, the Jenkins Build-A-Bot
SlackApp must first be integrated into the specific Slack channel.
-
To integrate the Slack app into a specific channel, click the
dropdown arrow
next to the Channel name to open the Channel Settings window. -
In the Channel Settings, open the
Integrations
tab and click theAdd an App
button. -
In the search bar, search for
Jenkins
, then click theAdd
button next to theJenkins Build-A-Bot
app.
Trigger Builds from Slack
There are two alternative ways to trigger Jenkins Builds - see below for each:
- Slack Shortcut
- Slash Command
💡 |
Slack users need to be given permission to build jobs. This prevents unauthorized access and builds. Please let the Lion Studios Solutions Team know which users should have access to which build jobs, and we will set them up and notify you when they’re ready. |
Use a Slack Shortcut
You can now trigger Jenkins builds from Slack.
- At the bottom of any chat box in Slack, click on the
Run Shortcut
button.
- Then, choose
Jenkins build
from the list of shortcuts.
-
You should then see a Popup form appear. Fill out the form with the values for your build.
Available options:
Project
[REQUIRED]- The
project
parameter is a special identifier that needs to be set up by the Lion Studios Solutions Team. Please contact us if you do not see your project in the dropdown list. - Example:
inkinc
- The
Platform
[REQUIRED]- Example:
ios
orandroid
- Example:
Build Type
[REQUIRED]- Example:
debug
orrelease
- Example:
Build Number
[optional]- Example:
38
- Example:
Version Number
[optional]- Example:
2.12.2
- Example:
Branch Name or Commit Hash
[optional]- You can specify a
branch name
or acommit hash
. If you omit this parameter, the job is built using thedefault branch
specified in the configuration. - Example:
origin/feature/jenkins-build
- You can specify a
-
Then click
Request Build
. Your game Slack Channel should now receive notifications about build starts, completions, and errors.
Use a Slash Command
To use the slash command, type /jenkins-build
, then add the following parameters separated by spaces.
job
[REQUIRED]- The
job
parameter is a special identifier that needs to be set up by the Lion Studios Solutions Team. Please get in touch with us for support. - Example:
inkinc
- The
platform
[REQUIRED]- Example:
ios
orandroid
- Example:
buildType
[REQUIRED]- Example:
debug
orrelease
- Example:
buildNum
[optional]- Example:
38
- Example:
versionNum
[optional]- Example:
2.12.2
- Example:
branch
[optional]- For the
branch
parameter, you can specify either abranch name
or afull commit hash
. If you omit thebranch
parameter, the job is built using thedefault branch
specified in the configuration. - Example:
origin/feature/jenkins-build
- For the
An example build command might look like this (replace our example values with your own):
/jenkins-build job:inkinc platform:ios buildType:release versionNum:2.12.2 buildNum:38 branch:origin/feature/jenkins-build
If your slash command succeeds, you will see a success message appear in your chat:
If the command fails with a non-descriptive error like dispatch_failed
, please contact Support, so we can investigate.