tagen

Crates.iotagen
lib.rstagen
version0.1.0
sourcesrc
created_at2022-09-23 13:33:42.288106
updated_at2022-09-23 13:33:42.288106
descriptionGenerates lots of tags by version and variants.
homepagehttps://github.com/siketyan/tagen
repositoryhttps://github.com/siketyan/tagen.git
max_upload_size
id672498
size15,477
Naoki Ikeguchi (siketyan)

documentation

README

🔖 tagen

Generates lots of tags by version and variants.

🚀 Motivation

When tagging Docker images or GitHub Actions, we often use lots of tag variants something like:

rust:1.64.0
rust:1.64.0-bullseye-slim
rust:1.64-bullseye
rust:1.64
rust:1

This style is very convenient for image users, but it is difficult to list them correctly. We tried to generate these automatically from the given version and variants.

📦 Getting Started

CLI

If you do NOT want to use tagen on your code, use this installation.

Using Cargo

cargo install tagen --features=cli 

Rust API

tagen is a hybrid crate, this mean you can use it on your own code.

[dependencies]
tagen = "0.1"

Well done!

💚 Examples

Let's start with the simplest style:

tagen 1.64.0

It generates:

1
1.64
1.64.0

Easy!

Now add variants to them:

tagpr 1.64.0 bullseye slim

It generates:

1-bullseye-slim
1-slim
1.64-bullseye-slim
1.64-slim
1.64.0-bullseye-slim
1.64.0-slim

Note that variants are shorten to right variant: a b c variants to be a-b-c, b-c, and c. a and a-b are not generated in this case to avoid conflicting with a or a b variants.

Commit count: 2

cargo fmt