micromdm / scep

Go SCEP server
MIT License
310 stars 121 forks source link

Modernize CI/CD #216

Closed pidpawel closed 7 months ago

pidpawel commented 1 year ago

Hi! I don't know how much useful this pull request will be to you, but I still think that it's worth a read at least.

I took the liberty to make changes in both the development, testing and deployment process. I'll try to describe all of them with some explanations/rationale but feel free to ask about the details if you feel so.

1) Modernized Github Action workflow - now it makes use of the DAG and has conditionals for pushing to Docker Hub and making automatic releases to Github. I have not copied the zipping mechanism yet, but with most users only needing a single binary I think it can be skipped. 2) Get rid of Makefile - this was a tough one as it was nicely written but most of that file was tailored for making the cross-builds and release smoother, which is now written in CI so I thought that a regular development tools like running go test manually will be enough for now. 3) Changed Dockerfile to a two stage build - because of 2) user would have to type two commands in order to build Docker image and I didn't feel like it's a good use of programmers' time - I put the build stage (crudely) inside the Dockerfile. This makes the build times on CI slightly longer (but still acceptable IMHO) but also makes publishing images for multiple architectures a breeze. 4) Changed readme a lot - mostly to make Docker image usage more visible but also to emphasize the separation between client and server. I'm not sure whether removing -help outputs was a good decision, but having them inline made the readme kinda cluttered IMHO. Maybe they should be added at the very end? 5) Updated Go and dependencies - I updated Go version to 1.20 (both in the go.mod and in workflows) and updated both the direct and indirect dependencies. Updating Go version in go.mod seems like something that can be skipped but I included it for the sake of consistency. 6) Fixed one random test that was failing with scary messages.

I hope that you'll find those changes useful. If you want me to apply any changes that I stated above please do let me know.

-- Have a wonderful day pidpawel

jessepeterson commented 7 months ago

Thanks @pidpawel! Sorry for the delay. This is probably pretty radical treatment for us here right now, so I don't think we'll merge this. Good news is that your proposed ideas/results are great! If we were to redo the CI/CD & build dev stuff we'd do many of the same things (like many of the other micromdm projects have gone through somewhat recently) — so thanks! This project in particular, however, is going through some (opinionated) changes and don't want to commit to this right now. Thanks again though!