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

init.groovy not run on Windows agents

XMLWordPrintable

      Jenkins is running as a service on my Windows Agent, my Master is running on Ubuntu. The environment variable JENKINS_HOME is not set, but based on various searches I believe the jenkins home directory to be:
      C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\secrets

      To test, I added the following files and folders

      init.groovy

      init.groovy.d

        - init.groovy

      the file should basically log a text to the Master's system log, like so:

         def logger = LogManager.getLogManager().getLogger("")

         logger.info("Jenkins Startup Script: It ran ! : ")

         logger.info("Jenkins Startup Script: It ran ! : ${jenkinsHome}/init.groovy.d ")

       

      Since I wasn't sure of the actual JENKINS_HOME, I added the init.groovy both all these locations:

      C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\secrets\init.groovy

      C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\secrets\init.groovy.d\init.groovy

      C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\init.groovy

      C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\init.groovy.d\init.groovy

      C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\war\WEB-INF\init.groovy

      C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\war\WEB-INF\init.groovy.d\init.groovy

      I restarted the Jenkins service, but as far as I can tell none of these were ever run, and nothing was ever sent to the log.

      I'm new to Jenkins, so maybe I did it wrong, but it appears init.groovy is not executed on windows agents?

       

       

       

       

            escoem Emilio Escobar
            themightypope Anders Heie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: