Skip to content

Instantly share code, notes, and snippets.


Geoffroy Jabouley gjabouley-invn

View GitHub Profile
yell() { echo "$0: $*" >&2; }
die() { yell "$*"; exit 1; }
try() { "$@" || die "cannot $*"; }
View gist:310b111e749880d62b681c8f7645e77e
# Create a branch name using short commit sha1, then push on it
BRANCH_NAME=migration/$(git log -1 --pretty=format:%h)_submodule_github
git checkout -b $BRANCH_NAME
git commit -am "[GITHUB MIGRATION] Update submodules urls on protected branches"
git push --set-upstream origin $BRANCH_NAME
# Git lfs migrate
git clone --mirror ${REPO_URL} local_folder && pushd local_folder && git lfs fetch --all && git lfs migrate --everything info
git lfs migrate import --everything --verbose --object-map=../ --include="<PATTERNS>" (ex: *.apk,*.png)
View gist:6b9d18cd6403f89ee8ca12fe1e532357
# Jenkins symlinks becoming folders:
find $JENKINS_BUILDS_FOLDER -type d \( -name "last*Build" -o -name "lastStable" -o -name "lastSuccessful" \) -exec echo Directory: {} \;
find $JENKINS_BUILDS_FOLDER -type d \( -name "last*Build" -o -name "lastStable" -o -name "lastSuccessful" \) -exec mv {} {}.err \;
find $JENKINS_BUILDS_FOLDER -type d -name "*.err" -exec rm -rf {} \;
# Change ownership to bitnami of all folders being member of root group (not recursive)
find . -maxdepth 1 -group root -exec sudo chown -hR bitnami:bitnami {} \;
find . -maxdepth 1 -group root -exec sudo chown -hR jenkins:staff {} \;