jenkins Jenkins Groovy Scripting Disable Setup Wizard

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

  1. Open Jenkins default config file and add in JAVA_ARGS next key -Djenkins.install.runSetupWizard=false

In Ubuntu 16 default file places in /etc/default/jenkins

  1. Create groovy file by path $JENKINS_HOME/init.groovy.d/basic-security.groovy

In Ubuntu 16 Jenkins home directory places in /var/lib/jenkins

  1. Place in file next code
#!groovy

import jenkins.model.*
import hudson.util.*;
import jenkins.install.*;

def instance = Jenkins.getInstance()

instance.setInstallState(InstallState.INITIAL_SETUP_COMPLETED)

  1. Restart Jenkins service
  2. After Jenkins starts you need remove $JENKINS_HOME/init.groovy.d/basic-security.groovy file

After this Jenkins doesn`t ask you to confirm that you are admin and you will not see plugins install page.



Got any jenkins Question?