Skip to content

Latest commit

 

History

History
236 lines (160 loc) · 7.07 KB

CHANGES.org

File metadata and controls

236 lines (160 loc) · 7.07 KB

Changelog

0.9.x

0.9.x is a significant change to the way Nomad works. We’re no longer storing config in one imported EDN file, preferring instead to keep configuration inline next to the code it’s configuring.

In terms of backwards compatibility - users of 0.7.x can still use the nomad namespace exactly as before; users of 0.8.x pre-releases (of which I doubt there are many) can find the functions under the nomad.temp-080-beta namespace.

Both of these will be removed in a future release.

Migration guide:

  • Firstly, move your configuration from EDN into the relevant CLJ namespaces in a defconfig declaration, as described in the README.
  • nomad/environments, nomad/hosts and nomad/instances have all been replaced by a single notion of ‘switches’ (which can be whatever you want them to be).
    ;; --- previously
    {:db {:host "dev-host"
          :username "db-user"
          :port 5432}
    
     :nomad/environments {"beta" {:db {:host "beta-host"
                                       :username "beta-user"}}
                          "live" {:db {:host "live-host"
                                       :username "live-user"}}}}
    
    (let [{:keys [host username port]} (:db (nomad/read-config "my-config.edn"))]
      ...)
    
    
    ;; --- now
    
    (:require [nomad.config :as n])
    
    (n/set-defaults {:switches #{...}}) ; once, at application startup
    
    (defconfig *db-config*
      (merge {:port 5432}
             (n/switch
               :beta {:host "beta-host"
                      :username "beta-user"}
               :live {:host "live-host"
                      :username "live-user"}
               {:host "dev-host"
                :username "db-user"})))
    
    (let [{:keys [host username port]} *db-config*]
      ...)
        
  • #nomad/file, #nomad/resource, #nomad/env-var, #nomad/edn-env-var, #nomad/jvm-prop, #nomad/edn-jvm-prop and #nomad/snippet data readers are no longer required - use standard clojure.core functions/java interop
  • #nomad/secret (0.8.0-beta only) - use (n/secret <key-id> <cipher-text>. Secret keys and cipher text are now expected in base64 format for brevity - use n/hex->b64 to convert existing keys/cipher-text. n/encrypt now returns b64-encoded cipher-text too.

0.9.1

Reinstated env-switches, which disappeared during one of the alphas.

0.8.x

The 0.8.x development branch was a lot of iterations around the core idea. This eventually made it to a beta-quality release, but I was never really convinced about the changes, so it never had a stable release.

0.7.x

0.7.3

Update get-hostname to use Java interop rather than shelling out - thanks Nicolas Ha!

Thanks also to Yuta Iwama, for refactoring the deep-merge implementation, and Sam Umbach for a doc fix

0.7.2

No breaking changes.

Addition of envf - thanks Martin!

0.7.1

No breaking changes.

Introduced a JVM property reader macro, thanks to Jeff Rose for the suggestion!

Introduced default values for config pulled from environment variables, thanks to Griffin Smith for the PR!

You can now supply your own data-readers to read-config - thanks to @lloydshark for the suggestion!

0.7.0

Thanks to Dylan Paris for his work on this release :)

Big refactoring, adding read-config function. No need to have a defconfig if you only want to read the config once and don’t want to create a var.

Breaking change: Nomad versions later than 0.7.0 are not compatible with Frodo versions earlier than 0.4.1 - please update your Frodo dependency accordingly.

0.6.x

0.6.5 (stable not released)

0.6.5-rc{1,2} were released in preparation for 0.7.0 - see above.

0.6.4

No breaking changes - can now set the Nomad environment by setting the nomad.env Java system property

0.6.3

No breaking changes, changing #nomad/edn-env-var to return nil rather than throwing an ugly exception on missing environment variables.

0.6.2

No breaking changes, adding #nomad/edn-env-var reader macro.

0.6.1

No breaking changes, adding with-location-override

0.6.0

Breaking change - environment config now takes preference over host config. Seems that, if an environment is explicitly specified, the expected behaviour is that the environment config is honoured.

Also, added #nomad/env-var reader macro to read a config value from an environment variable.

Thanks to Oliver Holworthy for these suggestions!

0.5.x

0.5.1

More helpful error message when a snippet can’t be found. No breaking changes.

0.5.0

Minor breaking change - removing the whole :nomad/environments map from the full resulting configuration, in line with :nomad/hosts

0.4.x

0.4.1

Adding in concept of ‘environments’

Minor breaking change - in the config meta-information, :environment now points to the current environment’s config, and the old :environment key can now be found under :location

0.3.x

0.3.3

Handling gracefully when any of the configuration files don’t exist.

No breaking changes.

0.3.2

Allowed private config in the general section, for private files in a known, common location.

No breaking changes.

Thanks Michael Jakl!

0.3.1

Introduced ‘snippets’ using the :nomad/snippets key and the #nomad/snippet reader macro.

No breaking changes.

0.3.0

0.3.0 introduces a rather large breaking change: in the outputted configuration map, rather than lots of :nomad/* keys, all of the current host/current instance maps are merged into the main output map.

In general, you should just be able to replace:

  • (get-in (my-config) [:nomad/current-host :x :y]) with (get-in (my-config) [:x :y])

and

  • (get-in (my-config) [:nomad/current-instance :x :y]) with (get-in (my-config) [:x :y])

unless you have conflicting key names in your general configuration.

0.2.x

0.2.1

Mainly the addition of the private configuration - no breaking changes.

  • Allowed users to add :nomad/private-file key to host/instance maps to specify a private configuration file, which is merged into the :nomad/current-host and :nomad/current-instance maps.
  • Added #nomad/file reader macro
  • Added :nomad/hostname and :nomad/instance keys to :nomad/current-host and :nomad/current-instance maps respectively.

0.2.0

0.2.0 has introduced a couple of breaking changes:

  • get-config, get-host-config and get-instance-config have been removed. Use defconfig as described above in place of get-config; the current host and instance config now live under the :nomad/current-host and :nomad/current-instance keys respectively.
  • Previously, Nomad expected your configuration file to be in a nomad-config.edn file at the root of the classpath. You can now specify the file or resource (or many, in fact, if you use several defconfig invocations) for Nomad to use.

0.1.0

Initial release