Skip to content

Instantly share code, notes, and snippets.

@waltercruz
Forked from halian-vilela/post-merge
Created October 26, 2017 17:39
Show Gist options
  • Save waltercruz/ef5c2ebe4c449f376ca178670c95ac8e to your computer and use it in GitHub Desktop.
Save waltercruz/ef5c2ebe4c449f376ca178670c95ac8e to your computer and use it in GitHub Desktop.
Verlindo Git Merge
#!/bin/bash
NC="\033[0m" # No Color
ORANGE_W="\033[1;33m"
GREEN_W="\033[1;32m"
BUILD_DIR=../build
SRC_DIR=`pwd`
MESSAGE=`git log -1 --pretty=%B`
#echo -e "${ORANGE_W}Copiando arquivos para o build${NC}"
#cp -rv * $BUILD_DIR
echo -e "${ORANGE_W}Commitando mudanças no outro repositório${NC}"
cd ..
git add --all
git commit -am "$MESSAGE"
if [ 0 -eq $? ]
then
echo -e "${GREEN_W}Commit realizado com sucesso!${NC}"
fi
git push deploy_dev
if [ 0 -eq $? ]
then
cd ${SRC_DIR}
git checkout dev
if [ 0 -eq $? ]
then
echo -e "${GREEN_W}Deploy realizado com sucesso!${NC}"
fi
fi
#!/bin/bash
NC="\033[0m" # No Color
ORANGE_W="\033[1;33m"
GREEN_W="\033[1;32m"
BUILD_DIR=../build
SRC_DIR=`pwd`
MESSAGE=`git log -1 --pretty=%B`
#echo -e "${ORANGE_W}Copiando arquivos para o build${NC}"
#cp -rv * $BUILD_DIR
echo -e "${ORANGE_W}Commitando mudanças no outro repositório${NC}"
cd ..
git add --all
git commit -am "$MESSAGE"
if [ 0 -eq $? ]
then
echo -e "${GREEN_W}Commit realizado com sucesso!${NC}"
fi
git push deploy_dev
if [ 0 -eq $? ]
then
cd ${SRC_DIR}
git checkout dev
if [ 0 -eq $? ]
then
echo -e "${GREEN_W}Deploy realizado com sucesso!${NC}"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment