Skip to content

Commit

Permalink
v0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DaemonDude23 committed Jan 22, 2022
1 parent 5d4851a commit 195cba5
Show file tree
Hide file tree
Showing 12 changed files with 175 additions and 21 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Package Application with Pyinstaller
on:
push:
branches: [ main ]
# tags:
# - 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: PyInstaller Linux
uses: JackMcKew/pyinstaller-action-linux@0.1.4
with:
path: src
spec: helmizer-linux-x86_64.spec
- name: PyInstaller Windows
uses: JackMcKew/pyinstaller-action-windows@v0.1.2
with:
path: src
spec: helmizer-windows-x86_64.spec
- name: Release
uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
prerelease: true
# tag_name: pyinstaller
fail_on_unmatched_files: true
files: |
src/dist/linux/helmizer-linux-x86_64
src/dist/windows/helmizer-windows-x86_64.exe
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ repos:
id: check-added-large-files
- id: requirements-txt-fixer
- id: check-ast
repo: 'git://github.com/pre-commit/pre-commit-hooks'
rev: v4.0.1
repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v4.1.0
- hooks:
- id: black
language_version: python3.9
args:
- --line-length
- "140"
repo: https://github.com/psf/black
rev: 21.10b0
rev: 21.12b0
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
Expand Down
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@
"program": "${workspaceFolder}/src/helmizer.py",
"request": "launch",
"type": "python"
},
{
"args": [
"--debug",
"/home/drew/Nextcloud/TECH/git/private/lab-k8s/flux/kustomize/helm/cert-manager/helmizer.yaml"
],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"name": "TEMP",
"program": "${workspaceFolder}/src/helmizer.py",
"request": "launch",
"type": "python"
}
],
"version": "0.2.0"
Expand Down
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

- [Changelog](#changelog)
- [v0.10.0](#v0100)
- [v0.9.1](#v091)
- [v0.9.0](#v090)
- [v0.8.0](#v080)
Expand All @@ -14,6 +15,23 @@

---

## [v0.10.0](https://github.com/DaemonDude23/helmizer/releases/tag/v0.10.0)

January 21 2022

**Bugfixes**

- Fixed `helmizer.ignore` to optionally ignore directories recursively so that one doesn't have to enumerate each individual file path.

**Enhancements**

- Added CI for generating PyInstaller images for Linux and Windows.

**Housekeeping**

- `pre-commit` updates.
- Tweaked `requirements`.

## [v0.9.1](https://github.com/DaemonDude23/helmizer/releases/tag/v0.9.1)

November 11 2021
Expand All @@ -31,7 +49,7 @@ November 7 2021

- Fixed exceptions when not including keys in helmizer.yaml, falling back to defaults if not defined.

**Enhancements:**
**Enhancements**

- Added configuration support for **all** keys in a kustomization.
- Standardized functions to return various data types depending on kustomization key structure
Expand All @@ -46,7 +64,7 @@ November 7 2021

June 10 2021

**Enhancements:**
**Enhancements**

- Added configuration support for:
- [`components`](https://kubectl.docs.kubernetes.io/guides/config_management/components/)
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,11 @@ sudo ln -s /absolute/path/to/src/helmizer.py /usr/local/bin/helmizer
```
2. Install dependencies:
```bash
# latest and greatest dependency versions
pip3 install -U -r ./src/requirements.txt
pip3 install -U -r ./src/requirements-newest.txt

# more flexible requirements
pip3 install -U -r ./src/requirements-old.txt
```

### virtualenv with pip
Expand Down
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
set -e

TAG="${1}"
#REGISTRY_URL="docker.pkg.github.com/DaeonDude23/helmizer/helmizer"
REGISTRY_URL="docker.k8s.home/daemondude23/helmizer/helmizer"

if [ $# -eq 0 ]; then
Expand Down
39 changes: 39 additions & 0 deletions src/helmizer-linux-x86_64.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(['helmizer.py'],
pathex=['./src/'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)

exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='helmizer-linux-x86_64',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None )
39 changes: 39 additions & 0 deletions src/helmizer-windows-x86_64.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(['helmizer.py'],
pathex=['./src/'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)

exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='helmizer-windows-x86_64',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None )
23 changes: 16 additions & 7 deletions src/helmizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def sort_keys(self):
pass
logging.debug("keys sorted")


def print_kustomization(self):
try:
print(yaml.dump(self.yaml, sort_keys=False))
Expand Down Expand Up @@ -174,20 +173,30 @@ def get_files(self, arguments, key):
elif validate_url(str_child_path):
list_target_paths.append(str_child_path)

# convert absolute paths into paths relative to the kustomization directory
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:
# walk directory to remove multiple files
for ignore in self.helmizer_config["helmizer"]["ignore"].get(list):
logging.debug(f"Removing ignored file from final list: {ignore}")
list_final_target_paths.remove(ignore)
str_ignore_abspath = path.abspath(path.join(str_kustomization_path, ignore))
if path.isdir(str_ignore_abspath):
for (dirpath, _, filenames) in walk(str_ignore_abspath):
for filename in filenames:
file_path = path.join(dirpath, filename)
logging.debug(f"Removing ignored file from final list: {file_path}")
list_target_paths.remove(file_path)
# remove a file
else:
logging.debug(f"Removing ignored file from final list: {path.join(str_kustomization_path, ignore)}")
list_target_paths.remove(path.join(str_kustomization_path, ignore)) # just one file
except ValueError:
pass
except NotFoundError:
pass

# convert absolute paths into paths relative to the kustomization directory
for final_target_path in list_target_paths:
list_final_target_paths.append(path.relpath(final_target_path, str_kustomization_path))

return list_final_target_paths

except NotFoundError:
Expand Down
3 changes: 0 additions & 3 deletions src/requirements-newest.txt

This file was deleted.

4 changes: 4 additions & 0 deletions src/requirements-old.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# these are mostly untested guestimates, but more loose to avoid dependency hell
confuse>=1.0.0 # https://pypi.org/project/confuse/
PyYaml>=5.0.0 # https://pypi.org/project/PyYAML/
validators>=0.14.0 # https://pypi.org/project/validators/
9 changes: 5 additions & 4 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# these are mostly untested guestimates, but more loose to avoid dependency hell
confuse>=1.4.0 # https://pypi.org/project/confuse/
PyYaml>=5.3.1 # https://pypi.org/project/PyYAML/
validators>=0.18.0 # https://pypi.org/project/validators/
confuse==1.6.0
decorator==5.1.0
PyYAML==6.0
six==1.16.0
validators==0.18.0

0 comments on commit 195cba5

Please sign in to comment.