> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# bjd2385/general

A collection of helpful reusable jobs for GitHub, Helm, PyPi, CircleCI orbs, etc.


## Commands

### docker-login

Login to Docker registry


| Parameter | Type | Default | Description |
|---|---|---|---|
| `domain` | string | $DOCKER_DOMAIN | Docker registry URL. |
| `password` | string | $DOCKER_PASSWORD | Docker password. |
| `username` | string | $DOCKER_USERNAME | Docker username. |

### helm-login

Login to Helm repositories.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `password` | string | $HELM_PASSWORD | Nexus Helm repository password. |
| `repo` | string | $HELM_REPOSITORY_URL | Nexus Helm repository URL. |
| `repo-name` | string | helm-repo | Name to give Helm repository. |
| `username` | string | $HELM_USERNAME | Nexus Helm repository username. |

### loft-connect

Connect to a Kubernetes cluster via the loft.sh CLI.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `cluster` | string | $CLUSTER | Cluster name to connect to. |
| `loft-access-key` | string | $LOFT_ACCESS_KEY | Loft.sh access key. |
| `loft-url` | string | $LOFT_URL | Loft.sh deployment's domain. |
| `loft-version` | string | v3.2.0 | Loft.sh CLI version to install. |

### orb-pre-pack

Command for pre-packing orbs.


### orb-rev-pack

Command for reverse-pre-packing orbs.


### python-install-poetry

Install poetry

| Parameter | Type | Default | Description |
|---|---|---|---|
| `poetry-version` | string | 1.5.1 | Poetry version to install. |

## Jobs

### docker-github

Build and push Docker containers to the GitHub Container Registry (ghcr.io).

Requires a context with $GITHUB_TOKEN and $GITHUB_USER set to authenticate.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `args` | string |  | Additional args string to add to the build command. (E.g., '--build-arg HELLO=WORLD'.) |
| `commit-tag` | boolean | false | Whether or not to push an additional tag to the registry with the commit hash as the tag. |
| `image-name` | string |  | Name of the image. |
| `path` | string | . | Path to the Dockerfile. |
| `resource-class` | enum | medium | Resource class to run as. |
| `tag` | string | latest | Name of the tag for the image. |
| `token` | string | $GITHUB_TOKEN | GitHub token to use with the gh-client. |
| `username` | string | $GITHUB_USERNAME | GitHub user to authenticate with ghcr.io. |

### docker-nexus

Build and push Docker containers to a Nexus Container Registry


| Parameter | Type | Default | Description |
|---|---|---|---|
| `args` | string |  | Additional args string to add to the build command. (E.g., '--build-arg=HELLO=WORLD'.) |
| `commit-tag` | boolean | false | Whether or not to push an additional tag to the registry with the commit hash as the tag. |
| `docker-layer-caching` | boolean | false | Enable DLC on the machine executor. Costs 200 credits / run, however. |
| `image-name` | string |  | Name of the image. |
| `nexus-domain` | string | $DOCKER_DOMAIN | Nexus URL. |
| `password` | string | $DOCKER_PASSWORD | Docker password. |
| `path` | string | Dockerfile | Path to a particular Dockerfile or containing directory with a Dockerfile present. |
| `resource-class` | enum | medium | Resource class to run as. |
| `tag` | string | latest | Name of the tag for the image. |
| `username` | string | $DOCKER_USERNAME | Docker username. |

### github-release

Generate GitHub releases automatically when a repository is tagged. Requires a context with $GITHUB_TOKEN set.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `gh-version` | string | 2.28.0 | Version of the GitHub (gh) CLI to install.

https://github.com/cli/cli/releases
 |
| `resource-class` | enum | small | Resource class to run as. |
| `token` | string | $GITHUB_TOKEN | GitHub token to use with the gh-client. |

### helm-dry-run

Helm upgrade --install --dry-run against a cluster.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `additional-values` | string |  | Additional values.yaml-files to pass to helm. |
| `cluster` | string | $CLUSTER | Cluster name to connect to. |
| `executor` | executor | default |  |
| `install-name` | string |  | The name to give the deployment. |
| `loft-access-key` | string | $LOFT_ACCESS_KEY | Loft.sh access key. |
| `loft-url` | string | $LOFT_URL | Loft.sh deployment's domain. |
| `namespace` | string | default | Cluster namespace to deploy to. |
| `password` | string | $HELM_PASSWORD | Nexus Helm repository password. |
| `repo` | string | $HELM_REPOSITORY_URL | Nexus Helm repository URL. |
| `repo-name` | string | premiscale | Repo alias (helm repo add <alias> <url>). |
| `resource-class` | enum | small |  |
| `username` | string | $HELM_USERNAME | Nexus Helm repository username. |
| `version` | string | $CIRCLE_TAG | Version of the package to publish (helm package --version) |

### helm-lint

Run 'helm lint' against a particular chart. Can be ran against every chart in a repo by using a matrix.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `chart-path` | string | helm/ | Path to Helm chart we wish to lint. |
| `resource-class` | enum | small | Resource class to run as. |

### helm-release-github-pages

Package and upload a Helm chart to a GitHub repository's pages branch.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `chart-path` | string | helm/ | Path to Helm chart we wish to package. |
| `chart-type` | enum | development | Enum of either development or production (determines whether or not to respect Chart.yaml .version-values). |
| `development-package-id` | integer | 1 | Minor version to give development package (irrelevant for production; could be set to \<< pipeline.number >>). |
| `git-email` | string | $GITHUB_EMAIL | Git config user.email. |
| `git-ssh-key-fingerprint` | string |  | A r/w GitHub SSH key, associated both with the repository, project in CircleCI (make sure it's associated with the correct github.com domain name, also). |
| `git-username` | string | $GITHUB_USERNAME | Git config user.name. |
| `helm-repo-domain` | string | https://helm.aperiodicity.com | Chart repo URL associated with GitHub pages (e.g. https://helm.aperiodicity.com). |
| `pages-branch` | string | gh-pages | GitHub pages branch to publish this Helm chart to. |
| `publish-path` | string | charts/development | Which directory in gh-pages to publish this Helm chart. |
| `resource-class` | enum | small | Resource class to run as. |

### helm-release-nexus

Publish Helm packages to Nexus hosted Helm repositories.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `app-version` | string |  | Application version of the package (helm package --app-version) |
| `helm-version` | string | v3.8.2 | Helm version to install. |
| `image-tag` | string |  | Update a Docker image tag in the chart. By default empty, do not execute this step. |
| `image-tag-path` | string | .image.tag | If path is different from .image.tag, update the path here for yq. |
| `password` | string | $HELM_PASSWORD | Nexus Helm repository password. |
| `path` | string | helm/$CIRCLE_PROJECT_REPONAME | Path of the Helm chart to package. Allows the use of matrices for multiple charts. |
| `repo` | string | $HELM_REPOSITORY_URL | Nexus Helm repository URL. |
| `username` | string | $HELM_USERNAME | Nexus Helm repository username. |
| `version` | string | $CIRCLE_TAG | Version of the package to publish (helm package --version) |

### helm-upgrade

Helm upgrade --install on a cluster.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `additional-values` | string |  | Additional values.yaml-files to pass to helm. |
| `cluster` | string | $CLUSTER | Cluster name to connect to. |
| `executor` | executor | default |  |
| `install-name` | string | $CIRCLE_PROJECT_REPONAME | The name to give the deployment. |
| `loft-access-key` | string | $LOFT_ACCESS_KEY | Loft.sh access key. |
| `loft-url` | string | $LOFT_URL | Loft.sh deployment's domain. |
| `namespace` | string | default | Cluster namespace to deploy to. |
| `password` | string | $HELM_PASSWORD | Nexus Helm repository password. |
| `repo` | string | $HELM_REPOSITORY_URL | Nexus Helm repository URL. |
| `repo-name` | string | premiscale | Repo alias (helm repo add <alias> <url>). |
| `resource-class` | enum | small |  |
| `username` | string | $HELM_USERNAME | Nexus Helm repository username. |
| `version` | string | $CIRCLE_TAG | Version of the package to publish (helm package --version) |

### orb-pack

Pre-pack orbs, as I've described in

https://github.com/CircleCI-Public/orb-tools-orb/pull/149


| Parameter | Type | Default | Description |
|---|---|---|---|
| `resource-class` | enum | small | Resource class to run as. |

### orb-unpack

Pre-pack orbs, as I've described in

https://github.com/CircleCI-Public/orb-tools-orb/pull/149


| Parameter | Type | Default | Description |
|---|---|---|---|
| `resource-class` | enum | small | Resource class to run as. |

### python-mypy

Run mypy

| Parameter | Type | Default | Description |
|---|---|---|---|
| `configuration_file` | string | .mypy.ini | Path to mypy configuration file |
| `executor` | executor | python-3-10 | Override the version of Python. |
| `modules_path` | string | src | Path to modules directory in package. |
| `resource-class` | enum | small | Resource class to run as. |

### python-pylint

Run pylint

| Parameter | Type | Default | Description |
|---|---|---|---|
| `configuration_file` | string | .pylintrc | Path to pylint configuration file |
| `executor` | executor | python-3-10 | Override the version of Python. |
| `modules_path` | string | src | Path to modules directory in package. |
| `resource-class` | enum | small | Resource class to run as. |

### python-release-poetry

twine upload

| Parameter | Type | Default | Description |
|---|---|---|---|
| `executor` | executor | python-3-10 | Override default Python executor |
| `password` | string | $TWINE_PASSWORD | PyPi API token. |
| `pypirc-config` | string |  | Location of the .pypirc-file to use. |
| `repository` | string |  | Repository name to upload to. Must have a URL set in .pypirc. |
| `resource-class` | enum | small | Resource class. |
| `username` | string | $TWINE_USERNAME | PyPi username. |
| `version` | string | $CIRCLE_TAG | Override the version of the uploaded artifact in pyproject.toml. |

### python-release-setuptools

Release to PyPi repository. Requires a context with $PYPI_USERNAME and $API_TOKEN set.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `executor` | executor | python-3-10 | Override the version of Python. |
| `password` | string | $TWINE_PASSWORD | PyPi API token. |
| `repository` | string | python | Repository name to upload to. |
| `resource-class` | enum | small | Resource class to run as. |
| `username` | string | $TWINE_USERNAME | PyPi username. |

### python-yamale

Validate YAML schema with Yamale.

https://github.com/23andMe/Yamale


| Parameter | Type | Default | Description |
|---|---|---|---|
| `path` | string | . | Path containing YAML files to validate. |
| `resource-class` | enum | small | Resource class to run as. |
| `schema-path` | string | config/schema.yaml | Path to the schema file to validate with Yamale. |

## Executors

### default

base default CircleCI executor.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `tag` | string | stable-20.04 | Default Ubuntu 20.04 executor. |

### machine

Docker build / machine executor.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `caching` | boolean | false | Enable Docker layer caching |
| `tag` | string | 2204:2022.07.1 | Ubuntu version string to use. |

### python-3-8

Python executor.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `tag` | string | 3.8.13 | Python tag to use. |

### python-3-9

Python executor.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `tag` | string | 3.9.13 | Python tag to use. |

### python-3-10

Python executor.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `tag` | string | 3.10.6 | Python tag to use. |