Skip to content

Instantly share code, notes, and snippets.

@kobymeir
kobymeir / teamcity_github_pr_branch.py
Last active Jun 6, 2019 — forked from dzzh/teamcity_github_pr_branch.py
Inject source and target branches from Github pull request into TeamCity CI
View teamcity_github_pr_branch.py
#!/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 Oct 15, 2017 — 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.
View teamcity_messages.sh
#!/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'
}