Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan McLean ryanm101

View GitHub Profile
@ryanm101
ryanm101 / ComposeDepMapper.py
Created Apr 5, 2019
Shows which services from a docker compose depends on which other services
View ComposeDepMapper.py
from os import listdir
from io import open
import getopt
import sys
import yaml
from graphviz import Digraph
@ryanm101
ryanm101 / dockerDepMap.py
Last active Apr 5, 2019
Generates a PNG map of dockerfile dependancies
View dockerDepMap.py
from os import listdir, path
from io import open
import getopt
import glob
from pathlib import Path
import re
import sys
import yaml
from graphviz import Digraph
View gist:3737a1db53749d6f6dfa580823b16d58
def get_build_version() {
println "BRANCH: " + BRANCH
def gitTag = sh(returnStdout: true, script: "git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null | sed -n 's/^\\([^^~]\\{1,\\}\\)\\(\\^0\\)\\{0,1\\}\$/\\1/p'").trim()
println "TAG: " + gitTag
if (gitTag?.trim()) {
println "Release Build"
return gitTag
} else {
println "Regular Build"
try {
@ryanm101
ryanm101 / Jenkinsfile
Created Aug 10, 2018
Git / Jenkins AutoVersioning
View Jenkinsfile
def TARGET_RELEASE = ""
def BUILD_VERSION = ""
timestamps {
node('linux') {
withEnv(['PY2_BIN=/builds/tools/python/2.7.14/bin/python',
'PY3_BIN=/builds/tools/python/3.6/bin/python',
'PY2_PATH=/builds/tools/python/2.7.14/bin',
'PY3_PATH=/builds/tools/python/3.6/bin',
'http_proxy=http://myproxy.com:80',
@ryanm101
ryanm101 / Popen_patch.py
Last active Aug 3, 2018
Mock / Monkeypatch Popen in Python with pytest
View Popen_patch.py
def test_myfunc(monkeypatch, tmpdir):
def download_from_sftp(td, fl)
for file_ in flist:
current_file = tdir.join(file_)
current_file.write('')
return "stdout", "stderror"
dst_dir = tmpdir.mkdir('dstdir')
sftp_file_list = ['file1', 'file2']
View keybase.md

Keybase proof

I hereby claim:

  • I am ryanm101 on github.
  • I am ryanm101 (https://keybase.io/ryanm101) on keybase.
  • I have a public key ASCmdQqsXoEKz7O2V4Ipv_CS19oH7O83joY5-a1xQpVukQo

To claim this, I am signing this object: