Is there a way to install a trigger after slack app installation? - slack

I'm creating an app using the future/beta/modular/new/next-gen Slack platform https://api.slack.com/future
I'm looking for a way to install a trigger as part of the installation process. I've looked through the documentation and I don't see any way to do this.

A trigger can only be created after an app is, either running locally (via slack run), or has been deployed in prod (via slack deploy). Triggers are created with the slack trigger create command via the CLI.

Related

Connecting to firebase admin sdk using service account key

I am using Cloud Run Continuous Deployment to watch a github repo & build the project upon a push to the production branch. Instead of specifying a Dockerfile, I am letting Google Cloud Buildpacks do all the work, since my codebase is written in Node.js.
I haven't yet been able to run a functional deployment due to the service account running into some permissions errors, but once I get past those, I am wondering how I would be able to initialize the firebase admin SDK inside the build. In my dev code, I have a service account JSON file and initialize the admin SDK using that file, but I don't know if this possible in the cloud build. If I can't upload private files to the cloud build, am I able to use the service account that creates the build to initialize the admin sdk? Is there another way to initialize the admin app in the build, such as using env variables? For reference, I am only using the admin sdk to read and write to our firestore database.

Heroku Review Apps Url

We use a Heroku pipeline for deployment review apps for our Angular app. Recently we invested in EndTest codeless automation and we need to run the test suites on every review app that is created. The url's of these review apps are dynamic in Heroku, is there a way to capture this generated url and then execute a script that would trigger my test case suite in EndTest(EndTest has an API which can consume the url).
How do I get this done in Heroku environment. I just have PROC file configured.
You could use the postdeploy script:
The app.json file has a scripts section that lets you specify a postdeploy command. Use this to run any one-time setup tasks that make the app, and any databases, ready and useful for testing. Postdeploy is handy for one-off tasks, such as:
Setting up OAuth clients and DNS
Loading seed/test data into the review app’s test database
But if you will run this script with each change to a pull request, use release phase.
The app name should be in the env variable HEROKU_APP_NAME.

Can I create Heroku Scheduler jobs via the CLI or other non-web UI method?

I'm working on a project which uses Heroku's 'Deploy to Heroku' button to allow people to quickly configure and deploy an app. The app includes a recurring task, and I would like to use Heroku's free 'Scheduler' add-on to run it every day. Ideally I would like the 'setup' task that runs on deploy to create a job in the scheduler, so that the user deploying the app doesn't have to do it.
Is this possible?
As far as I am aware, this is not possible using existing solutions.
I just created a new add-on, https://schedulerctl.com
Schedulerctl enables you to create and manage your Heroku Scheduler jobs using a REST API or the Heroku CLI.
These interfaces allow you to programatically combine Heroku Scheduler with other services like your Heroku button.

gcloud automatic redeployment Golang app

I have a Golang app running on Google Cloud App Engine that I can update manually with "gcloud app deploy" but I cannot figure out how to schedule automatic redeployments. I'm assuming I have to use cron.yaml, but then I'm confused about what url to use. Basically it's just a web app with one main index.html page with changing content, and I would like to schedule automatic redeployments... how do I have to go about that?
If you want to automatically re-deploy your app when the code changes, you need what's called CI/CD (Continuous integration/deployment). What a CI does is, for each new commit to your repository, check out the new code and run a test script. If all the tests pass (or if you don't have any tests at all), the CI server can then deploy your code to App Engine, all automatically.
One free (for open-source projects) CI provider is Travis CI. To configure it, you need to make an account with Travis, and a file called .travis.yml in the root of your repository. To set up App Engine deploys, you can follow this guide to set up a service account and add the encrypted file to your repo. It will run a gcloud app deploy from a container on their servers, whenever you push code to a certain branch (master by default) in your repo.
Another option, which avoids setting up CI at all, is to simply change your app to generate the dynamic parts of the page when it gets requested. Reading the documentation for html/template would point you in the right direction.

Heroku review app deploy with github: how to change the user deploying

I inherited a Heroku account. We moved to a team setup and I'm getting started with review apps.
When trying to create a review app, Heroku complains:
Cannot create this review app • Your role collab on the team xxxxx is
not allowed to perform that action.
However, I'm an admin on Heroku.
Another admin tried also and had the same problem.
The deploys prior to moving to a team, seems to have been initiated by another user, who is a collaborator, but I know for certain that the user did not actually trigger the deploy, the activity shows as being initiated by this user however it was triggered by the owner of the (then) personal app clicking create review app.
I'm trying to understand how the deploy activity is linked to the github account, so my first question is:
Is the deploy activity associated with a specific Github user? If so, where/how is the user defined?
I get the impression I need to disconnect the Github account from the pipeline, and re-connect with one of the admin's accounts, but I'm wary of disconnecting without understanding the consequences: the Heroku help on that is not clear at all.
My second question is:
What happens when I disconnect the Github account from the pipeline? Should I worry that it will mess up my running dynos? If not in disconnecting, could it cause trouble on re-connection?
Thanks
The only way I found to do this was to un-link the github capability in Heroku, and re-link with the account I wanted to use.
I had to do this recently. I had set up a pipeline in Heroku with review apps using an old Heroku account. I later wanted to remove that old account's access to the Heroku apps and I ran into the same issue you did.
Here's what I did.
I unlinked github from the pipeline. This deleted all existing review apps. But it left the staging and production apps alone and in their stages in the pipeline.
Then I re-linked github to the pipeline using the more permanent Heroku account.
And I had to re-set up the review apps configuration in the pipeline.
At that point, I had to recreate all review apps that existed before I started.

Resources