I can't seem to find a way to get the plan key from prepareConfigObject:
public void prepareConfigObject(@NotNull BuildConfiguration buildConfiguration) { }
I need to store specific configuration items for a repository plugin I'm creating per plan. It's unlikely the same repo settings will be used for every plan.
What I actually need to store is a configuration file per plan. This has to be done as a file and can't be done using the configuration.setProperty mechanisms. I've tried getting the base working directory, but that only takes me to the build-dir directory:
File parentDirectoryFile=this.buildDirectoryManager.getBaseBuildWorkingDirectory(); String parentDirectory=parentDirectoryFile.getAbsolutePath(); String workingDirectory=parentDirectory+File.separator+this.getShortKey(); File f = new File(workingDirectory+"/config.txt");
I need access to the plan directories under build-dir so I can store settings per plan. I don't know, maybe I'm going about this the wrong way. Any input is greatly appreciated.
Settings per plan: buildConfiguration object is already per-plan, i.e. whatever you store in it or retrieve from it will be for specific plan.
Accessing build directory: If you have access to BuildContext, you should access the build directory with com.atlassian.bamboo.v2.build.BuildContextHelper#getBuildWorkingDirectory .
If you don't have access to it, I'd need to know more about your use case.
I'm working a thrid party authenticator, which requires a file handle as a parameter, and the AbstractStandaloneRepository class. WHen you store your settings in the repository settings tab under your plan, prepareConfigObject get's called, then validate. BuildContext is not accessible from within this method. I need to create this file handle somehow so it's saved per plan. RIght now, I can store in a separate directory under build-dir, but when I setup a new plan, this will get overwritten. I need to have this file saved per plan. I wish the authenticator didn't work this way, and only took the ssh private key as string, but it has to have a file :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Working directory is not your only problem - change detection will need to authenticate too.
Why not have a separate directory with your authentication files?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Currently, I'm trying to create a separate directory for this purpose, or at least one nested in the build plan directory. There's no guaruntee they will use the same key for every plan as projects vary. Do you have an example in mind?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem is that during change detection you will not have a build directory because the build has not yet started (and potentially won't start). You need to have a yet different directory.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.