1

Due to security concerns we have two Jenkins instances, One that lives in a secure area and only deploys jars that have been built (cannot connect to GIT). The other lives outside the really secure area and builds the jars. The JenkinsBuild instance builds from GIT and then pushes the jar to an FTP server where a script copies the jar to the correct project workspace in the JenkinsDeploy instance.

Is there a way for Jenkins to see a change in the workspace (new jar)and auto deploy the latest jar? Or would I have to get the script that copies the jar to the workspace to trigger the build (with parameters)? I have admin privileges in Jenkins but I can't modify the script myself.

flareback
  • 111
  • 2
  • 2
    Secure and ftp are not things you generally see in the same sentence. Use scp or encapsulate your ftp in a VPN tunnel. – user9517 May 13 '19 at 19:22

2 Answers2

1

Can you access the remote Jenkins from the process that transfers the .jar files? You can kick off builds through the API using curl, etc to POST like this:

http://{USER}:{API_TOKEN}@{JENKINS_URL}/job/{JOB}/build?token={AUTHENTICATION_TOKEN}
Jason Floyd
  • 1,792
  • 1
  • 13
  • 18
0

If remote API calls aren't your thing, there appears to be a filesystem watching build trigger plugin for jenkins: https://wiki.jenkins.io/display/JENKINS/Files+Found+Trigger

https://plugins.jenkins.io/files-found-trigger

Description:

Build trigger that polls one or more directories and starts a build if certain files are found within those directories.

Jason Floyd
  • 1,792
  • 1
  • 13
  • 18