netbrain / zwift

Easily zwift on linux
The Unlicense
265 stars 28 forks source link

Use runfromprocess-rs all the time #25

Closed quietvoid closed 1 year ago

quietvoid commented 1 year ago

Fixes #24

netbrain commented 1 year ago

I think we should have a github action in place to update the current image with the new entrypoint.sh if it has changed.

As per now this will cause a full rebuild :cry:

Maybe some logic that does the following:

  1. Checkout the repo.
  2. Downloads the latest zwift container
  3. docker run -d -t zwift netbrain/zwift:latest sleep infinity
  4. docker cp zwift:/bin/entrypoint /tmp/entrypoint
  5. diff entrypoint.sh /tmp/entrypoint
  6. if exit code == 0, then the files are equal, if exit code == 1 then continue to next step
  7. docker cp entrypoint.sh zwift:/bin/entrypoint
  8. docker commit -m "$git message? or something hardcoded" -c "need to change the command" zwift netbrain/zwift:latest
  9. docker tag netbrain/zwift:latest netbrain/zwift:$VERSION
  10. docker push netbrain/zwift:latest && docker push netbrain/zwift:$VERSION
  11. :partying_face:

Should also look into which files we should to this diff comparison against. Maybe even the runfromprocess-rs if it ever changes.

Thoughts?

netbrain commented 1 year ago

Looks like the files required to be checked as of now is the runfromprocess-rs files, zwift-auth.sh and entrypoint.sh

Could probably also reorganize the repo a bit, so that all files used in the container is in it's own folder.

Would make diffing easier i guess.

quietvoid commented 1 year ago

It should probably be both sh scripts only. runfromprocess-rs doesn't belong in the repo, and it's unlikely to change.

netbrain commented 1 year ago

Could you elaborate on the "doesn't belong in the repo" part? Do you mean it was a mistake to include the source code?

I'm open for changes, if you provide some argumentation for your stance on this.

On Mon, Sep 18, 2023, 14:38 quietvoid @.***> wrote:

It should probably be both sh scripts only. runfromprocess-rs doesn't belong in the repo, and it's unlikely to change.

— Reply to this email directly, view it on GitHub https://github.com/netbrain/zwift/pull/25#issuecomment-1723323473, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACTNC5UKZHUDAM3CDUMRNLX3A6DPANCNFSM6AAAAAA43VJDEM . You are receiving this because you commented.Message ID: @.***>

quietvoid commented 1 year ago

Do you mean it was a mistake to include the source code?

Yes, there's no good reason to do that when you can just clone on build. https://github.com/quietvoid/zwift/commit/cdd7f97c58654a05fddb56b63a102a6825dbc087#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R10

netbrain commented 1 year ago

Im fine with that as long as you promise to never delete the repo :)

quietvoid commented 1 year ago

The alternative is that you can just fork it, retag and use your fork. I don't really care.