Skip to content

Instantly share code, notes, and snippets.

@kobymeir
kobymeir / teamcity_github_pr_branch.py
Last active June 6, 2019 13:26 — forked from dzzh/teamcity_github_pr_branch.py
Inject source and target branches from Github pull request into TeamCity CI
#!/usr/bin/env python
import os
import sys
import json
try:
from urllib.request import Request, urlopen # Python 3
except:
from urllib2 import Request, urlopen # Python 2
@kobymeir
kobymeir / teamcity_messages.sh
Last active October 15, 2017 22:24 — forked from VladRassokhin/service-messages.sh
Simple bash functions library to say something to TeamCity. See https://confluence.jetbrains.com/display/TCDL/Build+Script+Interaction+with+TeamCity will only printout messages if running under TeamCity, otherwise nothing will be printed out.
#!/usr/bin/env bash
# Documentation for TeamCity messages:
# https://confluence.jetbrains.com/display/TCDL/Build+Script+Interaction+with+TeamCity
function __tc_encode {
# Only unicode characters are not supported
echo -n "$1" | sed "s/\([|']\)/\|\1/g; s/\[/\|\[/g; s/\]/\|\]/g; s/\r/\|r/g;" | sed ':a;N;$!ba;s/\n/|n/g'
}