Skip to main content

ichec_cicd

This project is a collection of utilities for managing CI/CD pipelines at ICHEC.

It provides opinionated interfaces to encourage standarization of our project structures and workflows.

Install

The package is available from PyPI:

pip install ichec_cicd

Features

Deploy a Package to a Repository

From the package's top-level directory:

ichec_cicd deploy --token $REPO_TOKEN

As an example, for a Python project this might be the PyPI repository's token.

Set a Package's Version Number

From the package's top-level directory:

ichec_cicd set_version $VERSION

Increment a Repository's Tag

From the repository's top-level directory, and on the branch the tag will be dervied from:

ichec_cicd increment_tag --field patch

Here semver tag versioning is assumed with a major.minor.patch scheme. Note: in a CI/CD pipeline some more input options are needed to initialize the git repo for pushing the tag to. You can use the --help flag for more details.

Sync Content With an External Upstream

Here we pull content from an external upstream repository and use it to update the content in a local repo. This can be useful for public mirrors that include a subset of the content in an internal repo.

ichec_cicd sync_external_archive \
    --source_token $SOURCE_TOKEN \ 
    --project_id $SOURCE_PROJ_ID \
    --sync_script $MY_SYNC_SCRIPT \
    --asset_name $ASSET_NAME \
    --archive_name $ARCHIVE_NAME \
    --target_token $TARGET_TOKEN

The inputs are:

  • SOURCE_TOKEN: Gitlab access token for the source (private) repo - must have asset download rights
  • SOURCE_PROJ_ID: The numeric project ID for the source repo
  • MY_SYNC_SCRIPT: Path to a script that will use the extracted contents of the source archive to update the target repo
  • ASSET_NAME: Name of the asset corresponding to the archive in the source repo's latest release collection
  • ARCHIVE_NAME: Name of the downloaded file corresponding to the archive - this can differ from the asset name.
  • TARGET_TOKEN: OATH token for the target repo - so that it can be pushed to from a CI runner

Generate a containerfile

Here we generate a containerfile from a template given a release manifest in a repo:

ichec_cicd containerfile generate --manifest <path_to_manifest> --template_dir <container_templates> 

where <path_to_manifest> is the path to an ICHEC release manifest and <container_template> is a directory with container templates.

Containerize a Web App

Here we set up a standardized container build context for web applications, i.e. Django or FastAPI apps.

ichec_cicd wrap --project <project_to_wrap> --template <wrapping_template> 

where <project_to_wrap> is a url or filesystem path to a repository with the project to be wrapped and <wrapping_template> is a url or path to a repository with a template to do the wrapping. The project to be wrapped needs to have an ichec_manifest.yml file at its top level with package metadata and the <wrapping_template> should match the framework being used, e.g. (Django/FastAPI).

Check Prose

Check the repo's Markdown, and the comments in its Python, JavaScript, TypeScript and YAML files, against the house writing style:

ichec_cicd prose

It runs Vale with the ICHEC style in src/ichec_cicd/prose/styles, and limits comment blocks to 3 lines and docstrings to 10. If the repo has a .prose-budget.json, each Markdown file must also stay within its line budget. Run ichec_cicd prose --tighten to create the budget or lower it after a cleanup. Budgets never go up automatically. To raise one, edit the file in the MR.

In a Python repo, run it as a tox env so it runs locally and in CI with everything else.

Licensing

This project is licensed under the MIT License. See the accompanying LICENSE file for details.

Release files for ichec-cicd 0.1.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ichec-cicd 0.1.16
File Size Uploaded
ichec_cicd-0.1.16.tar.gz 25.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ichec-cicd 0.1.16
File Interpreter ABI Platform
ichec_cicd-0.1.16-py3-none-any.whl Python 3 none any Details

Total release size: 54.1 kB

Release files / ichec_cicd-0.1.16.tar.gz

Download URL ichec_cicd-0.1.16.tar.gz
Size 25.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1507dc63b3699465fd0c4b080762d084e93573330375ecfbea2c6c7361c4d2a5
BLAKE2b-256 checksum
How to use checksums
fbb68db3610f2d98e565f29c177a1933d41b8694e1532903f9609a3ada93fede
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / ichec_cicd-0.1.16-py3-none-any.whl

Download URL ichec_cicd-0.1.16-py3-none-any.whl
Size 29.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae2591d0b866730b368ce583dcf105a50199184c30eb033277a22a9bd347269a
BLAKE2b-256 checksum
How to use checksums
0e6e93ce16318834339a72eef5f913fa7c035bed4b6f98f15ffa3806a81735e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.16 This release

2 release files

0.1.15

2 release files

0.1.13

2 release files

0.1.12

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page