Shared workflows across CI/CD pipelines
Project description
Noos Invoke
Software development kit for sharing workflows across CI/CD pipelines.
Such a project aims to enforce parity and reproducability between local development and CI/CD workflows in remote containers (e.g. executable versions, command line calls, environment variables...) - developped with inv[oke].
Installation
Install the package from the PyPi repository:
```bash
$ pip install noos-inv
```
To enable shell completion, execute the following command (e.g. zsh),
```bash
$ noosinv --print-completion-script=zsh
```
And copy/paste its stdout into your shell config.
```bash
# NOOSINV completion script
_complete_noosinv() {
collection_arg=''
if [[ "${words}" =~ "(-c|--collection) [^ ]+" ]]; then
collection_arg=$MATCH
fi
reply=( $(noosinv ${=collection_arg} --complete -- ${words}) )
}
compctl -K _complete_noosinv + -f noosinv
```
Finally, still in your shell config, enable automatic sub shell loading:
```bash
# ENV variable sub shell loading with command "source .env"
set -a
```
Usage as a command line tool
The noos-inv package installs a CLI binary, for managing common CI/CD tasks.
From the terminal,
```bash
$ noosinv
Usage: noosinv [--core-opts] <subcommand> [--subcommand-opts] ...
Subcommands:
docker.build Build Docker image locally.
docker.buildx Build and push x-platform Docker image to a remote registry.
docker.configure Create and configure buildx builder for multi-platform.
docker.login Login to Docker remote registry (AWS ECR or Dockerhub).
docker.pull Pull Docker image from a remote registry.
docker.push Push Docker image to a remote registry.
git.config Setup git credentials with a Github token.
helm.install Provision local Helm client (Chart Museum Plugin).
helm.lint Check compliance of Helm charts / values.
helm.login Login to Helm remote registry (AWS ECR or Chart Museum).
helm.push Push Helm chart to a remote registry (AWS ECR or Chart Museum).
helm.test Test local deployment in Minikube.
local.dotenv Create local dotenv file.
local.ports Forward ports for defined Kubernetes pods.
python.clean Clean project from temp files / dirs.
python.coverage Run coverage test report.
python.format Auto-format source code.
python.lint Run python linters.
python.package Build project wheel distribution.
python.release Publish wheel distribution to PyPi.
python.test Run pytest with optional grouped tests.
terraform.run Run a plan in Terraform cloud.
terraform.update Update variable in Terraform cloud.
```
Source your environnement variables first for a seamless experience.
(use command local.dotenv to create it from the provided template)
```bash
$ source .env
```
Special note on K8S port-forwards
Add the NOOSINV_LOCAL_CONFIG OS variable to your shell config, as the path to a local configuration file:
```json
{
"podForwards": {
"pod_1": {
"podNamespace": "default",
"podPrefix": "service-1-",
"podPort": 80,
"localPort": 8000
},
"pod_2": {
"podNamespace": "test",
"podPrefix": "service-2-",
"podPort": 8080,
"localPort": 8000,
"localAddress": "0.0.0.0"
}
}
}
```
To start port forwarding a specific K8S cluster pod:
```bash
$ noosinv local.ports -p pod_1
```
To kill all previous port forward processes:
```bash
$ noosinv local.ports -u
```
Or previously opened port forward:
```bash
$ noosinv local.ports -p pod_1 -u
```
Development
Make sure poetry has been installed and pre-configured,
This project is shipped with a Makefile, which is ready to do basic common tasks.
```bash
$ make
help Display this auto-generated help message
update Lock and install build dependencies
clean Clean project from temp files / dirs
format Run auto-formatting linters
install Install build dependencies from lock file
lint Run python linters
test Run pytest with all tests
package Build project wheel distribution
release Publish wheel distribution to PyPi
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file noos_inv-0.2.5.tar.gz.
File metadata
- Download URL: noos_inv-0.2.5.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.8 Linux/6.8.0-1024-aws
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5d65be5e81382633f21af1f49c6cefdaa35ec4a23f389ea44b95a6bc2f96a37
|
|
| MD5 |
fa53a140f4cf5938f29410ab133f6866
|
|
| BLAKE2b-256 |
982c99b53a41f662a70241735ceeb6577bdfc8e7468b8b29b33f03722f40c599
|
File details
Details for the file noos_inv-0.2.5-py3-none-any.whl.
File metadata
- Download URL: noos_inv-0.2.5-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.8 Linux/6.8.0-1024-aws
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
908a2ee631f91426b3d6307d2ccca186039e81a5b56c44a30206b87c7dc62a9f
|
|
| MD5 |
e779952784c52c4598060c25784388ce
|
|
| BLAKE2b-256 |
1f89f54e42316a63b7a5dca98f386db1a496188271724fc955178d9bdf5d098a
|