Commit graph

81 commits

Author SHA1 Message Date
dependabot[bot]
bf6645554f build(deps): bump actions/setup-go from 4 to 5
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-17 08:03:08 +00:00
Florian Schüller
4799e233c2 pre-commit: re-enable golangci-lint
Followup of #54
2025-01-16 14:16:31 +00:00
Simon de Vlieger
3fb26dbffe doc: update README
Use the new `--blueprint` in the README.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-16 12:31:13 +00:00
Simon de Vlieger
c1c60a3c77 cmd: --blueprint
Moves the blueprint argument to a named argument; freeing up space to
later be able to pass in multiple image types. This also slightly
simplifies the case where we're building without a blueprint available.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-16 12:31:13 +00:00
Florian Schüller
ffb22eb837 spellcheck: ignore release_artifacts directory
Pyspelling does not seem to read `.gitignore` file,
so we'll manually exclude it for now.
2025-01-15 15:58:00 +00:00
Simon de Vlieger
8ba39144ce ci: expand spellcheck
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-14 10:11:41 +00:00
Michael Vogt
44f8f90310 README: add blueprint example
This commit adds an example for how to pass the blueprint and what
content the blueprint should have.
2025-01-13 13:46:14 +00:00
Michael Vogt
8f94516779 main: add ostree integration
This commit adds integration for the ostree options. It is modelled
loosely after weldr-client/composer-cli and the
```
start-ostree --{ref,parent,url}
```
and uses
```
--ostree-{ref,parent,url}
```

A simple smoke test is provided that uses fedora-iot. Ideas welcome
for an easier way :)
2025-01-10 14:37:47 +00:00
Florian Schüller
00e18fe1cd Makefile/packit: avoid duplicate implementation of "version" 2025-01-10 13:50:34 +00:00
Michael Vogt
4f1816c1b7 manifestgen: pass missing repoConfig to preManifest.Serialize()
When depsolve is run it returns a list of packageSpecs and the
matching repository config. This repo config is different/distinct
from the repository config that is passed into depsolve via the
package sets or the repositories that are loaded via the
reporegistry and needs to be passed into `manifest.Serialize()`.

The key different is that the depsovle `repoConfig` contains
the repo.Id that match the packageSpec.RepoId. With those two
matching IDs we can use librepo (see osbuild PR#1974) to infere
what mirror to use for what package.

This commit now passes the correct repoConfig into
preManifest.Serialize() now.

No test (sorry!) as this is really hard to test in isolation, there
is nothing observable today from repoConfig and it is impossible
to add a "witness" pipelien that could check that the right argument
is passed in `pipeline.serializeStart()`. So until we refactor
images you will have to take my word for this (sorry again).
2025-01-10 13:49:28 +00:00
Florian Schüller
30166b07fc Makefile: fix packer version by using git tag
For releases this does not change anything, as the version
in the spec file is the same as the git tag. For
intermediate/tainted versions packer seems to patch the spec
file to the version given in `.packit.yaml`
(which is the latest git-tag), then the filename and version
would be inconsistent.
2025-01-10 11:55:52 +00:00
Michael Vogt
0563b845be pre-commit: drop golangci-lint for now
The package crashes during check with:
```
golangci-lint............................................................Failed
- hook id: golangci-lint
- exit code: 3
level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package gpgme: could not load export data: no export data for \"github.com/proglottis/gpgme\""
level=error msg="Running error: can't run linter goanalysis_metalinter\nbuildir: failed to load package gpgme: could not load export data: no export data for \"github.com/proglottis/gpgme\""
```

which is not helpful
2025-01-10 08:30:28 +00:00
Michael Vogt
fb56109048 cmd: drop TestListImagesOverrideDatadir
With the new build-in repos this test is no longer relevant. We
need to look into a different way to test overrides but just
providing an empty datadir will no longer work so drop that.
2025-01-10 08:30:28 +00:00
Michael Vogt
d35c95a9bc lint: fix whitespace/spelling in README 2025-01-10 08:30:28 +00:00
Michael Vogt
ffc676e3d0 main: help golang-ci to find the "main" symbol in the tests 2025-01-10 08:30:28 +00:00
Michael Vogt
c1454864c4 pre-commit: bump golangci-lint to v1.63.1 to fix crash when importing slices 2025-01-10 08:30:28 +00:00
Michael Vogt
25043b2e70 workflow: switch to composite action to fix go/pytest
The go/pytest tests were broken because the reusable workflow
is not quite the right construct. We need the "composite action".
2025-01-10 08:30:28 +00:00
Michael Vogt
573f56a6ec workflow: rename .yml -> .yaml 2025-01-10 08:30:28 +00:00
Michael Vogt
692a487fe9 test: fix integration test 2025-01-10 08:30:28 +00:00
Michael Vogt
80cadaf291 repos: lookup <buildin>, /{etc,usr/share}/image-builder/repositories
This commit switches the default repositories to use the build-in
ones from images PR#1112. It is still possible to override using
`/etc/image-builder` and `/usr/share/image-builder` or `--datadir`.

This is implicitly tested via the container test that no longer
includes the files from osbuild-composer in the container.
2025-01-09 16:17:50 +00:00
Michael Vogt
6d9e91eb3c go.sum: update to latest images lib to get embeded repos 2025-01-09 16:17:50 +00:00
schutzbot
c1b1658929 Post release version bump
[skip ci]
2025-01-08 08:29:09 +00:00
Michael Vogt
d727d9aa76 manifestgen: port to the new images manifest seed
This moves to the new images Manifest() API from PR#1107.
2025-01-08 06:53:12 +00:00
Michael Vogt
59e6ce298a go.mod: update to images@v0.108.0 2025-01-08 06:53:12 +00:00
Florian Schüller
c408577b2d pre-commit: introduce make lint
Also make the linters part of the github actions.
2025-01-07 12:29:58 +00:00
Florian Schüller
734c132500 prepare all syntax for linters and spellchecks 2025-01-07 12:29:58 +00:00
schutzbot
b932d218e3 Post release version bump
[skip ci]
2024-12-25 08:28:26 +00:00
Simon Steinbeiss
51e4171caf actions: Add pr-best-practices workflow
This commit adds the pr-best-practices check, which prevents pull
requests without descriptions being merged and which allows developers
to quickly create Jira Tasks based on the /jira-epic command in pull
request descriptions or comments.
2024-12-20 15:41:37 +00:00
schutzbot
69b6ed5857 Post release version bump
[skip ci]
2024-12-20 14:30:01 +00:00
dependabot[bot]
02cb63b8fd build(deps): bump docker/login-action from 2 to 3
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-20 14:27:26 +00:00
schuellerf
6f26427ddf Post release version bump
[skip ci]
2024-12-20 14:05:26 +00:00
Florian Schüller
cad909e77a github/workflows/release.yml: enable creating release artifacts 2024-12-20 13:59:49 +00:00
Florian Schüller
be1cfec923 github/workflows/create-tag: initial version
Helper to create a tag for a new release.
2024-12-20 13:30:45 +00:00
Florian Schüller
99af073fa3 image-builder-cli.spec: fix building centos stream 10
Using the same approach as in osbuild-composer.
2024-12-20 12:33:48 +00:00
Florian Schüller
cdff269270 github/workflows: introduce release action
Using staging branch for now, due to the new
release_artifacts.
2024-12-20 08:08:59 +00:00
dependabot[bot]
c45b5e978f build(deps): bump the go-deps group with 2 updates
Bumps the go-deps group with 2 updates: [github.com/osbuild/images](https://github.com/osbuild/images) and [github.com/stretchr/testify](https://github.com/stretchr/testify).


Updates `github.com/osbuild/images` from 0.98.0 to 0.106.0
- [Release notes](https://github.com/osbuild/images/releases)
- [Commits](https://github.com/osbuild/images/compare/v0.98.0...v0.106.0)

Updates `github.com/stretchr/testify` from 1.9.0 to 1.10.0
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/osbuild/images
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-20 05:21:56 +00:00
Florian Schüller
1f94684f53 .packit.yaml: fix patching the spec file 2024-12-19 14:45:01 +00:00
Florian Schüller
2e4a8e194d Makefile: support building commit and version based tarball 2024-12-19 14:45:01 +00:00
Florian Schüller
7e181e30c9 .packit.yaml: implement version fallback until we have a tag 2024-12-19 14:45:01 +00:00
Tomáš Hozza
9b737c1949 Makefile: use version instead of commit for archive filename
RPM tooling expects the source tarball to match the name of the
package, suffixed with the version in the SPEC file. Modify the Makefile
to comply with this expectation.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Tomáš Hozza
c1a719e4e3 SPEC: use version 1
SPEC always uses the next version that will be released.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Tomáš Hozza
3ae39416c7 FIXUP: .packit.yaml: fix issues when building SRPM
FWIW, I never get || and && correctly in Bash for the first time :D

Also handle the case then the repository does not contain any version
tags yet by defaulting to "1".

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Tomáš Hozza
f4fa09abf3 FIXUP: .packit.yaml: fix issues when building SRPM
Packit needs golang to be installed when we build SRPM, because we need
to vendor code to generate the archive.

Moreover, we need to vendor code to be able to modify SPEC port upstream
clone to include bundled code.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Florian Schüller
89fec6d5d0 Makefile: assure bundle info in spec file
The release artifact should contain the spec file including the
bundle information.
2024-12-19 14:45:01 +00:00
Tomáš Hozza
b870c404a5 Add initial Packit configuration
For now, Packit should trigger COPR buils for PRs and merges to the
`main` branch.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Tomáš Hozza
f1b09b91a9 Makefile/release_artifacts: print the archive path
Packit needs expects the archive path to be printed when specifying a
custom action to build the archive. See [0].

[0] https://packit.dev/docs/configuration/actions#create-archive

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-19 14:45:01 +00:00
Florian Schüller
50c79f154d Makefile: support for make release_artifacts
Supports to package `vendor/` directory
which is not part of the repository.
2024-12-19 14:45:01 +00:00
Simon de Vlieger
60c22e3214 package: spec file
Provide a spec file for `image-builder-cli`. The spec file is based on
`osbuild-composer`'s spec file except it is simplified as (some)
usecases would currently cloud the intent of the specfile. We can add
back RHEL conditionals when/if we start shipping and building for RHEL.

Some tools from `osbuild-composer` are also included; most notably the
one that generates bundled dependencies from vendored modules.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2024-12-19 14:45:01 +00:00
Simon de Vlieger
cdf627389e ci: dependabot
As we've now vendored our dependencies let's enable dependabot in the
same way we use it in our other Go projects.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2024-12-19 14:45:01 +00:00
Simon de Vlieger
38af61d633 ci: enable aarch64 container builds
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2024-12-19 14:26:40 +00:00