Installing triggers on AppMaker deployment - google-apps-script

When I deploy my AppMaker app to a deployment, I'd like to execute some code to automatically install the relevant triggers.
Is there a way to install triggers when the app is deployed?

You can use the App Startup option to run some logic when the app starts. Maybe use the Properties Service to save a property that contains a value indicating if the triggers have been installed or not and everytime that the app starts, check if the triggers are installed and take action based on that.

Related

Can't deploy new version of published Google apps script app with Rest API

When trying to use https://developers.google.com/apps-script/api/reference/rest/v1/projects.deployments/update to update an existing deployment with a new version in clasp cli (https://github.com/google/clasp) I get error Read-only deployments may not be modified.
The deployment is a published/approved apps script project. So far I have worked around the problem by updating version manually in the GUI. Would be great if anyone knows how I can do that with the API.
Archived deployments are set to read-only, they can't be modified or deleted.
you can find the solution in google documentation about managing deployments:
If you want to edit an archived deployment, you must redeploy it ...
If you need to deploy a new version then the solution is not to update the version of an existing deployment, but to make a new deployment with the new version.
Google documentation says:
A version is automatically created when you create a new deployment. You can also create a new version from an existing deployment ...

React Native Firebase: How do I add a function to Firebase Console?

I'm contributing to a React Native project that uses firebase-functions. In the Functions section of the Firebase Console there's a list of existing functions, and I want to know how to add a new one. I know what code I want to write, but I don't know how to deploy it to Firebase so that it will appear in this Functions section of the console. A tutorial I saw said to use firebase deploy, but when I do that within my project it says function 'firebase' not found. Is there another way to add the functions to the console?
When you deploy Cloud Functions through the Firebase CLI by running firebase deploy or firebase deploy --only functions, any successfully deployed functions automatically get added to the Firebase console.
There is no separate step to get them added, nor any way to add Cloud Functions through the Firebase console. Just run firebase deploy and they will show up.

Azure DevOps deploy overwrites not always cshtml files

Sometimes it happens that when we do a deploy, the last committed files with extension cshtml, are not updated. We have not seen other type files being not updated. It could be that a file is in use and can't be overwrited. Is it possible to add an extra step to the deployment process so we can avoid this?
That is strange. If you are using the Azure App Service Deploy task within Azure Pipelines to deploy to your Web App, you have the option to Remove additional files at destination. Enabling this option deletes files in the Azure App Service that have no matching files in the App Service artifact package or folder being deployed.
Based on the chosen deployment method, there are other helpful additional deployment options like:
Rename locked files: Rename any file that is still in use by the web server by enabling the msdeploy flag MSDEPLOY_RENAME_LOCKED_FILES=1 in the Azure App Service settings. This option, if set, enables msdeploy to rename files that are locked during app deployment. This way, you can avoid deployment failures with ERROR_FILE_IN_USE errors.
Take App Offline: Select this option to take the Azure App Service offline by placing an app_offline.htm file in the root directory before the synchronization operation begins. The file will be removed after the synchronization completes successfully.
Having these in place can streamline your deployments and make them robust. Here is the complete reference for the task: Azure App Service Deploy task.

Versioned deployment seems to be redirecting to HEAD deployment after OAuth login

I have a google workspace addon which is extending gmail and is using app script oauth to connect our own system, https://github.com/googleworkspace/apps-script-oauth2.
Our system has a development environment and a live environment, each uses a different identity client id secret which need to be used when connecting to each. I have stored these as different project properites with the development properties being prefixed with 'dev-' and i have a function that looks like this:
getScriptPropery function. This function has a variable that should let me change the script properties I access.
I have then created a versioned deployment that uses the live project properties and have kept my HEAD deployment using the develpoment properties. My problem is that once someone tries to login on the versioned deployment they seem to be redirected back to the HEAD version of the code which is using development project properties, this then breaks the login attempt and gives the following error: AppScript login error. I have tested this by adding logging that is only in the HEAD version of the getScriptProperty function and you can see the logs swap to using the development properties after redirecting from the login attempt, Logging example.
Is there a better way to manage deployments/project properties to stop this from happening or have a just missed something with how they are meant to work?

build order of post build actions in hudson

I want to run an integration test an to an WAR (in tomcat) using hudson as continous build server.
The post build action to start a script is higher on the list than the deploy action, so I assume it is executed BEFORE the deploying is done.
So how do I deploy and THEN start a script to run my test?
The way I see it, is to write a script to deploy WAR on desired Tomcat server (it should not be complicated) instead of using deploy plugin and then run the script with test.