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

remote pod template definition #1

Open
froucher opened this issue Jan 1, 2021 · 2 comments
Open

remote pod template definition #1

froucher opened this issue Jan 1, 2021 · 2 comments

Comments

@froucher
Copy link

froucher commented Jan 1, 2021

Hello,

It will be very interesting to have a way to get the "pod template definition" from the repository which is going to be verified.

In my local, I am trying to check if it is possible, but the issue is that I can´t do a git checkout of a file without a workspace, that it must be provided by an agent.

So, maybe it will be not possible, ¿have you try to do this?

Thanks.

@liejuntao001
Copy link
Owner

If I understand right, you mean to define the dynamic agent type from a source file within the project to be built.
As you mentioned, an agent is required to checkout.
So we can use a static type of agent, for example, a mini size jnlp agent to perform the checkout, read the file, and get the agent type.
Then create a new dynamic agent from the type and switch to the new agent.

@froucher
Copy link
Author

froucher commented Apr 19, 2021

Thanks for your feedback. Sorry I don't see your answer until today.

Yes, this is the approach I have done: I provide the smallest static agent (alpine) and then I perform a checkout.

The issue is when finally the dynamic pod is created, it is necessary to do again a checkout, because each pod has its own file system.

Now it is working with this approach, but I have in my mind to do some improvement to try to just do the second checkout, and to replace the first checkout with a git archive --remote=ssh://***.git HEAD podTemplate.yml or similar.

After post this issue, based in your code, I started to try to implement this improvement, but it seems a complex task understanding how Jenkins git plugins works, so I leave it.

Thank you again, don't worry about this issue, if I do some progress then I will contact you.

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