Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29835

Condition for Remote Directory should Include Empty

      The artifact deployer form outlines that 'Remote Directory' is mandatory as per attached screenshot.

      But, if the value is actually empty during run time, this does not get caught.

      Right now, that value gets checked against null only:

      if (entry.getRemote() == null) {
                  throw new ArtifactDeployerException("A remote directory must be set.");
              }
      

      I think there should be a check for character count = 0, or empty.

      This is important: A scenario took place on our instance where a user left 'Remote Directory' empty and checked checkbox 'Clean-up remote directory before deployment'. It wiped everything empty under the agent's root dir. All workspaces, Maven repo, and other stuff...

          [JENKINS-29835] Condition for Remote Directory should Include Empty

          Ian Williams added a comment -

          To clarify, simply leaving the "Remote File Location" empty will result in the files copied to the agent's  "Remote root directory" [property ref.

          Those files are then NOT accessible from the UI ( $JOB_URL/$ BUILD_NUMBER/deployedArtifacts/ ) since they exist on the agent and not the controller.

          As fawzymanaa  mentioned, if the Advanced option "[ X ] Clean-up remote directory before deployment" is enabled, then the ENTIRE CONTENTS of the "Remote root directory" is removed. This is HIGHLY DESTRUCTIVE.

          Ian Williams added a comment - To clarify, simply leaving the "Remote File Location" empty will result in the files copied to the agent's  " Remote root directory " [property ref . Those files are then NOT accessible from the UI ( $JOB_URL/$ BUILD_NUMBER/deployedArtifacts/ ) since they exist on the agent and not the controller. As fawzymanaa   mentioned, if the Advanced option "[ X ] Clean-up remote directory before deployment" is enabled, then the ENTIRE CONTENTS of the "Remote root directory" is removed. This is HIGHLY DESTRUCTIVE .

            gbois Gregory Boissinot
            fawzymanaa Fawzy Manaa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: