-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(templates): put labels in
docker-bake.hcl
, use matrices in…
…stead (#14) Signed-off-by: John Muchovej <jmuchovej@users.noreply.github.com> Co-authored-by: John Muchovej <jmuchovej@users.noreply.github.com>
- Loading branch information
Showing
5 changed files
with
88 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,51 @@ | ||
//! How to edit this file: | ||
// 1. In the `default` group (below), you should append `texlive-????` where `????` is | ||
// the year you're adding. | ||
// 2. You should copy the most recent `target` block and take care to update: | ||
// 1. `TEXLIVE_VERSION` | ||
// Cmd+F "Current release": https://tug.org/texlive/ | ||
// 2. `CHKTEX_VERSION` | ||
// Releases here: http://download.savannah.gnu.org/releases/chktex | ||
// 3. `VARIANT` <-- this is based on when the Ubuntu's LTS release schedule | ||
// LTS __standard__ support schedule: https://ubuntu.com/about/release-cycle#ubuntu | ||
//! In the `matrix` component of the `target: "latex"` block, prepend a new object | ||
//! with keys `{ texlive = ????, chktex = ????, variant = ????}`, then update the | ||
//! `variable "LATEST"` block to a default value matching this new entry! | ||
// What the variables in the object you're adding refer to! | ||
// 1. `texlive` <-- this is the year of TeXLive we're building! | ||
// Cmd+F "Current release": https://tug.org/texlive/ | ||
// 2. `chktex` <-- this is the version of `chktex` to install | ||
// Releases here: http://download.savannah.gnu.org/releases/chktex | ||
// 3. `variant` <-- this is based on when the Ubuntu's LTS release schedule | ||
// LTS __standard__ support schedule: https://ubuntu.com/about/release-cycle#ubuntu | ||
|
||
group "default" { | ||
targets = ["texlive2022", "texlive2023", "texlive2024"] | ||
} | ||
|
||
target "shared" { | ||
context = "./" | ||
dockerfile = "Dockerfile" | ||
platforms = [ "linux/amd64", "linux/arm64", ] | ||
variable "LATEST" { | ||
type = string | ||
default = "2024" | ||
} | ||
|
||
target "texlive2024" { | ||
inherits = ["shared"] | ||
args = { | ||
TEXLIVE_VERSION = "2024" | ||
CHKTEX_VERSION = "1.7.9" | ||
VARIANT = "noble" | ||
} | ||
labels = { | ||
"org.opencontainers.image.title" = "LaTeX DevContainer with TeXLive 2024" | ||
} | ||
tags = [ | ||
"ghcr.io/jmuchovej/latex-devcontainer:2024", | ||
"ghcr.io/jmuchovej/latex-devcontainer:latest", | ||
] | ||
group "default" { | ||
targets = [ "latex" ] | ||
} | ||
|
||
target "texlive2023" { | ||
inherits = ["shared"] | ||
args = { | ||
TEXLIVE_VERSION = "2023" | ||
CHKTEX_VERSION = "1.7.8" | ||
VARIANT = "jammy" | ||
} | ||
labels = { | ||
"org.opencontainers.image.title" = "LaTeX DevContainer with TeXLive 2023" | ||
} | ||
tags = [ | ||
"ghcr.io/jmuchovej/latex-devcontainer:2023", | ||
] | ||
} | ||
repo = "https://github.com/jmuchovej/devcontainers" | ||
template = "${repo}/tree/main/src/templates/latex" | ||
image = "ghcr.io/jmuchovej/devcontainers/latex" | ||
|
||
target "texlive2022" { | ||
inherits = ["shared"] | ||
args = { | ||
TEXLIVE_VERSION = "2022" | ||
CHKTEX_VERSION = "1.7.6" | ||
VARIANT = "jammy" | ||
} | ||
labels = { | ||
"org.opencontainers.image.title" = "LaTeX DevContainer with TeXLive 2022" | ||
} | ||
tags = [ | ||
"ghcr.io/jmuchovej/latex-devcontainer:2022", | ||
target "latex" { | ||
matrix = { | ||
item = [ | ||
{texlive = "2024", chktex = "1.7.9", variant = "noble", }, | ||
{texlive = "2023", chktex = "1.7.8", variant = "jammy", }, | ||
{texlive = "2022", chktex = "1.7.6", variant = "jammy", }, | ||
] | ||
} | ||
name = "latex-v${replace(item.texlive, ".", "-")}" | ||
context = "./" | ||
dockerfile = "Dockerfile" | ||
platforms = [ "linux/amd64", "linux/arm64", ] | ||
args = { | ||
VARIANT = item.variant | ||
CHKTEX_VERSION = "${item.chktex}" | ||
TEXLIVE_VERSION = "${item.texlive}" | ||
} | ||
labels = { | ||
"org.opencontainers.image.source" = repo | ||
"org.opencontainers.image.authors" = "John Muchovej <jmuchovej@pm.me>" | ||
"org.opencontainers.image.url" = "${template}" | ||
"org.opencontainers.image.documentation" = "${template}/README.md" | ||
"org.opencontainers.image.title" = "LaTeX Devcontainer with TexLive ${item.texlive}" | ||
} | ||
tags = [ "${image}:${item.texlive}", LATEST == item.texlive ? "${image}:latest" : "", ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,54 @@ | ||
//! How to edit this file: | ||
// 1. In the `default` group (below), you should append `texlive-????` where `????` is | ||
// the year you're adding. | ||
// 2. You should copy the most recent `target` block and take care to update: | ||
// 1. `TYPST_VERSION` | ||
// https://github.com/typst/typst/releases | ||
// 2. `VARIANT` <-- Use the latest Debian, but prefix with Rust major version! | ||
// Cmd+F "rust-version" in https://github.com/typst/typst/blob/main/Cargo.toml | ||
//! In the `matrix` component of the `target: "typst"` block, prepend a new object | ||
//! with keys `{ typst = ????, typstyle = ????, variant = ????}`, then update the | ||
//! `variable "LATEST"` block to a default value matching this new entry! | ||
// What the variables in the object you're adding refer to! | ||
// 1. `typst` <-- this is the year of TeXLive we're building! | ||
// Releases here: https://github.com/typst/typst/releases/latest | ||
// 2. `typstyle` <-- this is the version of `typstyle` to build | ||
// Releases here: http://github.com/Enter-tainer/typstyle/releases/latest | ||
// 3. `variant` <-- this is based on what `mcr.microsoft.com` publishes as the latest | ||
// variant of Rust! see more: | ||
// https://mcr.microsoft.com/en-us/product/devcontainers/rust/about#using_this_image | ||
//* NOTE: this should be the latest Debian **prefixed with the _major version_** | ||
//* found in typst's `Cargo.toml`! | ||
//* Cmd+F "rust-version" in https://github.com/typst/typst/blob/main/Cargo.toml | ||
|
||
group "default" { | ||
targets = [ | ||
"typst-v0-11-1", | ||
"typst-v0-11-0", | ||
] | ||
variable "LATEST" { | ||
type = string | ||
default = "0.11.1" | ||
} | ||
|
||
target "shared" { | ||
context = "./" | ||
dockerfile = "Dockerfile" | ||
platforms = [ "linux/amd64", "linux/arm64", ] | ||
group "default" { | ||
targets = [ "typst" ] | ||
} | ||
|
||
target "typst-v0-11-1" { | ||
inherits = ["shared"] | ||
args = { | ||
TYPST_VERSION = "v0.11.1" | ||
TYPSTYLE_VERSION = "v0.11.32" | ||
VARIANT = "1-bookworm" | ||
} | ||
labels = { | ||
"org.opencontainers.image.title" = "Typst v0.11.1" | ||
} | ||
tags = [ | ||
"ghcr.io/jmuchovej/typst-devcontainer:0.11.1", | ||
"ghcr.io/jmuchovej/typst-devcontainer:latest", | ||
] | ||
} | ||
repo = "https://github.com/jmuchovej/devcontainers" | ||
template = "${repo}/tree/main/src/templates/typst" | ||
iamge = "ghcr.io/jmuchovej/devcontainers/typst" | ||
|
||
target "typst-v0-11-0" { | ||
inherits = ["shared"] | ||
args = { | ||
TYPST_VERSION = "v0.11.0" | ||
TYPSTYLE_VERSION = "v0.11.20" | ||
VARIANT = "1-bookworm" | ||
} | ||
labels = { | ||
"org.opencontainers.image.title" = "Typst v0.11.0" | ||
} | ||
tags = [ | ||
"ghcr.io/jmuchovej/typst-devcontainer:0.11.0", | ||
target "typst" { | ||
matrix = { | ||
item = [ | ||
{typst = "0.11.1", typstyle = "0.11.32", variant = "1-bookworm", }, | ||
{typst = "0.11.0", typstyle = "0.11.20", variant = "1-bookworm", }, | ||
] | ||
} | ||
name = "typst-v${replace(item.typst, ".", "-")}" | ||
context = "./" | ||
dockerfile = "Dockerfile" | ||
platforms = [ "linux/amd64", "linux/arm64", ] | ||
args = { | ||
VARIANT = item.variant | ||
TYPST_VERSION = "v${item.typst}" | ||
TYPSTYLE_VERSION = "v${item.typstyle}" | ||
} | ||
labels = { | ||
"org.opencontainers.image.source" = repo | ||
"org.opencontainers.image.authors" = "John Muchovej <jmuchovej@pm.me>" | ||
"org.opencontainers.image.url" = "${template}" | ||
"org.opencontainers.image.documentation" = "${template}/README.md" | ||
"org.opencontainers.image.title" = "Typst v${item.typst}" | ||
} | ||
tags = [ "${image}:${item.typst}", LATEST == item.typst ? "${image}:latest" : "", ] | ||
} |