biemond/biemond-orawls

View on GitHub
files/providers/wls_deployment/create.py.erb

Summary

Maintainability
Test Coverage
# check the domain else we need to skip this (done in wls_access.rb)
real_domain='<%= domain %>'

wlst_action = '<%= wlst_action %>'

name              = '<%= deployment_name %>'
localpath         = '<%= localpath %>'
planpath          = '<%= planpath %>'
target            = '<%= target %>'
deploymenttype    = '<%= deploymenttype %>'
versionidentifier = '<%= versionidentifier %>'
remote            = '<%= remote %>'
upload            = '<%= upload %>'
stagingmode       = '<%= stagingmode %>'

edit()
startEdit()

try:

    if deploymenttype == 'Library':
        library = 'true'
    else:
        library = 'false'

    if remote == '1':
        remoteflag = 'true'
    else:
        remoteflag = 'false'

    if upload == '1':
        uploadflag = 'true'
    else:
        uploadflag = 'false'

    print 'deploying....'
    if versionidentifier:
        if planpath:
            print 'deploying with version and deploymentplan....'
            if stagingmode:
                deploy(appName=name, path=localpath, planPath=planpath, targets=target, stageMode=stagingmode, remote=remoteflag, upload=uploadflag, libraryModule=library, versionIdentifier=versionidentifier)
            else:
                deploy(appName=name, path=localpath, planPath=planpath, targets=target, remote=remoteflag, upload=uploadflag, libraryModule=library, versionIdentifier=versionidentifier)
        else:
            print 'deploying with version without deploymentplan....'
            if stagingmode:
                deploy(appName=name, path=localpath, targets=target, remote=remoteflag, stageMode=stagingmode, upload=uploadflag, libraryModule=library, versionIdentifier=versionidentifier)
            else:
                deploy(appName=name, path=localpath, targets=target, remote=remoteflag, upload=uploadflag, libraryModule=library, versionIdentifier=versionidentifier)
    else:
        if planpath:
            if stagingmode:
                deploy(appName=name, path=localpath, planPath=planpath, targets=target, remote=remoteflag, stageMode=stagingmode, upload=uploadflag, libraryModule=library)
            else:
                deploy(appName=name, path=localpath, planPath=planpath, targets=target, remote=remoteflag, upload=uploadflag, libraryModule=library)
        else:
            if stagingmode:
                deploy(appName=name, path=localpath, targets=target, remote=remoteflag, stageMode=stagingmode, upload=uploadflag, libraryModule=library)
            else:
                deploy(appName=name, path=localpath, targets=target, remote=remoteflag, upload=uploadflag, libraryModule=library)

    save()
    activate()
    report_back_success()

except:
    report_back_error()