Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2019
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.10 KB | None | 0 0
  1. def getComputerName() {
  2.   def computer = powershell returnStdout: true, script: '(Get-WmiObject Win32_ComputerSystem).Name', label: 'Get Computer Name'
  3.   return computer.toLowerCase().trim()
  4. }
  5.  
  6. def getNodeDomain() {
  7.   def domain = powershell returnStdout: true, script: '(Get-WmiObject Win32_ComputerSystem).Domain', label: 'Get Computer Domain'
  8.   return domain.toLowerCase().trim()
  9. }
  10.  
  11. def customizeSiteConfiguration() {
  12.   def configPath = "${codeBase}/pipeline/Scripts/Installation/InstallConfig.json"
  13.   println "Loading configuration from: ${configPath}"
  14.   def configFile = readFile(configPath)
  15.   def installConfig = new JsonSlurper().parseText(configFile)
  16.  
  17.   def computerName = getComputerName()
  18.   def nodeDomain = getNodeDomain()
  19.  
  20.   installConfig.db_name = "${computerName}_tests"
  21.   installConfig.email_viewer_url = "${computerName}:1080/"
  22.   installConfig.mail_host = "${computerName}"
  23.   installConfig.mail_sent_from_address = "${computerName}@some.com"
  24.   installConfig.mc_domain = "${nodeDomain}"
  25.   installConfig.license = getLicenseKey(computerName, nodeDomain, installConfig.mc_http_port)
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement