Groovy web console

subscribe to the feed Subscribe
to this
site
convert-msaas-v1 (via #groovywebconsole)
tweet this snippet Tweet
this
script

convert-msaas-v1

Published 2 months ago by Marcello de Sales with tags groovy-language-conversion
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
 def l1 = 'services'
def l2 = 'config'
def serviceName = 'configuration-service'
def serviceAssetId = '1234567890'
def appName = "${l1}-${l2}-${serviceName}"
def deployable_branches = ["master"]
def argocd_server = new URL("https://example.int.com").getHost() + ":443"
def argocd_password = "argocd-${serviceName}"
def kson_compnt= "sample"
def ptNameVersion = "${serviceName}-${UUID.randomUUID().toString().toLowerCase()}"
def repo = "services/config/configuration-service/service"
def deploy_repo = "github.com/services/config-deployment.git"
def tag = ""
def registry = "docker.registry.com"
def image = "${repo}/${serviceName}"
def app_wait_timeout = 1200
def prd_diff_msg = ""
def stage_timeout = 20
def git_timeout = 2
def preprodOnly = true
def abortBuild = false
def nexusSnapshotCredId = "nexusSnapshotCredId"
def nexusReleaseCredId = "nexusReleaseCredId"

println """

def context = [
  version: "1.0",
  devPortal: [
    serviceName: "${serviceName}",
    serviceAssetId: "${serviceAssetId}"
  ],
  argoCd: [
    server: "${argocd_server}", 
    appName: "${appName}",
    password: "${argocd_password}",
    ksonnet: [
      component: "${kson_compnt}"
    ],
    overallTimeout: ${stage_timeout},
    syncTimeout: ${app_wait_timeout}
  ],
  jenkinsPipeline: [
    deployableBranches: "${deployable_branches}",
    nodeName: "${ptNameVersion}",
  ],
  dockerRegistry: [
    host: "${registry}",
    repo: "${repo}",
    image: "${image}"
  ],
  gitOps: [
    deployRepo: "${deploy_repo}",
    pushTimeout: ${git_timeout}
  ],
  env: [

  ],
  abortBuild: false,
  nexus: [
    snapshotCredId: "${nexusSnapshotCredId}",
    nexusReleaseCredId: "${nexusReleaseCredId}"
  ]
]

"""