Savant Build

Variables

Savant provides a couple of variables you can access from the build script. These are:

Here is an example of using these variables:

output.info("The project version is ${project.version}")
output.error("System property foo ${SYS['foo']}")
output.warning("Environment variable foo ${ENV['foo']}")
output.debug("Has switch foo ${switches.has('foo')}")
output.info("Switch values ${switches.values('foo')}")
output.info("Global username is ${global.username}")

Global Configuration

Savant allows you to create a properties file in your home directory and use values from it in your build script. This is useful for things like usernames and password. It can also be used for company specific configuration like URLs or IP addresses. Since each developer on a team can have a different configuration file on their local computer, you can have them setup differently as well.

This file must be located here:

~/.savant/config.properties

This is a standard Java properties file and might look like this:

internalRepositoryUsername=fred
internalRepositoryPassword=FluffyBunny

You can then use these properties in your build file like this:

workflow {
  fetch {
    url(url: "http://www.mycompany.com/savant-repository", username: global.internalRepositoryUsername, password: global.internalRepositoryPassword)
  }
}