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.

1
  • 2
    Secure and ftp are not things you generally see in the same sentence. Use scp or encapsulate your ftp in a VPN tunnel. Commented May 13, 2019 at 19:22

2 Answers 2

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} 
2
  • I was hoping you wouldn't say that but I thought that might be my only option. Thanks. Commented May 15, 2019 at 1:36
  • See my other answer for a solution that might work better for your use-case. Commented May 16, 2019 at 0:00
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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.