Skip to content

Commit

Permalink
v0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DaemonDude23 committed May 25, 2021
1 parent d3a9f09 commit 093869a
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 54 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changelog

- [Changelog](#changelog)
- [v0.6.0](#v060)
- [v0.7.0](#v070)
- [v0.7.0](#v070-1)
- [v0.5.2](#v052)
- [v0.5.1](#v051)
- [v0.5.0](#v050)
Expand All @@ -10,7 +11,12 @@

---

## [v0.6.0](https://github.com/chicken231/helmizer/releases/tag/v0.6.0)
## [v0.7.0](https://github.com/chicken231/helmizer/releases/tag/v0.7.0)

- Catch when no `helmizer` config detected, giving a user-friendly message.
- Added `helmizer.ignore` section to helmizer config. Define path(s) to files to not ignore when constructing the final kustomization.

## [v0.7.0](https://github.com/chicken231/helmizer/releases/tag/v0.7.0)

- Reduce arguments to 1 positional argument pointing to helmizer config file.
- Fix issues with arguments referencing paths.
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ optional arguments:
--debug enable debug logging (default: False)
--dry-run do not write to a file system (default: False)
helmizer_config path to helmizer config file
--quiet, -q quiet output from subprocesses (default: False)
--version show program's version number and exit
helmizer_config path to helmizer config file
```

## Configuration
Expand Down Expand Up @@ -75,6 +75,8 @@ helmizer:
resource-absolute-paths: []
sort-keys: true
version: '0.1.0'
ignore:
- sealed-secrets/templates/helmizer.yaml
kustomize:
namespace: sealed-secrets
resources:
Expand All @@ -100,7 +102,7 @@ The `sealed-secrets` **Helm** chart is used for examples for its small scope.
For local installation/use of the raw script, I use a local virtual environment to isolate dependencies:

```bash
git clone https://github.com/chicken231/helmizer.git -b v0.6.0
git clone https://github.com/chicken231/helmizer.git -b v0.7.0
cd helmizer
```

Expand Down Expand Up @@ -182,7 +184,7 @@ In this example (*Nix OS), we're redirecting program output to the (e.g. `kustom
docker run --name helmizer \
--rm \
-v "$PWD"/examples:/tmp/helmizer -w /tmp/helmizer \
docker.pkg.github.com/chicken231/helmizer/helmizer:v0.6.0 /usr/src/app/helmizer.py \
docker.pkg.github.com/chicken231/helmizer/helmizer:v0.7.0 /usr/src/app/helmizer.py \
./resources/ > ./examples/resources/kustomization.yaml
```

Expand Down
7 changes: 0 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ if [ $# -eq 0 ]; then
exit 1
fi

# pyinstaller
# pyinstaller -y --workpath ./build/pyinstaller/linux/workpath --specpath ./build/pyinstaller/linux/ --distpath ./build/pyinstaller/linux/ src/helmizer.py
# mkdir -p ./build/pyinstaller/linux/releases/
# zip -9 -T -r "./build/pyinstaller/linux/releases/${TAG}.zip" ./build/pyinstaller/linux/helmizer
# unlink ./build/pyinstaller/linux/releases/current || true
# ln -s ./build/pyinstaller/linux/helmizer/helmizer ./build/pyinstaller/linux/releases/current

# docker
DOCKER_CREATE_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
printf "\n * Docker container label (timestamp): %s" "$DOCKER_CREATE_DATE"
Expand Down
8 changes: 4 additions & 4 deletions docs/developers.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Developers

- [Developers](#developers)
- [PyInstaller](#pyinstaller)
- [Linux](#linux)
- [~~PyInstaller~~](#pyinstaller)
- [~~Linux~~](#linux)
- [~~Flatpak~~](#flatpak)
- [Prep release](#prep-release)

## PyInstaller
## ~~PyInstaller~~

- https://pyinstaller.readthedocs.io/en/stable/index.html

### Linux
### ~~Linux~~

1. Install package via `pip`:
```bash
Expand Down
2 changes: 2 additions & 0 deletions examples/commonAnnotations/helmizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ helmizer:
kustomization-file-name: kustomization.yaml
sort-keys: false
version: '0.1.0'
ignore:
- sealed-secrets/templates/helmizer.yaml
kustomize:
namespace: sealed-secrets
resources:
Expand Down
33 changes: 0 additions & 33 deletions org.chicken231.Helmizer.yaml

This file was deleted.

20 changes: 15 additions & 5 deletions src/helmizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ def get_files(self, arguments, key):
for final_target_path in list_target_paths:
list_final_target_paths.append(path.relpath(final_target_path, str_kustomization_path))

# remove any ignored files
try:
for ignore in self.helmizer_config['helmizer']['ignore'].get(list):
list_final_target_paths.remove(ignore)
except ValueError:
pass
except NotFoundError:
pass

return list_final_target_paths

except NotFoundError:
Expand Down Expand Up @@ -229,11 +238,10 @@ def init_arg_parser():
args = parser.add_argument_group()
args.add_argument('--debug', dest='debug', action='store_true', help='enable debug logging', default=False)
args.add_argument('--dry-run', dest='dry_run', action='store_true', help='do not write to a file system', default=False)
args.add_argument('helmizer_config', action='store', type=str,
help='path to helmizer config file')
args.add_argument('--quiet', '-q', dest='quiet', action='store_true', help='quiet output from subprocesses',
default=False)
args.add_argument('--version', action='version', version='v0.6.0')
args.add_argument('--version', action='version', version='v0.7.0')
args.add_argument('helmizer_config', action='store', type=str, help='path to helmizer config file')
arguments = parser.parse_args()

if arguments.quiet:
Expand Down Expand Up @@ -266,9 +274,11 @@ def init_helmizer_config(arguments):
logging.debug(f'Trying helmizer config path from argument: {str_helmizer_config_path}')
config.set_file(path.normpath(str_helmizer_config_path))
logging.debug(f'parsed config: {config}')

# no config file found. Give up
except confuse.exceptions.ConfigReadError:
# no config file found. Give up
return dict()
logging.error(f'Unable to locate helmizer config. Path provided: {str_helmizer_config_path}')
exit(1)

try:
validate_helmizer_config_version(config['helmizer']['version'].get(str))
Expand Down

0 comments on commit 093869a

Please sign in to comment.