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

Add Instance Number to Environment Variables #1070

Open
rakstar opened this issue Apr 26, 2024 · 0 comments
Open

Add Instance Number to Environment Variables #1070

rakstar opened this issue Apr 26, 2024 · 0 comments

Comments

@rakstar
Copy link

rakstar commented Apr 26, 2024

I run multiple builds on a single host by setting "Instance Capacity" > 1. While this works fine, I have a monolithic app that takes a while to do a fresh git clone with each build. I could speed this up by bind mounting my "Remote File System Root" to a volume so that previous git clones can be reused but, as far as I can tell, this currently wouldn't work properly with multiple concurrent instances.

I think I could address this by having a volume mount declaration like:
type=volume,src=jenkins_agent,dst=/home/jenkins/agent_$INSTANCE_NUMBER

OR perhaps by having a static volume mount and setting my Remote File System Root to something like:
/home/jenkins/agent/workspace_$INSTANCE_NUMBER

But for the above to work, I believe the return value of the following method needs to be saved to the INSTANCE_NUMBER environment variable:

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

1 participant