Clasp deploy doesn't update the deployed version with Google Apps Script Web App
See original GitHub issueExpected Behavior
Perhaps I’m misunderstanding, but from the readme I’d thought that clasp deploy
would allow me to publish a new version of a Web App (in this case bound to a google sheet).
I’d expected the workflow to be as follows:
- clasp version “My new version”
Created version xx.
- clasp deploy xx
yyyyyyyyyyyyyyyyy @xx
- clasp open browser opens to newly published version “xx”
Actual Behaviour
The version is created as expected, but the web app Project Version remains at the last deployed version not the version used with clasp deploy
. To actually deploy it I have to go into the Script Editor then Publish > Deploy as Web App and then select the version “xx”
Related Issues
This seems related to https://github.com/google/clasp/issues/43, however that issue specifically relates to Chrome store apps and this is a Web App which the comments on that issue suggest should be supported.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:39 (9 by maintainers)
Top Results From Across the Web
Can't deploy new version of published Google apps script app ...
The deployment is a published/approved apps script project. So far I have worked around the problem by updating version manually in the GUI....
Read more >Command Line Interface using clasp | Apps Script
To deploy a project with clasp , first create an immutable version of the Apps Script project.
Read more >Google Sheets Web App Deployment Process - Apps Script V8
How to deploy, redeploy and manage Google Sheets web app in Apps Script V8 runtime?# web # app #sheets.
Read more >ScriptApp.getService().getUrl() doesn't work for versioned ...
The workaround of replacing the ID with your script ID in the URL only works if you are on the first deployment of...
Read more >Google Apps Script Tips to build Add-ons | Railsware Blog
Manage Deployment Versions: Create, update, and view multiple deployments of your project. Structure Code: clasp automatically converts your ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Summarizing:
https://script.google.com/macros/s/{deploymentID}/exec
clasp deployments
web app meta-version
in the list of deployments.clasp deploy
creates new deployment if no deploymentId is specified and creates new version if no version is specifiedclasp --deploymentId {published_deployment_id} --version {selected_version_here}
So the process:
clasp deployments
andclasp push
clasp deploy --deploymentId $test_deployment_id
creates version => new_versionhttps://script.google.com/macros/s/{test_deployment_id}/exec
clasp deploy --deploymentId $pub_deployment_id --versionNumber $new_version
So, in the end it looks that
clasp deploy
works as designed. What’s missing is the documentation 😃I found this trick working for deploy a new version of webapp.
clasp deployments
web app meta-version
attributeAfter selecting deploment ID, proceed with
I found that
web app meta-version
attribute only appaers when web-app application is update from AppsScript code editor, so we need to consider the deploymentIDs order to get the proper version. Also the webapp should remain published to last existing version or the “select last row” trick will not work.I tried a couple of times and seems to work, you can try and test as well.