Home > database >  Jenkins environment: tool name
Jenkins environment: tool name

Time:08-17

In my organization we use Jenkins as a CD tool, but due to some reasons we are switching to Giltab CI/CD right now. I am transferring pipeline from Jenkins to Gitlab and faced with some problems. For example, there are lines of code that I do not understand and can not find any docs describing it:

environment {
        SBT_HOME = tool name: 'sbt-1.2.6', type: 'org.jvnet.hudson.plugins.SbtPluginBuilder$SbtInstallation'
        PATH = "${env.SBT_HOME}/bin:${env.PATH}"
}

I do not understand how the tool name: 'smth' type: 'smth' works. If I am getting it right tool is a Jenkins' built-in stuff, but I can not reproduce the result of it.

Does anyone know how it works and what is a result of this function? And how to reproduce it Gitlab or may be in Linux CLI after all.

CodePudding user response:

According to the Javadoc, the tool is the plugin, SBT, Scala Build Tool.

SBT_HOME = tool name: 'sbt-1.2.6', type: 'org.jvnet.hudson.plugins.SbtPluginBuilder$SbtInstallation'

This first line determines the installation path for the tool configured your Global Tool Configuration (${JENKINS_URL}/configureTools/) (tutorial), labeled sbt-1.2.6.

The second line adds that to the PATH, presumably for use in the builds steps.

So, you need to have Scala Build Tool installed in your Gitlab CI/CD environment and available in the PATH. That's it.

  • Related