Skip to content

Commit

Permalink
feat(iso): Create generate-iso command (#192)
Browse files Browse the repository at this point in the history
## Tasks

- [x] Add ctrl-c handler to kill spawned children
- [x] add more args to support all variables
- [x] Add integration test
  • Loading branch information
gmpinder authored Sep 4, 2024
1 parent 4634f40 commit e6cce3d
Show file tree
Hide file tree
Showing 25 changed files with 738 additions and 202 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,97 @@ jobs:
bluebuild template -vv | tee Containerfile
grep -q 'ARG IMAGE_REGISTRY=ghcr.io/blue-build' Containerfile || exit 1
bluebuild build --retry-push -B buildah -I podman -S sigstore --squash --push -vv recipes/recipe.yml recipes/recipe-39.yml
iso-from-image:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
needs:
- build
if: needs.build.outputs.push == 'true'

steps:
- name: Maximize build space
uses: ublue-os/remove-unwanted-software@v6

- uses: sigstore/[email protected]

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- uses: actions-rust-lang/setup-rust-toolchain@v1

- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Install bluebuild
run: |
cargo install --path . --debug --all-features
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3

- name: Run Build
env:
GH_TOKEN: ${{ github.token }}
GH_PR_EVENT_NUMBER: ${{ github.event.number }}
COSIGN_PRIVATE_KEY: ${{ secrets.TEST_SIGNING_SECRET }}
BB_BUILDKIT_CACHE_GHA: true
run: |
cd integration-tests/test-repo
bluebuild generate-iso image ghcr.io/blue-build/cli/test:40
iso-from-recipe:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
needs:
- build
if: needs.build.outputs.push == 'true'

steps:
- name: Maximize build space
uses: ublue-os/remove-unwanted-software@v6

- uses: sigstore/[email protected]

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- uses: actions-rust-lang/setup-rust-toolchain@v1

- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Install bluebuild
run: |
cargo install --path . --debug --all-features
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3

- name: Run Build
env:
GH_TOKEN: ${{ github.token }}
GH_PR_EVENT_NUMBER: ${{ github.event.number }}
COSIGN_PRIVATE_KEY: ${{ secrets.TEST_SIGNING_SECRET }}
BB_BUILDKIT_CACHE_GHA: true
run: |
cd integration-tests/test-repo
bluebuild generate-iso -vv recipe recipes/recipe.yml
94 changes: 94 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,97 @@ jobs:
bluebuild template -vv | tee Containerfile
grep -q 'ARG IMAGE_REGISTRY=ghcr.io/blue-build' Containerfile || exit 1
bluebuild build --retry-push -B buildah -I podman -S sigstore --squash --push -vv recipes/recipe.yml recipes/recipe-39.yml
iso-from-image:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
needs:
- build
if: github.repository == 'blue-build/cli'

steps:
- name: Maximize build space
uses: ublue-os/remove-unwanted-software@v6

- uses: sigstore/[email protected]

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- uses: actions-rust-lang/setup-rust-toolchain@v1

- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Install bluebuild
run: |
cargo install --path . --debug --all-features
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3

- name: Run Build
env:
GH_TOKEN: ${{ github.token }}
GH_PR_EVENT_NUMBER: ${{ github.event.number }}
COSIGN_PRIVATE_KEY: ${{ secrets.TEST_SIGNING_SECRET }}
BB_BUILDKIT_CACHE_GHA: true
run: |
cd integration-tests/test-repo
bluebuild generate-iso image ghcr.io/blue-build/cli/test:40
iso-from-recipe:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
needs:
- build
if: github.repository == 'blue-build/cli'

steps:
- name: Maximize build space
uses: ublue-os/remove-unwanted-software@v6

- uses: sigstore/[email protected]

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- uses: actions-rust-lang/setup-rust-toolchain@v1

- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Install bluebuild
run: |
cargo install --path . --debug --all-features
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3

- name: Run Build
env:
GH_TOKEN: ${{ github.token }}
GH_PR_EVENT_NUMBER: ${{ github.event.number }}
COSIGN_PRIVATE_KEY: ${{ secrets.TEST_SIGNING_SECRET }}
BB_BUILDKIT_CACHE_GHA: true
run: |
cd integration-tests/test-repo
bluebuild generate-iso -vv recipe recipes/recipe.yml
57 changes: 56 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ colored = "2"
indexmap = { version = "2", features = ["serde"] }
indicatif = { version = "0.17", features = ["improved_unicode"] }
log = "0.4"
oci-distribution = { version = "0.11.0", default-features = false, features = ["rustls-tls", "rustls-tls-native-roots"] }
miette = "7"
rstest = "0.18"
serde = { version = "1", features = ["derive"] }
Expand All @@ -37,6 +38,7 @@ style = "deny"
nursery = "deny"
pedantic = "deny"
module_name_repetitions = { level = "allow", priority = 1 }
doc_markdown = { level = "allow", priority = 1 }

[package]
name = "blue-build"
Expand Down Expand Up @@ -74,6 +76,7 @@ colored.workspace = true
indicatif.workspace = true
log.workspace = true
miette = { workspace = true, features = ["fancy"] }
oci-distribution.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
Expand All @@ -86,6 +89,7 @@ default = []
stages = ["blue-build-recipe/stages"]
copy = ["blue-build-recipe/copy"]
multi-recipe = ["rayon", "indicatif/rayon"]
iso = []
switch = []
sigstore = ["blue-build-process-management/sigstore"]
login = []
Expand Down
2 changes: 1 addition & 1 deletion process/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ path = "process.rs"

[dependencies]
anyhow = "1"
blue-build-recipe = { version = "=0.8.14", path = "../recipe" }
blue-build-utils = { version = "=0.8.14", path = "../utils" }
expect-exit = "0.5"
indicatif-log-bridge = "0.2"
Expand All @@ -36,6 +35,7 @@ indicatif.workspace = true
indexmap.workspace = true
log.workspace = true
miette.workspace = true
oci-distribution.workspace = true
serde.workspace = true
serde_json.workspace = true
tempdir.workspace = true
Expand Down
Loading

0 comments on commit e6cce3d

Please sign in to comment.