jw3 / mock-srpm

A GitHub Action for building source RPMs using Mock
MIT License
0 stars 1 forks source link

WIP: Allow for prebuilt docker image #7

Closed bschonec closed 1 month ago

bschonec commented 10 months ago

This pull request will allow for the operator to use his own Docker image which may be preconfigured with mock and mock environments.

Using a pre-configured Docker image decreases the run time by about two minutes; which can be a significant time saver when doing testing.

Let me know your thoughts. I see you have another PR #6 out there that seems to follow the same thinking. I've included a Dockerfile as well but I haven't yet made changes to the README.md to reflect how to build the image correctly (using the --privileged flag).

Of course, my changes in ci-simple.yml refer to MY branch. This is somewhat of a chicken-egg issue and will have to be changed to your project if you accept the changes.

jw3 commented 10 months ago

Give #9 a try. Caching is integrated, after the first mock init you will see time savings until the spec is changed

      - uses: jw3/mock-srpm@cache2
        with:
          chroot: ...
          spec: ...
          cache: true

If you want to use a prebuilt image it exists

      - uses: jw3/mock-srpm@cache2
        with:
          chroot: ...
          spec: ...
          cache: true
          image: fedora:37

9 has some details in the description about when and how the caching happens. I still need to doc and test before merging.

This might be v1 when its done.

jw3 commented 10 months ago

Appreciate the contrib though, but this needed woven into the caching so it happened all at once in #9.