akamai / cli-property-manager

Use this Property Manager CLI to automate Akamai property changes and deployments across many environments.
Apache License 2.0
29 stars 22 forks source link

Enhancement req: Preview/draft version #84

Closed justinorringer closed 1 year ago

justinorringer commented 1 year ago

Hello! I want to be able to draft a version using the pipeline, but not promote it to a network. My org usually drafts and tests changes in the ui, then we use the cli tool to solidify those changes and promote from stage -> prod. Validating before that promotion would be handy.

It would be great if one could draft a version using the cli and view it before promotion (sorry if that already exists).

Thanks!

wzagrajcz commented 1 year ago

Hello @justinorringer Thanks for opening the issue. I am not quite sure what the problem is. Using pipeline You can create a property by running

akamai pipeline new-pipeline -c ... -g ... -d ... -p pipeline_name env_name

After that point, the property is created, is not propagated into staging or production network and can be checked using the UI (if You want). If You want to propagate the property to network (e.g. staging) (assuming that property has no errors) You need to do it intentionally e.g. by running

akamai pipeline -p pipeline_name promote -n s env_name

Hope that helps. If it doesn't, please provide what You do (e.g. what commands do You use), what outcome do You have and what do You want to achieve.

Best regards, Wojciech

justinorringer commented 1 year ago

Hey Wojciech,

Thanks for the response. Those commands are how we have been using the cli. I'm curious if we could draft a version to the property without promoting to staging. That could look something like

akamai pipeline -p pipeline_name draft env_name

That would create a version of the config that we could view before promoting to staging.

Justin

wzagrajcz commented 1 year ago

Hello @justinorringer

Using the steps that I mentioned in message above You can view a config before promoting to staging. Once You create a pipeline (akamai pipeline new-pipeline), You can see it from the UI and it's not yet in staging or production (so it's a draft). To promote to staging You need to explicite use akamai pipeline promote. And once the property was activated and You still want to make some more changes, then (after changes to templates) You need to save it (akamai pipeline sv) and it automatically creates a new property version that can be accessed from UI and is not yet activated (the previous version was activated, to activate new one You need to do it explicitly).

Hope that helped.

Best regards, Wojciech

justinorringer commented 1 year ago

Oh cool! I didn't know about the sv arg. Thanks Wojciech!

wzagrajcz commented 1 year ago

Hello @justinorringer Great that it helped. A useful thing in all packages (at least I hope it's implemented in all cli packages) is that if You provide a command without subcommand, it should list You all possible values (so it displays help basically). So e.g. typing only akamai shows help for cli:

Usage:
  akamai [global flags] command [command flags] [arguments...]

Commands:
  config
  install (alias: get)
  list
  search
  uninstall
  update
  upgrade
  help
Installed Commands::
...

And typing only akamai pipeline shows help for the pipeline:

Usage: akamai pipeline [options] [command]

Akamai Pipeline. Run these commands from the directory that contains all of your pipelines.

Options:
  -V, --version                                      output the version number
  ...

Commands:
  change-ruleformat|crf [options] [environments...]  Change the property rule format used by a pipeline or an environment. Enter a space-separated list of environments after the pipeline name to update a subset of environments.
  check-promotion-status|cs [options] <environment>  For the selected environment, check the activation status. If the underlying property activation is complete, the environment is considered promoted.
  help                                               help command
   ...

Best Regards, Wojciech