This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yell() { echo "$0: $*" >&2; } | |
die() { yell "$*"; exit 1; } | |
try() { "$@" || die "cannot $*"; } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 {} \; |