[FIXED] Se corrige los problemas la rama de proyectos nuevos

- Se crea una rama devs de trabajo o desarrollo
- Se crea una rama v<n> donde <n> representa la versión de odoo para producción
This commit is contained in:
Mauro Rosero P. 2024-12-04 05:15:23 -05:00
parent 4fd1b08fd7
commit 39c7aecbae
Signed by: mrosero
GPG key ID: 83BD2A5F674B7E26
2 changed files with 13 additions and 16 deletions

View file

@ -143,13 +143,8 @@ function git_init() {
local REPO_PATH=$1
local BRANCH=$2
cd $REPO_PATH
if [ $? -eq 0 ]; then
git init -b $BRANCH
git init "$REPO_PATH" -b $BRANCH
return $?
else
return 255
fi
}
@ -169,13 +164,14 @@ function git_add_full() {
}
# Git add tracked files to repository
function git_commit_first() {
function git_commit() {
local REPO_PATH=$1
local GIT_MESSAGES=$2
cd $REPO_PATH
if [ $? -eq 0 ]; then
git commit -m "$git_first_commited"
git commit -m "$GIT_MESSAGES"
return $?
else
return 255

View file

@ -113,7 +113,7 @@ fi
# Check if odoo version is supported
odoo_verscheck $ODOO_VERS
if [ $? -eq 0 ]; then
if [ $? -ne 0 ]; then
echo "[-] $odmsg_014_1 $ODOO_VERS $odmsg_014_2"
exit 2
fi
@ -140,28 +140,29 @@ copy_odooapps $BIN_HOME "$PROJECT_NAME" "${ODOO_VERS}" $ODOO_PKG_DEVS
copy_odooapps $BIN_HOME "$PROJECT_NAME" "${ODOO_VERS}" $ODOO_PKG_INAR
# Initialize git repository
if [ ! -d "$BIN_HOME/$PROJECT_NAME/$ODOO_APP/.git" ]
if [ ! -d "$BIN_HOME/$PROJECT_NAME/.git" ]
then
result=$(git_init "$BIN_HOME/$PROJECT_NAME/$ODOO_APP" $ODOO_DEF_BRCH)
result=$(git_init "$BIN_HOME/$PROJECT_NAME" "v$ODOO_VERS")
if [ $? -eq 0 ]; then
echo "[x] $result"
echo "[x] $git_setbranch: $ODOO_DEF_BRCH"
cp -f $BIN_HOME/$ODOO_CFG/$ODOO_CFG_GITI $BIN_HOME/$PROJECT_NAME/$ODOO_APP/
echo "[x] $git_setbranch: v$ODOO_VERS"
cp -f $BIN_HOME/$ODOO_CFG/$ODOO_CFG_GITI $BIN_HOME/$PROJECT_NAME/
echo "[x] $git_gitignored $ODOO_CFG_GITI"
else
echo echo "[-] $git_notinitialized"
fi
result=$(git_add_full "$BIN_HOME/$PROJECT_NAME/$ODOO_APP")
result=$(git_add_full "$BIN_HOME/$PROJECT_NAME")
if [ $? -eq 0 ]; then
echo "[x] $git_add_files"
else
echo "$result"
fi
result=$(git_commit_first "$BIN_HOME/$PROJECT_NAME/$ODOO_APP")
result=$(git_commit "$BIN_HOME/$PROJECT_NAME" "$git_first_commited")
if [ $? -eq 0 ]; then
echo "[x] $git_end_commited"
cd $BIN_HOME/$PROJECT_NAME && git checkout -q -b $ODOO_DEF_BRCH && echo "[x] $git_setbranch: $ODOO_DEF_BRCH"
else
echo "$result"
fi