Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use github actions or other CI/CD pipeline for automatic updates and transparency. #3

Closed
DerLeole opened this issue Apr 12, 2023 · 4 comments

Comments

@DerLeole
Copy link

First of all, love you for creating this project!

As far as I understand, you are using the build_and_push.sh script locally to update the docker image for this project on your docker hub, right?

I would like to suggest to setup a small CI/CD pipeline using github actions (or drone or similar) to automate this process.
Some reasons, that would be helpful:

  • Less work for you (duh) :)
  • Automatic updates every time portainer is updated. Even in times where you might not be immediately able to run the script.
  • Transparency for the build process. While I trust you and could check the image itself before pulling, having the log and output of the buildprocess available for all to see on github actions (or a public drone page) allows user to see at a glance that no security flaws have been introduced with the modified image, which I think is important for an integral backbone to ones digital infrastructure, like portainer is.
  • Automatic upversioning to preserve old tags and always updating the "latest" tag.
  • Automatic release on github releases (helps people who watch the repo to be notified of new versions to update).
  • Automatic release to both Github container repo and dockerhub, since the anti consumer behaviour of dockerhub, means, an alternative container repo could be more reliable.

Here is some ideas for the implementation (using Github actions):

  • Watch for new releases of the portainer-ce docker hub, or github repo to trigger new builds in this repo.
    • Potentially limit automatic updates to a "beta" tag instead of the "latest" tag, if you want more manual control.
  • Just copy the portainer-ce version number for ease of use and backwards compatibility.
  • Watch for pushes to this repos main branch using the "release" or similar github tag to trigger rebuilt and replacement of current image version to introduce new features (in case some more important stuff is added later).
  • Automatically replace the latest tag on the container repo with your newest build.
  • Push to both ghcr and docker hub.

If you need any help with that, I would love to point you in the right direction and/or make a small PR :)

@ngxson
Copy link
Owner

ngxson commented Apr 12, 2023

Thank you for the suggestion!

Yes, in fact, the build_and_push.sh is made with support for CI/CD in mind. My initial idea was to watch list of tags via this API, but since portainer doesn't release a new version that often, I'm quite lazy to setup the CI.

And of course, PR is always welcomed!

@DerLeole
Copy link
Author

Fair haha!

If you plan to maintain the functionality of the project for a bit, I'll try to find the time to write the whole Github Actions CI stuff when my exams are over by the end of April ✌️

@ngxson
Copy link
Owner

ngxson commented May 19, 2023

The action has been added (thanks to the help from ChatGPT): https://github.com/ngxson/portainer-ce-without-annoying/actions/workflows/build_and_push.yml

There are 3 ways the action can be triggered:

  • automatically everyday, at midnight
  • automatically, when there're new commits pushed to master branch
  • manally, can re-build and re-push the last 5 tags (useful when I want to add features or fixes)

@ngxson ngxson closed this as completed May 19, 2023
@DerLeole
Copy link
Author

DerLeole commented Jun 9, 2023

Awesome! Thanks so much <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants