Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving version v.23.08.03 #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
auto
common/conf.d/test-odoo.cfg
custom/src/*
!custom/src/.gitkeep
!custom/src/addons.yaml
!custom/src/repos.yaml

datadir
.env
.env-secret
logfile
migrate-backup
migrate-logfiles
migrate-temporary
.ignore
logfiles
odoo-code
*.pyc
.pyenv
*.pyo
.slide
.venv
waftlib
.venv*
.vscode
25 changes: 14 additions & 11 deletions bootstrap
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
#!/bin/sh
# Version: v.23.08.03

set -e

export LIBRARIES_REPOSITORIES='https://github.com/sunflowerit/waftlib.git'
export LIBRARIES_VERSION_BRANCH=${LIBRARIES_VERSION_BRANCH:-v.22.05.30} #versions: v.21.05.10, v.21.09.22, v.22.05.30
# Libraries version branches: v.21.05.10, v.21.09.22, v.22.05.30, v.23.08.03
export LIBRARIES_VERSION_BRANCH="${LIBRARIES_VERSION_BRANCH:-v.23.08.03}"

################################################################
###### ######
###### Don't change variables after this line ######
###### ######
################################################################

SCRIPT_PATH=$(cd "$(/usr/bin/dirname "$0")" && /bin/pwd)
ODOO_WORK_DIR=$(cd $SCRIPT_PATH && /bin/pwd)
cd $ODOO_WORK_DIR
SCRIPT_PATH="$(cd "$(/usr/bin/dirname "${0}")" && /bin/pwd)"
ODOO_WORK_DIR="$(cd "${SCRIPT_PATH}" && /bin/pwd)"
cd "${ODOO_WORK_DIR}"

/bin/echo "INFO: Remove exist $ODOO_WORK_DIR/waftlib"
/bin/rm -fr $ODOO_WORK_DIR/waftlib
/bin/echo "INFO: Clone $LIBRARIES_REPOSITORIES to $ODOO_WORK_DIR/waftlib"
/usr/bin/git clone -b $LIBRARIES_VERSION_BRANCH $LIBRARIES_REPOSITORIES $ODOO_WORK_DIR/waftlib 2> /dev/null || \
/usr/bin/git clone -b master $LIBRARIES_REPOSITORIES $ODOO_WORK_DIR/waftlib
/bin/echo "( INFO ) : Remove exist ${ODOO_WORK_DIR}/.ignore/waftlib"
/bin/rm -fr "${ODOO_WORK_DIR}/.ignore/waftlib" && \
/bin/mkdir -p "${ODOO_WORK_DIR}/.ignore/waftlib"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will need time for a full review, but one thing I have doubts about is the .ignore directory, I understand that contains all the stuff that git should not add to the repository, but having a few more entries in .gitignore seems to me a very minor problem.

I think it might help in understanding the structure if we follow the conventions used in a lot of projects. Like putting libraries needed before anything in a lib directory (./lib/waftlib), putting every artefact created by build in a ./build directory.

Maybe not crucial for how it all works, but when we are moving and reorganizing directories anyway, why not?

Copy link
Member Author

@Hussam-Suleiman Hussam-Suleiman Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will need time for a full review,

take your time.

but one thing I have doubts about is the .ignore directory, I understand that contains all the stuff that git should not add to the repository, but having a few more entries in .gitignore seems to me a very minor problem.

in my opinion, just the all stuff in .ignore directory that git should not add to the repository, not .ignore directory contains all the stuff that git should not add to the repository.

I think it might help in understanding the structure if we follow the conventions used in a lot of projects. Like putting libraries needed before anything in a lib directory (./lib/waftlib), putting every artefact created by build in a ./build directory.

in my opinion, we don't have any library in this code that we import from outside, this project is not a python code, it is a few scripts (sometimes python scripts, sometimes bash or shell scripts), and 'lib' directories confused others, we have a small code that we use it in many scripts so we putted it in /.venv-*/lib/python*/site-packages/venv*lib/ as link, and I didn't see it is a reason to have a directory for it in the main project directory.

Maybe not crucial for how it all works, but when we are moving and reorganizing directories anyway, why not?

both are good for me, just I did what I liked, we can discuss it more with other members in our team.

/bin/echo "( INFO ) : Clone ${LIBRARIES_REPOSITORIES} to ${ODOO_WORK_DIR}/.ignore/waftlib"
/usr/bin/git clone -b "${LIBRARIES_VERSION_BRANCH}" "${LIBRARIES_REPOSITORIES}" "${ODOO_WORK_DIR}/.ignore/waftlib" 2> /dev/null || \
/usr/bin/git clone -b master "${LIBRARIES_REPOSITORIES}" "${ODOO_WORK_DIR}/.ignore/waftlib"

/bin/echo "INFO: Run $ODOO_WORK_DIR/waftlib/bootstrap script"
$ODOO_WORK_DIR/waftlib/bootstrap
/bin/echo "( INFO ) : Run ${ODOO_WORK_DIR}/.ignore/waftlib/bootstrap script"
"${ODOO_WORK_DIR}/.ignore/waftlib/bootstrap"
Empty file removed custom/src/.gitkeep
Empty file.