Skip to content

Instantly share code, notes, and snippets.

@lucasadrianof
Last active October 2, 2020 18:53
Show Gist options
  • Save lucasadrianof/c9943d94c0873ea52a6f29f5dc987652 to your computer and use it in GitHub Desktop.
Save lucasadrianof/c9943d94c0873ea52a6f29f5dc987652 to your computer and use it in GitHub Desktop.
.bashrc com os principais atalhos e aliases utilizados pela equipe de Dev do MagaZord
export faderim_app=app-magazord
alias git-pull-all="find . -maxdepth 3 -name .git -type d | rev | cut -c 6- | rev | xargs -I {} sh -c 'echo ""Atualizando repositório"" {}; git -C {} pull'"
docker_magazord() {
(cd /mnt/Dev/dev/docker-magazord; docker-compose $@)
}
docker_magapay() {
(cd /mnt/Dev/dev/docker-magapay; docker-compose $@)
}
xphp() {
projeto=$(pwd | grep -o "[a-zA-Z-]*$")
docker run --rm -it \
-v ${PWD}:/var/www/html/$projeto \
-w /var/www/html/$projeto \
-e faderim_app=$faderim_app \
magazord php \
-d xdebug.remote_autostart=On \
$@
}
xphpjob() {
xphp cli.php run $@
}
phpmig() {
additionalParams=$(([ $1 = "execute" ] || [ $1 = "migrate" ]) && echo "--no-interaction" || echo "")
xphp cli.php migrations:$@ $additionalParams
}
switch_rev_sprint() {
echo Informe a nova revisão:
read rev
for dir in $(ls -d /mnt/Dev/htdocs/* | grep sprint); do
url=$(svn info $dir | grep -Po "(?<=^URL: ).*")
newurl=$(echo $url | sed "s/[0-9]\.[0-9]\{2\}$/$rev/g")
echo Alterando versão do $dir para $rev
svn switch $newurl $dir
done
}
dumpdoctrine () {
xphp vendor/doctrine/orm/bin/doctrine.php orm:schema-tool:update --dump-sql > /mnt/Dev/temp/scripts-doctrine.sql
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment