From be52c6e0c93e1b69d1b5ce3d2c69da459ad6286d Mon Sep 17 00:00:00 2001 From: Adrian Chifor Date: Thu, 31 May 2018 14:29:29 +0100 Subject: [PATCH 1/2] Added CHANGELOG.md and automating the release process --- .gitignore | 1 + CHANGELOG.md | 100 ++++++++++++++++++++++++++++++++++++++++++++++++ make_release.sh | 47 +++++++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 CHANGELOG.md create mode 100755 make_release.sh diff --git a/.gitignore b/.gitignore index ad083cb2b..62254d841 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.pyc *.swp +*.bak build/ dist/ kapitan.egg-info/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..976822404 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,100 @@ +## 0.16.4: +- Fixed deep_get recursion and search (#108) +- Customizable indentation of yaml/json (#110) + +## 0.16.3: +- Allow recursive search and globbing in searchvar and inventory commands (#97) +- terraform in CI image (#98) +- Updated kube.libjsonnet and fixed secrets example (#101) +- Added secrets info in docs +- Updates to GPG backend functions (#103): + - RSA private keys `?{gpg:common/rsa.key|rsa}` + - Support for pipes `?{gpg:mysql/root/password|randomstr|base64}` + - SHA256 function `?{gpg:mysql/root/password|randomstr|sha256}` + - Deprecated `|randomstrb64` in favor of `|randomstr|base64` + +## 0.16.2: +- Do not escape forward slashes in `json.dump` (#92) +- sha256 jsonnet function (#94) + +## 0.16.1: +- Fix for #81 +- Clearer message for version check (#82) +- Support for jinja2 'do' extension (#89) + +## 0.16.0: +- Updated reclass +- (https://github.com/deepmind/kapitan/pull/78) Support for creating a target secret on compile time, if the secret does not already exist: +``` +?{gpg:path/to/new_secret|randomstr:32} +``` +If `path/to/new_secret` does not exist under `secrets_path` it evaluates `randomstr:32`, which returns a 32 byte-log random string generated by [secrets.token_urlsafe](https://docs.python.org/3/library/secrets.html#secrets.token_urlsafe) and creates the secret with its content. +- (https://github.com/deepmind/kapitan/pull/79) Support for YAML C bindings to improve compilation performance. + +If you're using the pip version of Kapitan, you can benefit from YAML C bindings support by running: + +Linux: `sudo apt-get install python3-yaml` +Mac: `brew install libyaml` + +## 0.15.0: +- Updates to `deepmind/kapitan:ci` Docker image +- `kapitan secrets --write` and `kapitan secrets --update-targets` are now consistent in terms of the recipients list #67 +- Significant performance improvement to `kapitan compile` #71 +- `kapitan compile` now writes the version to `.kapitan` and future executions will check if the last used kapitan version is <= than the current kapitan version, to keep compilations consistent. You can skip version check by doing `kapitan compile --ignore-version-check`. For more info see #57 and #72 + +## 0.14.0: +- Kapitan now requires python 3.6 +- Fixed dockerfile to ensure delegated volumes (#47) +- Fixed missing target compiled directory +- Target compilation error improvements (#62) +- gnupg updated to 0.4.2 +- Inventory target pattern command parsing improvements + +## 0.13.0: +- Added --pattern feature to inventory cli (https://github.com/deepmind/kapitan/issues/41) +- now using python3 lru_cache instead of memoize +- fixed searchvar (https://github.com/deepmind/kapitan/issues/40) + +## 0.12.0: +- moved to python 3 (python 2 should still work but no longer supported) +- updated to jsonnet v0.10.0 +- new yaml jinja2 filter +- target secrets support (https://github.com/deepmind/kapitan/pull/36) +- more tests + +## 0.11.0: +- Supports compiling specific targets +- Breaking change: non inventory target files are gone + +## 0.10.0: +- Supports reading targets from the inventory as well as target files +- Breaking change: the keys in compile items changed, see https://github.com/deepmind/kapitan/pull/22 + +## 0.9.19: +- checks for gpg key expiry +- allow base64 encoding content for secrets +- support for revealing files in directories + +## 0.9.18: +- fixes a bug that overwrites the output_path if it is set to '.' + +## 0.9.17: +- breaking change: the compile command will compile all targets found (https://github.com/deepmind/kapitan/pull/16) +- log/print friendlier error messages avoiding tracebacks for known failure behaviours (https://github.com/deepmind/kapitan/pull/15) (fixes https://github.com/deepmind/kapitan/issues/11) + +## 0.9.16: +- gpg secrets support +- compiled secret tags +- new --reveal flag for compile sub-command +- new --no-verify for secrets sub-command +- new yaml_dump() native jsonnet function + +## 0.9.15: +- Documentation Improvements +- New --version flag +- Now using jsonnet 0.9.5 +- inventory_global in jinja and jsonnet +- Packaged lib/kapitan.libjsonnet + +## 0.9.14: +Initial public version diff --git a/make_release.sh b/make_release.sh new file mode 100755 index 000000000..461900b48 --- /dev/null +++ b/make_release.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +set -e + +if [[ "$#" -ne 1 ]]; then + echo "Please pass version to release (e.g. ./make_release.sh 0.16.5)" + exit 1 +fi + +VERSION=$1 + +sed -i.bak "s/VERSION =.*/VERSION = '$VERSION'/g" ./kapitan/version.py +echo "Updated version on ./kapitan/version.py to $VERSION" + +echo "Making commit and tag for new release..." + +BRANCH=$(git rev-parse --abbrev-ref HEAD) +if [[ "$BRANCH" != "master" ]]; then + echo "Not on master branch, aborting." + exit 1 +fi + +echo "Pulling first..." +git pull + +echo "Committing..." +git add ./kapitan/version.py +git commit -m "Version incremenet $VERSION" + +echo "Tagging..." +git tag "v$VERSION" master + +echo "Pushing..." +git push origin master && git push origin "v$VERSION" + +echo "Making release to PyPi..." +# Install deps +pip3 install --user --upgrade setuptools wheel twine +# Package kapitan +rm -r dist/ build/ +python3 setup.py sdist bdist_wheel +# Upload kapitan to PyPi +twine upload --repository-url https://pypi.org/ dist/* + +echo "Done" +echo +echo "Don't forget to update CHANGELOG.md and the tag release message" From 27e5d2d912072def65461958b51d621f8400436c Mon Sep 17 00:00:00 2001 From: Adrian Chifor Date: Thu, 31 May 2018 14:37:28 +0100 Subject: [PATCH 2/2] Fixed PyPi upload --- make_release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make_release.sh b/make_release.sh index 461900b48..054c0fda9 100755 --- a/make_release.sh +++ b/make_release.sh @@ -40,7 +40,7 @@ pip3 install --user --upgrade setuptools wheel twine rm -r dist/ build/ python3 setup.py sdist bdist_wheel # Upload kapitan to PyPi -twine upload --repository-url https://pypi.org/ dist/* +twine upload dist/* echo "Done" echo