Skip to content

Instantly share code, notes, and snippets.

View ldalorion's full-sized avatar

dalorion ldalorion

View GitHub Profile
@ldalorion
ldalorion / sync-repo-TC-command-line-step.sh
Created December 31, 2019 04:28
push branch changes in one direction
# a spin off of the first set of instructions on this page :
# https://www.opentechguides.com/how-to/article/git/177/git-sync-repos.html
set -ex
git remote add -f destination-repo %env.[destination git repo w credentials]%
# evaluate if branch exists in destination git repo
EXISTS="$(git ls-remote --heads %env.[destination repo]% %teamcity.build.vcs.branch.[TC build config Id]% | wc -l)"
# if branch exists in destination git repo then pull the existing branch before pushing commits
if [ "${EXISTS}" == "1" ] ; then
@ldalorion
ldalorion / verifyPodStatus.sh
Last active December 31, 2019 01:26
Check pod status before running acceptance tests during deployment.
#!/bin/bash
expected="True"
declare -i expectedInstances=2
echo "checking for ${expectedInstances} instance running"
for ((n=1;n < $((expectedInstances));n++)); do
expected="${expected} True";
done
ATTEMPTS=300
@ldalorion
ldalorion / simple-https-server.py
Last active January 25, 2019 21:26 — forked from dergachev/simple-https-server.py
Added CORS request handler
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# 1. generate server.pem with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# 2. run as follows:
# python simple-https-server.py
# 3. then in your browser, visit:
# https://localhost:4443
# Other notes:
# (I actually created my own self-signed certifcation on my Mac instead of doing step 1 because I don't read instructions.)