Now that you have an app with a function that performs some task, it's time to deploy it to the hosting infrastructure managed by Slack.
$ slack deploy
When you run the deploy command for the first time, it will also create the actual app instance, including generating an app ID (e.g.
A123BCD456), if there is no app for your current environment. This means you can go to https://api.slack.com/apps and see the app, which should match the name you see in your app's
project.ts file. Optionally run
slack install to install the app without deploying the function to be hosted.
Please note: you can't currently edit an apps's configuration options via the web interface on https://api.slack.com/apps.
In addition to auto configuring the app, any functions will be managed and run by Slack when you deploy. Whenever a workflow calls your function, it will be run on Slack infrastructure.
Subsequent deploys will make any necessary changes to the config.
That's it. There is no step three. Or step two for that matter!
If you have created multiple environments for your app, use the
-e flag to specify which environment the app should be deployed to.
$ slack deploy -e prod
Without this flag, the app will be deployed to the default environment.
One final tip: because deploys are managed by the CLI, you can use it in conjunction with other command line tools. For instance, you can use the watchexec to execute the deploy command every time. We recommend ignoring the
node_modules directory to avoid getting stuck in a loop.
watchexec --exts js -i node_modules -- slack deploy
You can use the same approach with all kinds of tools and even integrate the Slack CLI into your testing suites or continuous integration and continuous deploy pipelines.