Skip to content

Releases: geofffranks/spruce

Spruce Release v1.0.3

12 Feb 17:17
Compare
Choose a tag to compare

New Features

  • The (( vault )) operator now honors the VAULT_SKIP_VERIFY
    environment variable for handling not-so-awesome SSL/TLS
    certificates on your vault endpoint.

Spruce Release v1.0.2

10 Feb 16:10
Compare
Choose a tag to compare

New Features

  • spruce json is a new subcommand. It allows you to pipe yaml through spruce
    and get json-compatible output.

Bug Fixes

  • Fixed the (( vault )) operator to honor tokens generated from vault auth
  • Fixed the (( vault )) operator to handle HTTP redirects from the Vault API

Miscellaneous

We've updated the CI pipeline to be more awesome. It now generates + uploads
binaries directly to the release as artifacts, without the silly gzip + version
number embedding that used to occur. If you have anything that is automatically
downloading spruce from the latest release, it is likely that you will need to
update your workflow. (THIS IS A BREAKING CHANGE)

Spruce Release v1.0.1

19 Jan 15:54
Compare
Choose a tag to compare

Contains all the awesomeness of v1.0.0 by @jhunt and fixes the version information output by the spruce binary to be correct again.

Spruce Release v1.0.0

19 Jan 15:19
Compare
Choose a tag to compare

New Features

New (( vault ... )) operator allows Spruce templates to reach
out to a Vault (in a previously authenticated session)
and retrieve secrets like passwords and RSA keys, securely.
See Spruce, Vault, Concourse & You for more details.

New (( cartesian-product ... )) operator can be used to combine
two or more lists into their normal cartesian product via
concatenation.

Using (( merge )) in a non-list context now throws an error, to
assist people converting from spiff.

Spruce releases are now compiled with Go 1.5, producing statically
linked binaries that don't need any shared libraries on the host
system.

Bug Fixes

Lists are now merged in (( inject ... )) calls, so the following
snippet does what you would expect:

meta:
  api:
    templates:
      - { release: my-release, name: job1 }
      - { release: my-release, name: job3 }

jobs:
  api:
    .: (( inject meta.api_node ))
    templates:
      - { release: my-other-release, name: a-job }

The (( param ... )) operator now throws an error if an
unoverridden parameter is used as an composite argument to another
operator. Notably, the following snippet now throws an error:

meta:
  domain: (( param "You need a system domain" ))

properties:
  endpoint: (( concat "https://api." meta.domain ":8888" ))

Spruce Release v0.13.0

14 Dec 21:18
Compare
Choose a tag to compare

New Features

New TRACE mode for debugging (activate via --trace) that will
provide even more verbose debugging output. Anything printed
under --debug is not intended to help template authors
troubleshoot merge, override, and operation problems with their
templates. --trace-level debugging is more for assisting spruce
developers in reproducing buggy behavior, or for those of you who
are reallllly interested in spruce internals!

New (( inject ... )) operator for duplicating parts of the YAML
structure elsewhere. These injected sub-structures can then be
overridden at the local level.

Spruce internals got a major overhaul, including a new
merge-eval-check phased approach to template rendering. During
each phase, spruce performs static data-flow analysis to determine
what operations need to be called before what other operations.
This leads to a better end-user experience, and fixes several
classes of bugs related to implicit dependencies and call
ordering.

Operator arguments are now evaluated according to a simple set of
expression rules, allowing alternatives to be specified like so:

(( grab first.option || second.option || nil ))

Bug Fixes

Miscellaneous code cleanups, reformatting and documentation typo and broken
link fixes went into this release.

Specifically fixed some breakage related to numeric keys, as demonstrated in
the examples in the README file. To catch these in the future, the README
examples are now integrated into the unit tests to verify the documentation.

Acknowledgements

Many thanks to James Hunt for inject operator, TRACE mode,
and internals overhaul!

Spruce Release v0.12.0

20 Oct 23:49
Compare
Choose a tag to compare

Bug Fixes

(( concat value "string" )) previously would crash spruce, if value was not a string in the yml output.
This has been resolved

Acknowledgements

Thanks to Ruben Koster for reporting the issue, and James Hunt
for providing a quick fix!

Spruce Release v0.9.0

18 Sep 23:28
Compare
Choose a tag to compare

New Features

spruce now accumulates all errors with your templates, and spits them out all at once,
to reduce churn when fixing large numbers of problems. This may not sound like much,
but it's a huge time saver.

Bug Fixes

None!

Acknowledgements

The error aggregation feature was implemented by James Hunt
and you should thank him for that!

Spruce Release v0.8.0

11 Sep 15:16
Compare
Choose a tag to compare

Bug Fixes

  1. Fixed bad debugging related to (( concat ))
  2. Handle recursive cases for grab and concat

Spruce Release v0.7.0

01 Sep 00:41
Compare
Choose a tag to compare

New Features

  1. Added support for requiring values to be specified in a later template. This
    was something that you could do implicitly with spiff, via (( merge )), and getting
    failure if you didn't define the value. In spruce, this is now something that you can
    explicitly require from downstream templates:

    (( param "Your custom error message here" ))

  2. Added support for concatenating values together, either strings, references, or both:

    (( concat properties.myjob.protocol properties.myjob.host ":" properties.myjob.port

    Concatenation is done after dereferencing, in case any of the properties reference something like
    a static_ip from another node.

  3. Made merging arrays the default behavior (previously, they replaced by default). Since
    everything else merged by default, and most cases want merging this just made sense. When
    merging arrays, spruce will try to do a key-based merge, on the name key, and failing that,
    does an index-based merge.

Bug Fixes

  1. Fixed issue resulting in a panic if specifying static_ips(0) - this should have been a 0-based
    index lookup for greater compatibility with spiff templates.
  2. Fixed an issue where you could not resolve a static IP defined with static_ips(), when
    targeting specific elements in the array - (( jobs.myjob.networks.mynet.static_ips )) worked,
    but (( jobs.myjob.networks.mynet.static_ips.[0] )) did not. It now does. Yay!
  3. Fixed an issue where a panic would occur during postprocessing of keys that had null (~) values). Oops!

Acknowledgements

Thanks to James Hunt for the hard work on param support, array-merge-by-default,
value concatenation, and the nil-reference panic bugfix!

Thanks to Long Nguyen for all the bug reports + field testing!

Spruce Release v0.6.0

29 Aug 15:49
Compare
Choose a tag to compare

Added support for static_ips() and referencing multiple values at once

You can now do things like this:

jobs:
- name: api_z1
  instances: 1
  networks:
  - name: net1
    static_ips: (( static_ips(1, 2, 3) ))
- name: api_z2
  instances: 1
  networks:
  - name: net2
    static_ips: (( static_ips(1, 2, 3) ))

networks:
- name: net1
  subnets:
  - cloud_properties: random
    static:
    - 192.168.1.2 - 192.168.1.30
- name: net2
  subnets:
  - cloud_properties: random
    static:
    - 192.168.2.2 - 192.168.2.30

properties:
  api_servers: (( grab jobs.api_z1.networks.net1.static_ips jobs.api_z2.networks.net2.static_ips ))

And get back the following YAML:

jobs:
- instances: 1
  name: api_z1
  networks:
  - name: net1
    static_ips:
    - 192.168.1.2
    - 192.168.1.3
    - 192.168.1.4
- instances: 1
  name: api_z2
  networks:
  - name: net2
    static_ips:
    - 192.168.2.2
    - 192.168.2.3
    - 192.168.2.4
networks:
- name: net1
  subnets:
  - cloud_properties: random
    static:
    - 192.168.1.2 - 192.168.1.30
- name: net2
  subnets:
  - cloud_properties: random
    static:
    - 192.168.2.2 - 192.168.2.30
properties:
  api_servers:
  - 192.168.1.2
  - 192.168.1.3
  - 192.168.1.4
  - 192.168.2.2
  - 192.168.2.3
  - 192.168.2.4