Skip to content

Instantly share code, notes, and snippets.

View guykisel's full-sized avatar
😸
sup?

Guy Kisel guykisel

😸
sup?
View GitHub Profile
# We're using:
# Repository local hooks: https://pre-commit.com/#repository-local-hooks
# Plus vendored https://github.com/pre-commit/pre-commit-hooks
repos:
- repo: local
hooks:
- id: custom-pre-commit
name: custom-pre-commit
entry: run_python.sh gitstuff/hooks/pre_commit.py
language: system
@guykisel
guykisel / riotPerforce.groovy
Created January 28, 2019 19:23
simplified jenkins p4-plugin wrapper
import groovy.transform.Field
// we want this to be global so that we can consistently
// sync the same changelist over the course of our pipeline
@Field currentChangelist = ''
def riotP4Sync(Map config = [:]) {
def humanReadableName = safePath("${JOB_NAME}-${STAGE_NAME}")
def jenkinsWorkspaceName = safePath("${JOB_NAME}-") + workspaceShortname(env.STAGE_NAME)
@guykisel
guykisel / gist:fdc3bb48392a4d871140
Created January 22, 2015 18:39
Jenkins Best Practices
Jenkins Best Practices
https://en.wikipedia.org/wiki/Continuous_integration<- Read this!
https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Best+Practices
http://www.slideshare.net/andrewbayer/7-habits-of-highly-effective-jenkins-users
Set up version control of job configurations
Keep jobs simple! Don't put a ton of bash in each job. If a job needs to do something complex, put it in a script in GitHub and check it out as needed.
Use templated builders to simplify common tasks
Keep all scripts in version control - avoid running scripts that live on the Jenkins server filesystem
Don't install unnecessary plugins - plugins are often written by third parties and can interact with each other in strange ways
Use LDAP authentication if possible for traceability - avoid anonymous access
@guykisel
guykisel / help.md
Last active August 29, 2015 14:12
help template

So you want to ask for help? Fill in this template. It'll save us all a lot of time.

Short summary of the problem

What are you doing? What's going wrong? Why do you need help? Keep this short and simple.

What's your best guess of what's causing the problem?

If you haven't already, take a moment to think about this. Do you have any ideas?

@guykisel
guykisel / autocast.py
Last active August 29, 2015 14:07
RF autocast
# No autocast:
# https://github.com/guykisel/robotframework-faker/issues/3
# Does not work: ${WordsList} = Words nb=10
# Works: ${WordsList} = Words nb=${10}
# Libdoc introspects accurate args/kwargs
def __getattr__(self, name):
func = None
if name in self._fake.__dict__.keys():
return self._fake.__dict__[name].im_func)
@guykisel
guykisel / .bashrc
Last active August 29, 2015 14:06
export PATH=~/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/sbin:$PATH
# virtualenv config
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
GIT_PS1_SHOWDIRTYSTATE=true
export PS1='[\u@mbp \w$(__git_ps1)]\$ '
@guykisel
guykisel / tuning.robot
Created August 22, 2014 23:02
RF keyword recommendations tuning tests
*** Settings ***
Resource resources/recommendation_resource_1.robot
Resource resources/recommendation_resource_2.robot
Library resources/RecLibrary1.py
Library resources/RecLibrary2.py WITH NAME Rec Library 2 With Custom Name
*** Test Cases ***
Keyword From Library Not Imported
[Documentation] FAIL
RecLibrary3.Keyword Only In Library 3