OctopusDeploy / Octostache

| Public | The variable substitution syntax for Octopus Deploy
Other
5 stars 24 forks source link

filters: add UriPart function #36

Closed espenrl closed 4 years ago

espenrl commented 5 years ago

This filter will extract information from an uri. It essentially parses the string as an Uri and access its properties.

typeof(Uri).GetProperties().Select(a => a.Name).OrderBy(a => a).ToArray()

Example

foo = https://octopus.com/docs
#{foo | UriPart Host} --> octopus.com
CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.

espenrl commented 4 years ago

Thanks for the feedback. The unit test code is much more clean now.

  1. I've had adventures with json recently, so I fixed a casing issue. false/true works way much better than False/True.
  2. The code now handle exceptions on the Uri property accessors as they often throw.
michaelnoonan commented 4 years ago

Oh, one last thing will be updating the docs so everyone can learn about the great work you've done. If you contribute the docs, I think it would be nice to add a mention to your github handle. :)

https://github.com/OctopusDeploy/docs/blob/master/docs/deployment-process/variables/variable-filters.md

espenrl commented 4 years ago

I've added docs, done the suggested changes and some minor adjustments of my own.