diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml index eb44e86..c45486a 100644 --- a/.github/workflows/container.yaml +++ b/.github/workflows/container.yaml @@ -1,12 +1,12 @@ name: Build & Deploy Container -on: +on: # yamllint disable-line rule:truthy push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] merge_group: - types: [ "checks_requested" ] + types: ["checks_requested"] jobs: build-base: diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml index d985a4d..901aa1b 100644 --- a/.github/workflows/create-tag.yml +++ b/.github/workflows/create-tag.yml @@ -1,7 +1,7 @@ # This action creates a release every second Wednesday name: "Create and push release tag" -on: +on: # yamllint disable-line rule:truthy workflow_dispatch: schedule: - cron: "0 8 * * 3" diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index f43ea60..dbcf372 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -3,29 +3,29 @@ name: Go -on: +on: # yamllint disable-line rule:truthy push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] merge_group: - types: [ "checks_requested" ] + types: ["checks_requested"] jobs: build: runs-on: ubuntu-latest - uses: ./.github/workflows/testdeps.yaml + uses: ./.github/workflows/testdeps.yaml steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: 'stable' - - - name: Build - run: go build -v ./... + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 'stable' - - name: Test - run: go test -v ./... + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... diff --git a/.github/workflows/pr_best_practices.yml b/.github/workflows/pr_best_practices.yml index d7a1b0c..9ceb2c1 100644 --- a/.github/workflows/pr_best_practices.yml +++ b/.github/workflows/pr_best_practices.yml @@ -1,6 +1,6 @@ name: "Verify PR best practices" -on: +on: # yamllint disable-line rule:truthy pull_request_target: branches: [main] types: [opened, synchronize, reopened, edited] diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 5af8e5a..34c8672 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -1,26 +1,25 @@ name: Integration tests -on: +on: # yamllint disable-line rule:truthy push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] merge_group: - types: [ "checks_requested" ] + types: ["checks_requested"] jobs: build: runs-on: ubuntu-latest - uses: ./.github/workflows/testdeps.yaml + uses: ./.github/workflows/testdeps.yaml steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + - name: Install integration test env + run: | + sudo apt update + sudo apt install -y pytest golang - - name: Install integration test env - run: | - sudo apt update - sudo apt install -y pytest golang - - - name: Run integration tests via pytest - run: | - # use "-s" for now for easier debugging - sudo pytest -s -v + - name: Run integration tests via pytest + run: | + # use "-s" for now for easier debugging + sudo pytest -s -v diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e2cca3..5b33a5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ name: "Create GitHub release" -on: +on: # yamllint disable-line rule:truthy push: tags: - "v*" diff --git a/.github/workflows/testdeps.yaml b/.github/workflows/testdeps.yaml index 85f9de1..4dbdc5d 100644 --- a/.github/workflows/testdeps.yaml +++ b/.github/workflows/testdeps.yaml @@ -1,6 +1,6 @@ name: Install common test dependencies -on: +on: # yamllint disable-line rule:truthy workflow_call: jobs: diff --git a/.gitignore b/.gitignore index 78b5bfc..e4dda68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ rpmbuild vendor release_artifacts +*.swp +dictionary.dic +__pycache__ diff --git a/.packit.yaml b/.packit.yaml index 6416e3c..7e400a8 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -3,8 +3,8 @@ specfile_path: image-builder-cli.spec files_to_sync: - - image-builder-cli.spec - - .packit.yaml + - image-builder-cli.spec + - .packit.yaml copy_upstream_release_description: true @@ -24,39 +24,39 @@ actions: upstream_tag_include: 'v\d+' jobs: -# image-builder-cli is not yet in Fedora, so we don't need to update it there -# - job: bodhi_update -# trigger: commit -# dist_git_branches: -# - fedora-branched # rawhide updates are created automatically -# - job: koji_build -# trigger: commit -# dist_git_branches: -# - fedora-all -# - job: propose_downstream -# trigger: release -# dist_git_branches: -# - fedora-all -- job: copr_build - trigger: pull_request - targets: &build_targets - - centos-stream-9-aarch64 - - centos-stream-9-s390x - - centos-stream-9-ppc64le - - centos-stream-9-x86_64 - - centos-stream-10-aarch64 - - centos-stream-10-s390x - - centos-stream-10-ppc64le - - centos-stream-10-x86_64 - - fedora-all-aarch64 - - fedora-all-s390x - - fedora-all-ppc64le - - fedora-all - - rhel-9-aarch64 - - rhel-9-x86_64 -- job: copr_build - trigger: commit - branch: main - owner: "@osbuild" # copr repo namespace - project: image-builder-cli # copr repo name so you can consume the builds - targets: *build_targets + # image-builder-cli is not yet in Fedora, so we don't need to update it there + # - job: bodhi_update + # trigger: commit + # dist_git_branches: + # - fedora-branched # rawhide updates are created automatically + # - job: koji_build + # trigger: commit + # dist_git_branches: + # - fedora-all + # - job: propose_downstream + # trigger: release + # dist_git_branches: + # - fedora-all + - job: copr_build + trigger: pull_request + targets: &build_targets + - centos-stream-9-aarch64 + - centos-stream-9-s390x + - centos-stream-9-ppc64le + - centos-stream-9-x86_64 + - centos-stream-10-aarch64 + - centos-stream-10-s390x + - centos-stream-10-ppc64le + - centos-stream-10-x86_64 + - fedora-all-aarch64 + - fedora-all-s390x + - fedora-all-ppc64le + - fedora-all + - rhel-9-aarch64 + - rhel-9-x86_64 + - job: copr_build + trigger: commit + branch: main + owner: "@osbuild" # copr repo namespace + project: image-builder-cli # copr repo name so you can consume the builds + targets: *build_targets diff --git a/HACKING.md b/HACKING.md index 54380e7..40326ce 100644 --- a/HACKING.md +++ b/HACKING.md @@ -9,7 +9,7 @@ We have unit tests and some integration testing. To work on bootc-image-builder one needs a working Go environment. See [go.mod](go.mod). -To run the testsuite install the test dependencies as outlined in the +To run the test suite install the test dependencies as outlined in the [github action](./.github/workflows/go.yml) under "Install test dependencies". diff --git a/README.md b/README.md index 69d21e9..f1d9a54 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # image-builder CLI -Build images from the commandline in a convenient way. +Build images from the command line in a convenient way. ## Run via container @@ -19,7 +19,7 @@ This project is under development right now and needs to be run via: ```console $ go run github.com/osbuild/image-builder-cli/cmd/image-builder@main ``` -or install it into $GOPATH/bin +or install it into `$GOPATH/bin` ```console $ go install github.com/osbuild/image-builder-cli/cmd/image-builder@main ``` @@ -29,7 +29,7 @@ we plan to provide rpm packages as well. ## Prerequisites -Make sure to have the required `osbuild` rpms installed: +Make sure to have the required `osbuild` RPMs installed: ```console $ sudo dnf install osbuild osbuild-depsolve-dnf osbuild-composer ``` @@ -80,7 +80,7 @@ The following filters are currently supported, shell-style globbing is supported * distro: the distro name (e.g. fedora-41) * arch: the architecture name (e.g. x86_64) * type: the image type name (e.g. qcow2) - * bootmode: the bootmode (legacy, uefi, hybrid) + * bootmode: the bootmode (legacy, UEFI, hybrid) The output can also be switched, supported are "text", "json": ```console @@ -124,7 +124,7 @@ A: The osbuild binary is used to actually build the images but beyond that * **Website**: * **Bug Tracker**: - * **Discussions**: https://github.com/orgs/osbuild/discussions + * **Discussions**: * **Matrix (chat)**: [Image Builder channel on Fedora Chat](https://matrix.to/#/#image-builder:fedoraproject.org?web-instance[element.io]=chat.fedoraproject.org) * **Changelog**: diff --git a/test/containerbuild.py b/test/containerbuild.py index bf5a4bc..4b29a56 100644 --- a/test/containerbuild.py +++ b/test/containerbuild.py @@ -1,10 +1,4 @@ -import os -import platform -import random -import string import subprocess -import textwrap -from contextlib import contextmanager import pytest diff --git a/test/test_container.py b/test/test_container.py index 45442ab..8268534 100644 --- a/test/test_container.py +++ b/test/test_container.py @@ -3,8 +3,6 @@ import subprocess import pytest -from containerbuild import build_container_fixture - @pytest.mark.skipif(os.getuid() != 0, reason="needs root") def test_container_builds_image(tmp_path, build_container): @@ -24,4 +22,3 @@ def test_container_builds_image(tmp_path, build_container): # XXX: ensure no other leftover dirs dents = os.listdir(output_dir) assert len(dents) == 1, f"too many dentries in output dir: {dents}" -