prepare all syntax for linters and spellchecks
This commit is contained in:
parent
b932d218e3
commit
734c132500
13 changed files with 84 additions and 91 deletions
8
.github/workflows/container.yaml
vendored
8
.github/workflows/container.yaml
vendored
|
|
@ -1,12 +1,12 @@
|
||||||
name: Build & Deploy Container
|
name: Build & Deploy Container
|
||||||
|
|
||||||
on:
|
on: # yamllint disable-line rule:truthy
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
merge_group:
|
merge_group:
|
||||||
types: [ "checks_requested" ]
|
types: ["checks_requested"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-base:
|
build-base:
|
||||||
|
|
|
||||||
2
.github/workflows/create-tag.yml
vendored
2
.github/workflows/create-tag.yml
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
# This action creates a release every second Wednesday
|
# This action creates a release every second Wednesday
|
||||||
name: "Create and push release tag"
|
name: "Create and push release tag"
|
||||||
|
|
||||||
on:
|
on: # yamllint disable-line rule:truthy
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 8 * * 3"
|
- cron: "0 8 * * 3"
|
||||||
|
|
|
||||||
30
.github/workflows/go.yaml
vendored
30
.github/workflows/go.yaml
vendored
|
|
@ -3,29 +3,29 @@
|
||||||
|
|
||||||
name: Go
|
name: Go
|
||||||
|
|
||||||
on:
|
on: # yamllint disable-line rule:truthy
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
merge_group:
|
merge_group:
|
||||||
types: [ "checks_requested" ]
|
types: ["checks_requested"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
uses: ./.github/workflows/testdeps.yaml
|
uses: ./.github/workflows/testdeps.yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: 'stable'
|
go-version: 'stable'
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: go build -v ./...
|
|
||||||
|
|
||||||
- name: Test
|
- name: Build
|
||||||
run: go test -v ./...
|
run: go build -v ./...
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -v ./...
|
||||||
|
|
|
||||||
2
.github/workflows/pr_best_practices.yml
vendored
2
.github/workflows/pr_best_practices.yml
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
name: "Verify PR best practices"
|
name: "Verify PR best practices"
|
||||||
|
|
||||||
on:
|
on: # yamllint disable-line rule:truthy
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
types: [opened, synchronize, reopened, edited]
|
types: [opened, synchronize, reopened, edited]
|
||||||
|
|
|
||||||
29
.github/workflows/pytest.yaml
vendored
29
.github/workflows/pytest.yaml
vendored
|
|
@ -1,26 +1,25 @@
|
||||||
name: Integration tests
|
name: Integration tests
|
||||||
|
|
||||||
on:
|
on: # yamllint disable-line rule:truthy
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
merge_group:
|
merge_group:
|
||||||
types: [ "checks_requested" ]
|
types: ["checks_requested"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
uses: ./.github/workflows/testdeps.yaml
|
uses: ./.github/workflows/testdeps.yaml
|
||||||
steps:
|
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
|
- name: Run integration tests via pytest
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
# use "-s" for now for easier debugging
|
||||||
sudo apt install -y pytest golang
|
sudo pytest -s -v
|
||||||
|
|
||||||
- name: Run integration tests via pytest
|
|
||||||
run: |
|
|
||||||
# use "-s" for now for easier debugging
|
|
||||||
sudo pytest -s -v
|
|
||||||
|
|
|
||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
name: "Create GitHub release"
|
name: "Create GitHub release"
|
||||||
|
|
||||||
on:
|
on: # yamllint disable-line rule:truthy
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
|
|
|
||||||
2
.github/workflows/testdeps.yaml
vendored
2
.github/workflows/testdeps.yaml
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
name: Install common test dependencies
|
name: Install common test dependencies
|
||||||
|
|
||||||
on:
|
on: # yamllint disable-line rule:truthy
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,3 +1,6 @@
|
||||||
rpmbuild
|
rpmbuild
|
||||||
vendor
|
vendor
|
||||||
release_artifacts
|
release_artifacts
|
||||||
|
*.swp
|
||||||
|
dictionary.dic
|
||||||
|
__pycache__
|
||||||
|
|
|
||||||
76
.packit.yaml
76
.packit.yaml
|
|
@ -3,8 +3,8 @@
|
||||||
specfile_path: image-builder-cli.spec
|
specfile_path: image-builder-cli.spec
|
||||||
|
|
||||||
files_to_sync:
|
files_to_sync:
|
||||||
- image-builder-cli.spec
|
- image-builder-cli.spec
|
||||||
- .packit.yaml
|
- .packit.yaml
|
||||||
|
|
||||||
copy_upstream_release_description: true
|
copy_upstream_release_description: true
|
||||||
|
|
||||||
|
|
@ -24,39 +24,39 @@ actions:
|
||||||
upstream_tag_include: 'v\d+'
|
upstream_tag_include: 'v\d+'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# image-builder-cli is not yet in Fedora, so we don't need to update it there
|
# image-builder-cli is not yet in Fedora, so we don't need to update it there
|
||||||
# - job: bodhi_update
|
# - job: bodhi_update
|
||||||
# trigger: commit
|
# trigger: commit
|
||||||
# dist_git_branches:
|
# dist_git_branches:
|
||||||
# - fedora-branched # rawhide updates are created automatically
|
# - fedora-branched # rawhide updates are created automatically
|
||||||
# - job: koji_build
|
# - job: koji_build
|
||||||
# trigger: commit
|
# trigger: commit
|
||||||
# dist_git_branches:
|
# dist_git_branches:
|
||||||
# - fedora-all
|
# - fedora-all
|
||||||
# - job: propose_downstream
|
# - job: propose_downstream
|
||||||
# trigger: release
|
# trigger: release
|
||||||
# dist_git_branches:
|
# dist_git_branches:
|
||||||
# - fedora-all
|
# - fedora-all
|
||||||
- job: copr_build
|
- job: copr_build
|
||||||
trigger: pull_request
|
trigger: pull_request
|
||||||
targets: &build_targets
|
targets: &build_targets
|
||||||
- centos-stream-9-aarch64
|
- centos-stream-9-aarch64
|
||||||
- centos-stream-9-s390x
|
- centos-stream-9-s390x
|
||||||
- centos-stream-9-ppc64le
|
- centos-stream-9-ppc64le
|
||||||
- centos-stream-9-x86_64
|
- centos-stream-9-x86_64
|
||||||
- centos-stream-10-aarch64
|
- centos-stream-10-aarch64
|
||||||
- centos-stream-10-s390x
|
- centos-stream-10-s390x
|
||||||
- centos-stream-10-ppc64le
|
- centos-stream-10-ppc64le
|
||||||
- centos-stream-10-x86_64
|
- centos-stream-10-x86_64
|
||||||
- fedora-all-aarch64
|
- fedora-all-aarch64
|
||||||
- fedora-all-s390x
|
- fedora-all-s390x
|
||||||
- fedora-all-ppc64le
|
- fedora-all-ppc64le
|
||||||
- fedora-all
|
- fedora-all
|
||||||
- rhel-9-aarch64
|
- rhel-9-aarch64
|
||||||
- rhel-9-x86_64
|
- rhel-9-x86_64
|
||||||
- job: copr_build
|
- job: copr_build
|
||||||
trigger: commit
|
trigger: commit
|
||||||
branch: main
|
branch: main
|
||||||
owner: "@osbuild" # copr repo namespace
|
owner: "@osbuild" # copr repo namespace
|
||||||
project: image-builder-cli # copr repo name so you can consume the builds
|
project: image-builder-cli # copr repo name so you can consume the builds
|
||||||
targets: *build_targets
|
targets: *build_targets
|
||||||
|
|
|
||||||
|
|
@ -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
|
To work on bootc-image-builder one needs a working Go environment. See
|
||||||
[go.mod](go.mod).
|
[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
|
[github action](./.github/workflows/go.yml) under
|
||||||
"Install test dependencies".
|
"Install test dependencies".
|
||||||
|
|
||||||
|
|
|
||||||
10
README.md
10
README.md
|
|
@ -1,6 +1,6 @@
|
||||||
# image-builder CLI
|
# 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
|
## Run via container
|
||||||
|
|
||||||
|
|
@ -19,7 +19,7 @@ This project is under development right now and needs to be run via:
|
||||||
```console
|
```console
|
||||||
$ go run github.com/osbuild/image-builder-cli/cmd/image-builder@main
|
$ 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
|
```console
|
||||||
$ go install github.com/osbuild/image-builder-cli/cmd/image-builder@main
|
$ 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
|
## Prerequisites
|
||||||
|
|
||||||
Make sure to have the required `osbuild` rpms installed:
|
Make sure to have the required `osbuild` RPMs installed:
|
||||||
```console
|
```console
|
||||||
$ sudo dnf install osbuild osbuild-depsolve-dnf osbuild-composer
|
$ 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)
|
* distro: the distro name (e.g. fedora-41)
|
||||||
* arch: the architecture name (e.g. x86_64)
|
* arch: the architecture name (e.g. x86_64)
|
||||||
* type: the image type name (e.g. qcow2)
|
* 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":
|
The output can also be switched, supported are "text", "json":
|
||||||
```console
|
```console
|
||||||
|
|
@ -124,7 +124,7 @@ A: The osbuild binary is used to actually build the images but beyond that
|
||||||
|
|
||||||
* **Website**: <https://www.osbuild.org>
|
* **Website**: <https://www.osbuild.org>
|
||||||
* **Bug Tracker**: <https://github.com/osbuild/image-builder-cli/issues>
|
* **Bug Tracker**: <https://github.com/osbuild/image-builder-cli/issues>
|
||||||
* **Discussions**: https://github.com/orgs/osbuild/discussions
|
* **Discussions**: <https://github.com/orgs/osbuild/discussions>
|
||||||
* **Matrix (chat)**: [Image Builder channel on Fedora Chat](https://matrix.to/#/#image-builder:fedoraproject.org?web-instance[element.io]=chat.fedoraproject.org)
|
* **Matrix (chat)**: [Image Builder channel on Fedora Chat](https://matrix.to/#/#image-builder:fedoraproject.org?web-instance[element.io]=chat.fedoraproject.org)
|
||||||
* **Changelog**: <https://github.com/osbuild/image-builder-cli/releases>
|
* **Changelog**: <https://github.com/osbuild/image-builder-cli/releases>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,4 @@
|
||||||
import os
|
|
||||||
import platform
|
|
||||||
import random
|
|
||||||
import string
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import textwrap
|
|
||||||
from contextlib import contextmanager
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ import subprocess
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from containerbuild import build_container_fixture
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(os.getuid() != 0, reason="needs root")
|
@pytest.mark.skipif(os.getuid() != 0, reason="needs root")
|
||||||
def test_container_builds_image(tmp_path, build_container):
|
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
|
# XXX: ensure no other leftover dirs
|
||||||
dents = os.listdir(output_dir)
|
dents = os.listdir(output_dir)
|
||||||
assert len(dents) == 1, f"too many dentries in output dir: {dents}"
|
assert len(dents) == 1, f"too many dentries in output dir: {dents}"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue