clasp redeploy without version specified

Created on 24 Oct 2018  路  9Comments  路  Source: google/clasp

Expected Behavior

It would be good to have the ability to use clasp redeploy command without version specified so that clasp would create one for us. Same as clasp deploy works - it creates a new version when no version passed as an argument. The use case for this is deploying from CI systems (see below)

Actual Behavior

Not sure about other Apps Script projects, but for Gmail add-ons you have to specify a particular Deployment ID which will be available to the users through G Suite marketplace. So every time you're delivering the updates you'll have to update existed deployment instead of creating a new one, which is not that easy to do programmatically, as basically you need:

  1. to create a new script version clasp version ...
  2. somehow retrieve created version number (parse clasp output of the previous command or use googleapis directly)
  3. and then you can finally use clasp redeploy <deploymentId> <created version> <description>

Probably it would be reasonable to make version parameter optional, e.g.
clasp redeploy <deploymentId> <description> - creates new version and updates deployment with that version
clasp redeploy <deploymentId> <version> <description> - updates deployment with specified version

All 9 comments

I'll have to make redeploy easier in clasp@2.
See https://github.com/google/clasp/pull/372#issuecomment-435435683

@grant Nice! Good to know 馃檪
Is there an ETA for v2?

Hoping for ~December 14th.
I've been a bit busy giving talks about Apps Script recently. Big talk next week at angularconnect.com

I agree with this plan. ( https://github.com/google/clasp/pull/372#issuecomment-435435683 )

Is this plan yet to be decided?
If so, I will create a PR to modify the deploy command.

I will accept any PRs that follow the design of https://github.com/google/clasp/pull/372#issuecomment-435435683.
I'm not going to publish live to npm immediately, but probably in December or late November. Help would be appreciated!

If you do not specify deploymentID, we update the latest deployment, right?
In that case, I think there is no way to create a new deployment.

If there's no deploymentId, create a deployment with the latest version.

@grant

Umm...
--description [description] and --version [version] can not be executed on commander.js
We need to change the name of arguments.

https://github.com/tj/commander.js/issues/516

Example:

--verrsion [version] -> --versionNumber [version]
--description [description] -> --desc [description]

@jsarafajr FYI, redeploy is being merged in with deploy since they are very similar.
Will be published to npm in clasp@2 next month.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arichardsmith picture arichardsmith  路  6Comments

freddy-daniel picture freddy-daniel  路  7Comments

Haris-Jamil picture Haris-Jamil  路  6Comments

OleksandrRakovets picture OleksandrRakovets  路  3Comments

DominikPalo picture DominikPalo  路  4Comments