Skip to content

RTECO-858: Add JFrog CLI Task support for Bamboo Deployment Projects - #49

Merged
naveenku-jfrog merged 2 commits into
mainfrom
RTECO-858
May 26, 2026
Merged

naveenku-jfrog merged 2 commits into
mainfrom
RTECO-858

Conversation

@naveenku-jfrog

Copy link
Copy Markdown
Contributor

JfTask implements TaskType only and is therefore invisible in the Deployment Project task picker. Bamboo requires DeploymentTaskType to be implemented for a task to appear there.

Add JfDeploymentTask which:

  • Extends JfContext (inheriting AbstractTaskConfigurator) so the same configuration UI and FTL template (editJfTask.ftl) are reused
  • Implements DeploymentTaskType so it appears in the Deployment Project task picker
  • Reuses JfInstaller, ExecutableRunner, and ServerConfigManager — the full jf CLI download, config-add, and command-run flow is identical to JfTask
  • Adapts environment variable setup for the deployment context: build-specific vars (JFROG_CLI_BUILD_NAME, JFROG_CLI_BUILD_NUMBER, JFROG_CLI_BUILD_URL) are omitted since no BuildContext is available; JFROG_CLI_HOME_DIR is isolated per deployment run using the deployment result ID

Register the new task in atlassian-plugin.xml with category "deployment".

JfTask implements TaskType only and is therefore invisible in the Deployment
Project task picker. Bamboo requires DeploymentTaskType to be implemented for
a task to appear there.

Add JfDeploymentTask which:
- Extends JfContext (inheriting AbstractTaskConfigurator) so the same
  configuration UI and FTL template (editJfTask.ftl) are reused
- Implements DeploymentTaskType so it appears in the Deployment Project
  task picker
- Reuses JfInstaller, ExecutableRunner, and ServerConfigManager — the full
  jf CLI download, config-add, and command-run flow is identical to JfTask
- Adapts environment variable setup for the deployment context: build-specific
  vars (JFROG_CLI_BUILD_NAME, JFROG_CLI_BUILD_NUMBER, JFROG_CLI_BUILD_URL)
  are omitted since no BuildContext is available; JFROG_CLI_HOME_DIR is
  isolated per deployment run using the deployment result ID

Register the new task in atlassian-plugin.xml with category "deployment".

Co-authored-by: Cursor <cursoragent@cursor.com>
@naveenku-jfrog
naveenku-jfrog requested a review from agrasth May 26, 2026 10:08

@Inject
@ComponentImport
private AdministrationConfigurationAccessor administrationConfigurationAccessor;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code, administrationConfigurationAccessor is injected but never used. Can you pls check this.

Comment thread src/main/resources/atlassian-plugin.xml Outdated
template are shared with JfTask via JfContext. -->
<taskType key="JfDeploymentTask" name="JFrog CLI Task" class="org.jfrog.bamboo.JfDeploymentTask">
<category name="deployment"/>
<configuration class="org.jfrog.bamboo.JfDeploymentTask"/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't point to JfContext instead of JfDeploymentTask?

/**
* Resolves the working directory, falling back to the task's default if no custom path is set.
*/
private File getWorkingDirectory(String customWd, File defaultWd) throws IOException {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getWorkingDirectory and runConfigAdd duplicated from JfTask — should live in JfContext

- Move shared getWorkingDirectory and runConfigAdd helpers into JfContext
  so JfDeploymentTask can inherit them instead of duplicating bodies.
- Drop the duplicated helpers from JfDeploymentTask.
- Remove the unused AdministrationConfigurationAccessor injection (and
  its setter/import) from JfDeploymentTask — deployment context has no
  build URL to construct.
- Point the JfDeploymentTask <configuration> in atlassian-plugin.xml at
  JfContext, since the configurator/UI lives there.

Co-authored-by: Cursor <cursoragent@cursor.com>
@naveenku-jfrog
naveenku-jfrog merged commit b75c92b into main May 26, 2026
7 checks passed
@naveenku-jfrog
naveenku-jfrog deleted the RTECO-858 branch May 26, 2026 16:31
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

Successfully merging this pull request may close these issues.

2 participants