-
Notifications
You must be signed in to change notification settings - Fork 29
Support for with-registry-auth flag #8
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
Conversation
Implement support for registry authentication in the stack deployment script. The deployment command is now constructed dynamically to include the `--with-registry-auth` flag if specified. Enhance the GitHub Actions workflow by adding a new job to test registry authentication. This includes steps to set up a private Docker registry, create a user, and push an image for testing. Update action inputs to include an option for registry authentication, allowing for more flexible deployments.
* feat: streamline Docker registry setup in CI workflow Refactor the CI workflow to utilize an Ansible playbook for setting up a private Docker registry. * feat: add logging for with-registry-auth flag in deploy command Adds a log message to indicate when the with-registry-auth flag is included in the Docker stack deploy command. This change improves visibility into the deployment process and helps with debugging by clearly showing the command's configuration.
Wow I ran into the same issue and was hoping this would work so I tested it! Here was my docker file step and it deployed with the flag no issues but it didn't seem to work? Looking into it more. Will see if I can't debug the issue.
Logs from the run:
|
Ok I output the command it did add it. So the login step must not work like normal docker login call, hmmm This was the command it outputs with my setup |
Thank you for the contribution, I should have time to dig into this tomorrow... |
Ok I think I see the issue. You guys are making a new context. So my previous login isn't in scope anymore. So we need to have a login registry after the context is made and switched too. |
Ok I created branch that added another command to let you run a register login before and that worked. Here is that PR that fixed it for me: #9 My now github step
And logout showing it push the container:
|
Sorry about making another PR but it didn't make sense to keep the with_registry_auth flag anymore if you have to register then I know I now need to pass it. Still great work @PirateSeal! |
Hello, for the context, I assumed that the user that is used for the deployment is already logged in to the registry. I should have clarified it somewhere. I don't think it is this task's job to authenticate to the registry every time you use it so I would keep it as a requirement. |
PR #9 works indeed better than mine, though i'd still add a test job to ensure proper functionnality over time |
@PirateSeal The issue is the job makes a new docker context. So if we wanted to have a step to make the context, then use the login context and then the docker swarm deploy that would work and we could stick with your way because I do agree it is messy this way. As for the test in #9 let me think about how to test this as it really is just a eval there isn't really much to test besides I ran what you gave me and I added the flag |
I have created a new PR with my idea of how to implement authentication. If we still need or want to allow a custom |
This feature was added in: #13 I took a slightly different approach vs an authentication command. Let me know if I left anything out! https://github.com/cssnr/stack-deploy-action/releases/tag/v1.0.1 Thank you very much for the contribution and support. Please let me know if you run into any more issues... |
Hello,
I've worked on an implementation for the
with-registry-auth
flag.My current test works by reusing the
DOCKER_HOST
,DOCKER_SSH_KEY
,DOCKER_USER
vars to deploy a new stack specifically for the flag.I'm using an ansible playbook to deploy a simple docker registry to the
DOCKER_HOST
, login in to it and pushing the latest alpine image for the test.I've added the
with_registry_auth
input in theaction.yml
file.tested on Ubuntu 24.04.1 LTS