Skip to content

Instantly share code, notes, and snippets.

@xlcommunity
xlcommunity / createDAR.py
Last active Feb 15, 2019
Building a package from properties files/dictionaries/command arguments
View createDAR.py
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
# XL Deploy CLI script to create a DAR from artifacts defined in properties. Optionally also deploy to an env
# 2014-05-28 - 1 - Tom Batchelor
# 2014-05-29 - 2 - Tom Batchelor - Update to support properties files, also some refactoring thing into functions
# 2014-06-05 - 3 - Tom Batchelor - Update to support getting CLASSLOADER_MODE, CLASSLOADER_POLICY, SHARED_LIBRARIES and TAGS from XL Deploy
# dictionaries. Also creates ATPCO properties file copy tasks. Added wait for deployment with full status
# output
@xlcommunity
xlcommunity / deployit-security.xml
Last active Jun 13, 2018
Integrate Crowd and Deployit 3.7.x
View deployit-security.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- NOTE: THIS CODE IS DEPRECATED
Please refer to this documentation, to leverage OIDC authentication for Crowd integration
CrowdId: https://confluence.atlassian.com/crowd/1-2-what-is-crowdid-58656152.html
Setting up OpenId authentication: https://docs.xebialabs.com/xl-release/concept/xl-release-oidc-authentication.html
View find-vulnerable-deployed-component.py
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
#
import re
import sys
import java.lang.IllegalArgumentException as IllegalArgumentException
from sets import Set
@xlcommunity
xlcommunity / OnReleaseFailureEventListener.java
Last active Jun 16, 2016
XL Release "on failure handler" example
View OnReleaseFailureEventListener.java
/*
* THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. THIS
* CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
*/
package ext.deployit.onfailurehandler;
import static java.util.concurrent.TimeUnit.SECONDS;
import static com.google.common.base.Strings.isNullOrEmpty;
@xlcommunity
xlcommunity / JsonWebhook.py
Last active Mar 19, 2016
Code for "Automatically handle failures in XL Release tasks" (https://support.xebialabs.com/hc/en-us/community/posts/204769703)
View JsonWebhook.py
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
#
import sys, string
from java.io import IOException
from com.xebialabs.xlrelease.plugin.webhook import JsonPathResult
from com.xebialabs.xlrelease.plugin.webhook import XmlPathResult
from urlparse import urlparse
@xlcommunity
xlcommunity / releases-templates-trigger-count-4.7.x.py
Created Jan 20, 2016
Python script to count releases, templates and triggers in XL Release 4.7.x and up
View releases-templates-trigger-count-4.7.x.py
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
import httplib
import unittest
import urllib2
import base64
import sys
import json
@xlcommunity
xlcommunity / usageinfo4-5-x.py
Created Jan 14, 2016
Gathering useful information about your XLD installation (version 4.5.x versions)
View usageinfo4-5-x.py
######################
# usageinfo.py
#
# Prints a report of Deployit usage.
#
# Usage: CLI_HOME> bin/cli.sh -expose-proxies -username admin -password admin -f usageinfo.py -- -server-home /opt/deployit-server
#
# TO DO:
# text versions of top 5 reports
# number of users having performed deployments
@xlcommunity
xlcommunity / usageinfo5-x.py
Created Jan 14, 2016
Gathering useful information about your XLD installation (version 5.0.x and up)
View usageinfo5-x.py
######################
# usageinfo.py
#
# Prints a report of Deployit usage.
#
# Usage: CLI_HOME> bin/cli.sh -expose-proxies -username admin -password admin -f usageinfo.py -- -server-home /opt/deployit-server
#
# TO DO:
# text versions of top 5 reports
# number of users having performed deployments
View aws-codepipeline-xl-deploy-action.json
{
"category": "Deploy",
"provider": "XL-Deploy",
"version": "32",
"settings": {
"entityUrlTemplate": "{Config:XL Deploy URL}",
"executionUrlTemplate": "{Config:XL Deploy URL}"
},
"configurationProperties": [
{
@xlcommunity
xlcommunity / CsvExportHook.py
Created Jul 28, 2015
acme.CsvExportHook example
View CsvExportHook.py
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
#
import os
def stripApplication(releaseId):
return releaseId.replace('Applications/', '')