Commit graph

145 commits

Author SHA1 Message Date
Vincent Ambo
063a3e9d30 fix context: Support ".yml" extension on default files
In other places in Kontemplate that deal with YAML files, both the
".yaml" and ".yml" extension are supported.

This fixes context loading code to support that for resource set
variables, too.

This fixes #83
2017-08-25 14:44:24 +02:00
Vincent Ambo
8ccaab322a chore brew: Update Homebrew formula to v1.2.0 2017-08-22 20:02:10 +02:00
Vincent Ambo
4c7ff46c73 chore image: Bump Docker image to build v1.2.0 2017-08-22 20:02:10 +02:00
Vincent Ambo
f8b6ad652d
Version 1.2.0
This release comes with some new features, usability improvements and
a better build & release process.

Features:

* Documentation has been improved significantly, check out the new
  [README][] and follow the links within!
* Extra variables can now be loaded from files on disk. Simply specify
  a list of YAML/JSON files under the 'import' key in your cluster
  context file. Check out #66 for details!
* Resource set paths can now be overridden by users. By default it is
  assumed that the path to a resource set is the same as its name,
  however this is now user-controllable.
  This means the same resource set can be included multiple times
  under different names, for easier including/excluding. See #71 for
  details!
* Kontemplate is currently getting a website that is under construction
  at [kontemplate.works][] - feel free to check it out and
  [give feedback][]!

Fixes:

* Windows release binaries now have the correct filename
* Several potential warning and error messages have been improved

Release binaries are signed with GPG key `66F505681DB8F43B` which is
verified on my Github profile.

[README]: https://github.com/tazjin/kontemplate/blob/master/README.md
[kontemplate.works]: http://kontemplate.works/
[give feedback]: https://github.com/tazjin/kontemplate-website/issues
2017-08-22 19:18:14 +02:00
Vincent Ambo
d22b3694fe feat main: Warn if resource set contains no templates
If a resource set is specified by the user and does _not_ contain any
templates, a warning will now be printed.

This fixes #79
2017-08-22 19:08:29 +02:00
Vincent Ambo
825506d2e9 chore build: Bump dependency versions
Several bugfixes, nothing major. Skipped one "outdated" dependency
because the only change was a new text file.
2017-08-22 18:53:48 +02:00
Vincent Ambo
e8cfa9c119 refactor build: Keep GPG-signatures outside of tarballs
Instead of signing the binary and adding the signature in the release
tarball, keep the GPG-signatures *outside* of the tarball.

This makes it easier to use the built-in GPG-signature verification
features of package managers such as pacman.
2017-08-22 18:41:14 +02:00
Vincent Ambo
a9c450c5a3 fix build: Build Windows executable with correct name
Windows executable filenames must end in ".exe" because the operating
system can't execute them otherwise.

This fixes #73
2017-08-22 18:41:14 +02:00
Vincent Ambo
93425b951c docs: Complete cycle by linking back to kontemplate.works 2017-08-04 23:11:27 +02:00
Vincent Ambo
a159b71a19 style: Apply go fmt 2017-08-04 23:11:27 +02:00
Vincent Ambo
d7569abcca docs: Add tables of content to all documentation files 2017-08-04 23:11:27 +02:00
Vincent Ambo
4adc8f2c4c docs resource-sets: Document resource set structure
Documents the structure of resource sets and the fields necessary for including
them in cluster configurations.

Also adds some words about nested resource sets and the like.
2017-08-04 23:11:27 +02:00
Vincent Ambo
5549968958 docs cluster-config: Document cluster configuration files
Adds documentation for the YAML files describing cluster configuration.
2017-08-04 23:11:27 +02:00
Vincent Ambo
367c5d2b60 docs context: Document ResourceSet & Context struct fields 2017-08-04 23:11:27 +02:00
Vincent Ambo
14d2859720 docs templates: Document some template logic
Adds documentation for `if` and `range` statements in Go templates
and also more explicitly points people at the Go documentation for
more information.
2017-08-04 23:11:27 +02:00
Vincent Ambo
658c6a9b0c docs README: Update feature list
Adds a feature list with links to individual feature description
documents.
2017-08-04 23:11:27 +02:00
Vincent Ambo
5e7bb55e00 refactor templater: Use resource set 'path' field when loading files 2017-07-13 16:07:08 +02:00
Vincent Ambo
7607f6dc0f feat context: Allow overriding resource set paths
Instead of always inferring the path at which files in a resource set
are located, let users override the path by specifying a `path` field.

This makes it possible to add the same resource set multiple times
with different values while still keeping distinct names for
addressability (for example when using include/exclude).

This fixes #70
2017-07-13 16:07:08 +02:00
Vincent Ambo
9d26c17f13 feat context: Add ability to import extra variables from files
Kontemplate context specifications can now load extra variables from YAML
or JSON files by specifying a list of files (relative to the context file)
under the `import` key.
2017-07-03 14:27:48 +02:00
Vincent Ambo
68e1e48459 feat build: Test if 'go fmt' has been applied 2017-07-03 14:27:48 +02:00
Vincent Ambo
8c7a3d6c30 feat build: Run go vet before building 2017-07-03 14:27:48 +02:00
Vincent Ambo
5bc6370af2 fix main: Correctly print kubectl errors 2017-07-03 14:27:48 +02:00
Vincent Ambo
3728d0ae2e refactor context: Extract loadJsonOrYaml to util package
The logic to deserialise a structure from *either* JSON or YAML is reused several
times and can be easily extracted, which this commit does.
2017-07-03 14:27:48 +02:00
Dr. J. Kubernaught
e2f7cf6258 docs: Add official code of conduct
As dictated by the goddess to the eternal polyfather of love.

Signed-off-by: Reverend Dr. J. Kubernaughtt The Most Recent <tazjin@gmail.com>
2017-06-22 15:12:51 +02:00
Vincent Ambo
5144842e97 chore: Update Brew formula & Dockerfile to 1.1.0 2017-06-11 23:47:59 +02:00
Vincent Ambo
e2be6152f9 chore: Release version 1.1.0
This release features some cleanup and under-the-hood changes, as well
as "ecosystem-features" that don't directly affect the way Kontemplate
itself functions.

* Resource-sets are now passed on to kubectl in individual
  invocations. This means that kubectl errors can be scoped to
  individual resource set files and issues such as #51 are less of a
  problem.
* A Dockerfile is provided and published at `tazjin:kontemplate` on
  Docker Hub. This image contains `kontemplate`, `kubectl` and `pass`
  and can be used - for example - as an image for a step in a CI
  system.
* Kontemplate is now available on Homebrew, check the README for
  installation instructions.

* If different resource sets don't contain `---` separators in YAML,
  `kubectl` calls will no longer fail. (#51)
* Autocompleted trailing slashes in shells are now filtered from
  include & exclude lists to enhance the CLI experience slightly.
2017-06-11 23:47:59 +02:00
Vincent Ambo
3a2f00f29f chore: Update dependencies 2017-06-11 23:16:22 +02:00
Vincent Ambo
cf5e392baf feat: Add shell script to check if dependencies are up-to-date 2017-06-11 23:16:22 +02:00
Vincent Ambo
a7781b169d fix templater: Ignore slash-suffixes on includes/excludes
To prevent situations where a shell auto-appends a slash to an
include/exclude specification on the CLI, trailing slashes in those
string lists are now trimmed.

This fixes #54
2017-06-11 22:33:07 +02:00
Vincent Ambo
3cba344fbe fix main: Fix 'kontemplate template' output 2017-06-11 22:09:10 +02:00
Vincent Ambo
162b962fad refactor main: Call kubectl individually per resource set
Instead of passing the rendered output of all resource sets to kubectl
simultaneously, build upon the previous commit and pass resource sets
individually to new instances of kubectl.

This resolves #51
2017-06-11 22:09:10 +02:00
Vincent Ambo
f3264329b9 refactor templater: Add intermediate type to represent rendered RSes
As a first step in resolving #51 this refactors the `templater`
package to return rendered resource sets as a distinct type.

This also fixes #56
2017-06-11 22:09:10 +02:00
Vincent Ambo
d76ea59f4c feat image: Add Dockerfile for CI pipeline image
Adds a simple Docker image that can be used in CI pipelines to deploy
`kontemplate`-based environments.

This image contains kontemplate and all of its dependencies (including
pass as an optional dependency).
2017-06-07 10:05:56 +02:00
Vincent Ambo
9923b1e64d docs README: Update installation instructions 2017-05-18 20:54:44 +02:00
Vincent Ambo
de4171da31 feat build: Add Homebrew binary formula
Adds a Homebrew formula that downloads and installs the 1.0.2 binary release.

Users should be able to "tap" this formula from OS X, the README will be updated in a separate commit.

This fixes #41
2017-05-18 20:35:00 +02:00
Vincent Ambo
f79b261079 chore: Version bump to 1.0.2 2017-05-18 19:41:18 +02:00
Vincent Ambo
aadea2f698 feat build: Add Repeatr formula for repeatable builds
Adds a formula for Repeatr (http://repeatr.io/) that can be used to
build kontemplate in a repeatable way with pinned dependencies.

Fixes #47
2017-05-18 19:38:21 +02:00
Vincent Ambo
c45e616258 fix main: Print information about kubectl errors 2017-05-08 14:29:47 +02:00
Vincent Ambo
cb6413bff7 fix main: Exit with kubectl status code
If kubectl fails during a kontemplate run, kontemplate should also
exit with a non-zero status code.

This fixes #43
2017-05-08 14:20:45 +02:00
Vincent Ambo
20ccc33347 docs: Mention AUR package in README 2017-05-08 13:53:24 +02:00
Vincent Ambo
d15dfefce2 feat build: Add ArchLinux PKGBUILD 2017-05-08 13:47:53 +02:00
Vincent Ambo
1e3ecad709 feat release: Add simple release script
Adds a simple script that will build stripped binaries for various platforms
and GPG-sign them.
2017-05-08 11:15:20 +02:00
Vincent Ambo
d93bc51e86 feat main: Add version command
Adds a version command that can have the Kontemplate git hash added to it at
build time by using the Go linker's -X flag.
2017-05-08 11:15:20 +02:00
Vincent Ambo
9b2d102bbf docs: Add note about binary releases to README 2017-05-08 10:37:24 +02:00
Vincent Ambo
c2a8f8784f docs: Add more information to README 2017-05-08 10:37:24 +02:00
Vincent Ambo
5bc67f4271 docs: Add some tips and tricks 2017-05-08 10:37:24 +02:00
Vincent Ambo
7644a1f675 docs: Document template format 2017-05-08 10:37:24 +02:00
Vincent Ambo
211289765a docs README: Update usage examples for kingpin CLI 2017-05-04 18:49:43 +02:00
Vincent Ambo
c8a63861ae refactor main: Move to Kingpin CLI library
Replace urfave/cli with the kingpin[1] library.

It has slightly more sensible argument validation than the other Go libraries.

Additionally I've opted for removing the '-f / --file' flag in favour of positional arguments to commands.

A previous command like `kontemplate template -f somefile.yml` is now just `kontemplate template somefile.yml`. All other arguments remain the same.

[1]: https://github.com/alecthomas/kingpin
2017-05-04 18:49:43 +02:00
Vincent Ambo
32ca64c50a feat templater: Warn if no valid resource sets are included
After filtering resource sets, check whether any resource sets "survived".

Otherwise it can be assumed that the user specified invalid exclude/include
combinations and should be warned about that.

Fixes #35
2017-05-04 18:45:03 +02:00