Skip to content

Instantly share code, notes, and snippets.

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 / 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 / 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 / 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/', '')
@xlcommunity
xlcommunity / CustomNotification.py
Last active Aug 29, 2015
Example custom notification task
View CustomNotification.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
from org.apache.commons.mail import EmailException, SimpleEmail
SOCKET_TIMEOUT = 30000 # 30s
@xlcommunity
xlcommunity / HttpRequest-snippet.py
Created Jun 30, 2015
HttpRequest modified to support PATCH
View HttpRequest-snippet.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.
...
from org.apache.http.client.config import RequestConfig
# HttpPatch added here
from org.apache.http.client.methods import HttpGet, HttpPost, HttpPut, HttpPatch, HttpDelete
...