Skip to content

Instantly share code, notes, and snippets.

View gjabouley-invn's full-sized avatar

Geoffroy Jabouley gjabouley-invn

View GitHub Profile
# 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
export REPO_URL=<REPO_COMPLETE_URL>
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=../mapping_file.map.txt --include="<PATTERNS>" (ex: *.apk,*.png)
# Jenkins symlinks becoming folders: https://support.cloudbees.com/hc/en-us/articles/216227047-After-moving-a-job-symlinks-for-folders-became-actual-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 {} \;
yell() { echo "$0: $*" >&2; }
die() { yell "$*"; exit 1; }
try() { "$@" || die "cannot $*"; }
@gjabouley-invn
gjabouley-invn / README.md
Created January 9, 2020 15:03
Vagrant 2.2.6 command slow to start on Windows