{"id":34311767,"url":"https://github.com/amitmohleji/xebialabs-code-snippets","last_synced_at":"2025-12-17T09:55:36.092Z","repository":{"id":25273357,"uuid":"28698887","full_name":"amitmohleji/xebialabs-code-snippets","owner":"amitmohleji","description":"Random scripts to help for XLD","archived":false,"fork":false,"pushed_at":"2020-02-11T03:33:17.000Z","size":2037,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-06T13:11:41.082Z","etag":null,"topics":["cli","python","script","snippets","task","xl-deploy","xl-release"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amitmohleji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-01T23:59:47.000Z","updated_at":"2023-08-06T13:11:41.083Z","dependencies_parsed_at":"2022-08-23T23:50:46.324Z","dependency_job_id":null,"html_url":"https://github.com/amitmohleji/xebialabs-code-snippets","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/amitmohleji/xebialabs-code-snippets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amitmohleji%2Fxebialabs-code-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amitmohleji%2Fxebialabs-code-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amitmohleji%2Fxebialabs-code-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amitmohleji%2Fxebialabs-code-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amitmohleji","download_url":"https://codeload.github.com/amitmohleji/xebialabs-code-snippets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amitmohleji%2Fxebialabs-code-snippets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27781280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-17T02:00:08.291Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","python","script","snippets","task","xl-deploy","xl-release"],"created_at":"2025-12-17T09:55:35.424Z","updated_at":"2025-12-17T09:55:36.084Z","avatar_url":"https://github.com/amitmohleji.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository lists various scripts that are useful while working with XLD\n\nexposeDeploymentVariables.ftl\n=============================\nThe code snippet in this script can be copied into a script that is used with XLD artifacts as a createScript. It can be used with generic plugin and with XL-rules and any other plugins that have execution scripts specified such that they show up under plan analyzer can be opened.\n\nThis script would expose all the variables and the properties with them. It works recursively so you can specify the what level of depth you want to go to.\neg.\n\nbase depth is 0. so with depth=1, it will show properties like deployed.container.os.\n\nIt prints the value of literal properties, also lists the methods available with objects is captureMethod=true. \nFor generic plugin, with captureMethod=false, output shows up like this.\n\nVARIABLE LISTING TILL DEPTH: 0\n=====================================\n\t\tComplex Object: deployed\n\t\tPROPERTY: ${deployed.createScript}  ||  VALUE: script/osscript.sh.ftl\n\t\tPROPERTY: ${deployed.remoteWorkingDirectoryPath}  ||  VALUE: (UNDEFINED/UNRESOLVED) \n\t\tPROPERTY: ${deployed.inspectScript}  ||  VALUE: (UNDEFINED/UNRESOLVED) \n\t\tPROPERTY: ${deployed.planOperation}  ||  VALUE: CREATE\n\t\tPROPERTY: ${deployed.modifyScript}  ||  VALUE: (UNDEFINED/UNRESOLVED) \n\t\tPROPERTY: ${deployed.noopOrder}  ||  VALUE: 50\n\t\tPROPERTY: ${deployed.modifyOrder}  ||  VALUE: 50\n\t\tPROPERTY: ${deployed.noopScript}  ||  VALUE: (UNDEFINED/UNRESOLVED) \n\t\tPROPERTY: ${deployed.$ciAttributes}  ||  VALUE: com.xebialabs.deployit.plugin.api.udm.CiAttributes@42472788\n\t\tPROPERTY: ${deployed.noopVerb}  ||  VALUE: Modify\n\t\tPROPERTY: ${deployed.destroyVerb}  ||  VALUE: Destroy\n\t\tPROPERTY: ${deployed.retainRemoteWorkingDirectory}  ||  VALUE: false\n\t\tPROPERTY: ${deployed.destroyScript}  ||  VALUE: (UNDEFINED/UNRESOLVED) \n\t\tPROPERTY: ${deployed.createVerb}  ||  VALUE: Create\n\t\tPROPERTY: ${deployed.type}  ||  VALUE: test.scripttype1\n\t\tPROPERTY: ${deployed.restartRequired}  ||  VALUE: false\n\t\tPROPERTY: ${deployed.class}  ||  VALUE: class com.xebialabs.deployit.plugin.generic.deployed.ExecutedScript\n\t\tPROPERTY: ${deployed.createOrder}  ||  VALUE: 50\n\t\tPROPERTY: ${deployed.modifyVerb}  ||  VALUE: Modify\n\t\tPROPERTY: ${deployed.id}  ||  VALUE: Infrastructure/local/newtype\n\t\tPROPERTY: ${deployed.name}  ||  VALUE: newtype\n\t\tPROPERTY: ${deployed.destroyOrder}  ||  VALUE: 40\n\t\tPROPERTY: ${deployed.$token}  ||  VALUE: (UNDEFINED/UNRESOLVED) \n\t\tPROPERTY: ${deployed.restartRequiredForNoop}  ||  VALUE: false\n\t\tComplex Object: step\n\t\tPROPERTY: ${step.uploadedArtifactPath}  ||  VALUE: (UNDEFINED/UNRESOLVED) \n\t\tPROPERTY: ${step.hostFileSeparator}  ||  VALUE: /\n\t\tPROPERTY: ${step.localConnection}  ||  VALUE: local:\n\t\tPROPERTY: ${step.retainRemoteWorkingDirOnCompletion}  ||  VALUE: false\n\t\tPROPERTY: ${step.hostLineSeparator}  ||  VALUE: \n\n\t\tPROPERTY: ${step.scriptTemplatePath}  ||  VALUE: script/osscript.sh.ftl\n\t\tPROPERTY: ${step.class}  ||  VALUE: class com.xebialabs.deployit.plugin.generic.step.ScriptExecutionStep\n\t\tPROPERTY: ${step.preview}  ||  VALUE: com.xebialabs.deployit.plugin.api.flow.Preview@552fae2e\n\t\tPROPERTY: ${step.remoteWorkingDirPath}  ||  VALUE: (UNDEFINED/UNRESOLVED) \n\t\tPROPERTY: ${step.remoteConnection}  ||  VALUE: local:\n\t\tPROPERTY: ${step.scriptPath}  ||  VALUE: script/osscript.sh.ftl\n\t\tPROPERTY: ${step.artifact}  ||  VALUE: (UNDEFINED/UNRESOLVED) \n\t\tPROPERTY: ${step.remoteWorkingDirectory}  ||  VALUE: local:/var/folders/mf/wyk69xfn6_nfg04s6vt4gjrw0000gn/T/ot-20150101T191228243/generic_plugin.tmp\n\t\tComplex Object: statics\n\t\t Cannot be parsed as {statics} is not a hash or simple property\n\nFor XL-Rules, with captureMethod=true, output shows like this.\n\nVARIABLE LISTING TILL DEPTH: 0\n=====================================\n\t\tComplex Object: deployed\n\t\tMETHOD: ${deployed.putSyntheticProperty(...)}\n\t\tMETHOD: ${deployed.hasSyntheticProperty(...)}\n\t\tMETHOD: ${deployed.get$ciAttributes(...)}\n\t\tMETHOD: ${deployed.getSyntheticProperties(...)}\n\t\tMETHOD: ${deployed.hashCode(...)}\n\t\tPROPERTY: ${deployed.type}  ||  VALUE: test.scripttype\n\t\tMETHOD: ${deployed.putSyntheticProperties(...)}\n\t\tMETHOD: ${deployed.setDeployable(...)}\n\t\tPROPERTY: ${deployed.id}  ||  VALUE: Infrastructure/local/osscript\n\t\tMETHOD: ${deployed.getType(...)}\n\t\tMETHOD: ${deployed.setContainer(...)}\n\t\tMETHOD: ${deployed.getSyntheticProperty(...)}\n\t\tPROPERTY: ${deployed.name}  ||  VALUE: osscript\n\t\tMETHOD: ${deployed.setId(...)}\n\t\tMETHOD: ${deployed.get$token(...)}\n\t\tMETHOD: ${deployed.getId(...)}\n\t\tMETHOD: ${deployed.getClass(...)}\n\t\tMETHOD: ${deployed.getContainer(...)}\n\t\tMETHOD: ${deployed.hasProperty(...)}\n\t\tMETHOD: ${deployed.equals(...)}\n\t\tMETHOD: ${deployed.setType(...)}\n\t\tPROPERTY: ${deployed.class}  ||  VALUE: class com.xebialabs.deployit.plugin.api.udm.base.BaseDeployed\n\t\tMETHOD: ${deployed.compareTo(...)}\n\t\tPROPERTY: ${deployed.$token}  ||  VALUE: (UNDEFINED/UNRESOLVED) \n\t\tMETHOD: ${deployed.setProperty(...)}\n\t\tMETHOD: ${deployed.set$token(...)}\n\t\tPROPERTY: ${deployed.$ciAttributes}  ||  VALUE: com.xebialabs.deployit.plugin.api.udm.CiAttributes@54707e93\n\t\tMETHOD: ${deployed.setSyntheticProperties(...)}\n\t\tMETHOD: ${deployed.getName(...)}\n\t\tMETHOD: ${deployed.getProperty(...)}\n\t\tMETHOD: ${deployed.set$ciAttributes(...)}\n\t\tMETHOD: ${deployed.getDeployable(...)}\n\t\tMETHOD: ${deployed.toString(...)}\n\n\nexposeJythonVariables.py\n========================\nThis code snippet helps expose all the jython variables available while using Jython Step in XL-rules\n\ncheckXLDPermissions.py\n======================\nThis code snippet can be used in XLR in a script task to validate the credentials of all XLD tasks in the release to make sure they are good for deploy#initial permission\n![checkXLDFromXLR.png](checkXLDFromXLR.png)\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famitmohleji%2Fxebialabs-code-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famitmohleji%2Fxebialabs-code-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famitmohleji%2Fxebialabs-code-snippets/lists"}