Skip to content

Commit

Permalink
Release 1.4.0
Browse files Browse the repository at this point in the history
Added
-----

- New option `--enforce-bump` to `odoo-helper ci fix-versions` and `odoo-helper ci check-versions` commands.

Changed
-------

- Changed default installed version of [wkhtmltopdf](https://wkhtmltopdf.org/) to [0.12.6.1 r3](https://github.com/wkhtmltopdf/packaging/releases/tag/0.12.6.1-3). Thus it have to be working on Ubuntu 22.04+
  • Loading branch information
katyukha committed Nov 8, 2023
2 parents f966edf + f6633fd commit ee8557b
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 46 deletions.
9 changes: 2 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ flake8:
# Install deps
- apt-get update -qq && apt-get install -yqq adduser sudo locales ruby git
- update-locale LANG=C.UTF-8 && update-locale LC_ALL=C.UTF-8 && update-locale LANGUAGE=C.UTF-8
- gem install bashcov codecov simplecov-console
- gem install bashcov -v 1.8.2
- gem install codecov simplecov-console

# Configure Odoo user
- adduser -q odoo
Expand All @@ -88,12 +89,6 @@ flake8:
- if: $CI_COMMIT_BRANCH


tests:ubuntu:18.04:
image: ubuntu:18.04
variables:
ODOO_INSTALL_NODE_VERSION: "16.15.1"
<<: *tests-definition

tests:ubuntu:20.04:
image: ubuntu:20.04
<<: *tests-definition
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Release Notes

## Release 1.4.0 (2023-11-08)

### Added

- New option `--enforce-bump` to `odoo-helper ci fix-versions` and `odoo-helper ci check-versions` commands.

### Changed

- Changed default installed version of [wkhtmltopdf](https://wkhtmltopdf.org/) to [0.12.6.1 r3](https://github.com/wkhtmltopdf/packaging/releases/tag/0.12.6.1-3). Thus it have to be working on Ubuntu 22.04+

---

## Release 1.3.0 (2023-03-28)

### Added
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ The canonical source of odoo-helper-scripts is hosted on [GitLab](https://gitlab
- *13.0*
- *14.0*
- *15.0*
- *16.0* (**experimental**)
- *16.0*
- OS support:
- On *Ubuntu* should work nice (auto tested on *Ubuntu 18.04, 20.04*)
- On *Ubuntu* should work nice (auto tested on *Ubuntu 20.04, 22.04*)
- Also should work on *Debian* based systems, but some troubles may happen with installation of system dependencies.
- Other linux systems - in most cases should work, but system dependecies must be installed manualy.
- Missed feature? [Fill an issue](https://gitlab.com/katyukha/odoo-helper-scripts/issues/new)
Expand Down
2 changes: 1 addition & 1 deletion bin/odoo-install
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ config_set_defaults; # imported from common module

install_create_project_dir_tree; # imported from 'install' module

if [ "$ODOO_INSTALL_SYS_DEPS_AUTO" -eq 1 ]; then
if [ -n "$ODOO_INSTALL_SYS_DEPS_AUTO" ] && [ "$ODOO_INSTALL_SYS_DEPS_AUTO" -eq 1 ]; then
echo -e "${BLUEC}Installing system dependencies for Odoo ${YELLOWC}${ODOO_VERSION}${BLUEC}...${NC}";
install_sys_deps_for_odoo_version "${ODOO_VERSION}";
fi
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ please, read carefully [Usage notes](#usage-note) section.
- *13.0*
- *14.0*
- *15.0*
- *16.0* (**experimental**)
- *16.0*
- OS support:
- On *Ubuntu* should work nice
- Also should work on *Debian* based systems, but some troubles may happen with installation of system dependencies.
Expand Down
17 changes: 16 additions & 1 deletion lib/ci.bash
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ function ci_check_versions_git {
addons. Increases major part of version number
--fix-version-fp - [experimental] Fix version conflicts during
forwardport
--enforce-bump - [experimental] Enforce version bump for current module.
-h|--help|help - print this help message end exit
Parametrs:
Expand All @@ -216,6 +217,7 @@ function ci_check_versions_git {
local opt_fix_version_minor=0;
local opt_fix_version_major=0;
local opt_fix_version_fp=0;
local opt_enforce_version_bump=0
local cdir;
while [[ $# -gt 0 ]]
do
Expand Down Expand Up @@ -261,6 +263,10 @@ function ci_check_versions_git {
opt_fix_version_fp=1;
shift;
;;
--enforce-bump)
opt_enforce_version_bump=1;
shift;
;;
*)
break;
;;
Expand Down Expand Up @@ -337,7 +343,7 @@ function ci_check_versions_git {
fi

# Compare version
if ci_ensure_versions_ok "$version_before" "$version_after"; then
if [ "$opt_enforce_version_bump" -eq 0 ] && ci_ensure_versions_ok "$version_before" "$version_after"; then
# version before is less that version_after
echoe -e "${GREENC}OK${NC}";
else
Expand Down Expand Up @@ -412,6 +418,9 @@ function ci_cmd_git_fix_versions {
addons. Increases minor part of version number
-M|--major - Attempt to fix versions in changed
addons. Increases major part of version number
--ignore-trans - ignore translations
Note: this option may not work on old git versions
--enforce-bump - [experimental] Enforce version bump for current module.
-h|--help|help - print this help message end exit
Parametrs:
Expand Down Expand Up @@ -445,6 +454,12 @@ function ci_cmd_git_fix_versions {
git_check_versions_opts+=( --fix-version-major );
shift;
;;
--enforce-bump)
git_check_versions_opts+=( --enforce-bump );
;;
--ignore-trans)
git_check_versions_opts+=( --ingore-trans );
;;
*)
break;
;;
Expand Down
13 changes: 7 additions & 6 deletions lib/install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ function install_fetch_odoo {
# install_wkhtmltopdf_get_dw_link <os_release_name> [wkhtmltopdf version]
function install_wkhtmltopdf_get_dw_link {
local os_release_name=$1;
local version=${2:-0.12.5};
local version=${2:-0.12.6.1-3};
local system_arch;
system_arch=$(dpkg --print-architecture);

echo "https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/$version/wkhtmltox_${version}-1.${os_release_name}_${system_arch}.deb"
echo "https://github.com/wkhtmltopdf/packaging/releases/download/$version/wkhtmltox_${version}.${os_release_name}_${system_arch}.deb"
}


Expand All @@ -153,10 +153,11 @@ function install_wkhtmltopdf_download {
local old_release=$release;

if [ -n "$wkhtmltox_fallback" ] && [ "$(lsb_release -si)" == "Ubuntu" ]; then
# fallback to trusty release for ubuntu systems
release=focal;
# fallback to latest releases for ubuntu systems
release=jammy;
elif [ -n "$wkhtmltox_fallback" ] && [ "$(lsb_release -si)" == "Debian" ]; then
release=stretch;
# fallback to latest releases for debian systems
release=bookworm;
elif [ -z "$wkhtmltox_fallback" ]; then
echoe -e "${REDC}ERROR:${NC} Cannot install ${BLUEC}wkhtmltopdf${NC}! Try to use --fallback option to install wkthmltopdf for other supported release, or install system's wkhtmltopdf.";
if [ -e "$wkhtmltox_path" ]; then rm "$wkhtmltox_path"; fi
Expand Down Expand Up @@ -531,7 +532,7 @@ function install_odoo_py_requirements_for_version {
fi
elif [ "$odoo_major_version" -lt 11 ] && [[ "$dependency_stripped" =~ psycopg2* ]]; then
echo "psycopg2==2.8.6";
elif [[ "$dependency_stripped" =~ psycopg2* ]] && exec_py -c "import sys; assert sys.version_info <= (3, 5);" > /dev/null 2>&1; then
elif [[ "$dependency_stripped" =~ psycopg2* ]] && exec_py -c "import sys; assert sys.version_info <= (3, 6);" > /dev/null 2>&1; then
echo "psycopg2-binary==2.8.6";
elif [[ "$dependency_stripped" =~ psycopg2* ]]; then
echo "psycopg2-binary";
Expand Down
10 changes: 8 additions & 2 deletions lib/odoo.bash
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,14 @@ function odoo_clean_compiled_assets {
for dbname in "${dbnames[@]}"; do
# TODO select id,name,store_fname from ir_attachment where name ilike '%/web/content/%-%/%';
PGAPPNAME="odoo-helper" postgres_psql -d "$dbname" << EOF
DELETE FROM ir_attachment WHERE name ILIKE '%/web/content/%/web.assets%';
DELETE FROM ir_attachment WHERE name ~* '/[a-z0-9_]+/static/(lib|src)/.*.(scss|less).css';
DELETE FROM ir_attachment WHERE name ILIKE '%/web/content/%/web.assets%';
DELETE FROM ir_attachment WHERE name ~* '/[a-z0-9_]+/static/(lib|src)/.*.(scss|less).css';
-- Version 15+?
DELETE FROM ir_attachment
WHERE res_model = 'ir.ui.view'
AND type = 'binary'
AND (url ILIKE '/web/content/%' OR url ILIKE '/web/assets/%');
EOF
done
}
Expand Down
2 changes: 1 addition & 1 deletion lib/version.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# Odoo Helper Scripts: Version

# Define version number
ODOO_HELPER_VERSION="1.3.0";
ODOO_HELPER_VERSION="1.4.0";
ODOO_HELPER_CONFIG_VERSION="1";
106 changes: 81 additions & 25 deletions tests/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -683,13 +683,16 @@ odoo-helper addons install --ual --dir ./repositories/crnd-inc/generic-addons;
# List addons in generic_addons
odoo-helper lsa ./repositories/crnd-inc/generic-addons;

# Fetch bureaucrat_helpdesk_lite from Odoo market and try to install it
odoo-helper fetch --odoo-app bureaucrat_helpdesk_lite;
odoo-helper addons install --ual bureaucrat_helpdesk_lite;
# Install poppler utils package, that is required by bureaucrat knowledge base
sudo apt-get install -qqy poppler-utils

# Fetch helpdesk second time testing bechavior
# Fetch bureaucrat_knowledge from Odoo market and try to install it
odoo-helper fetch --odoo-app bureaucrat_knowledge;
odoo-helper addons install --ual --show-log-on-error bureaucrat_knowledge;

# Fetch knowledge base second time testing bechavior
# when same addons already present in system
odoo-helper-fetch --odoo-app bureaucrat_helpdesk_lite;
odoo-helper-fetch --odoo-app bureaucrat_knowledge;

# Prepare to test pull updates with --do-update option
(cd ./repositories/crnd-inc/generic-addons && git reset --hard HEAD^^^1);
Expand Down Expand Up @@ -762,9 +765,9 @@ odoo-helper fetch --github crnd-inc/generic-addons
# Install addons from OCA contract
odoo-helper addons install --ual --dir ./repositories/crnd-inc/generic-addons;

# Fetch bureaucrat_helpdesk_lite from Odoo market and try to install it
odoo-helper fetch --odoo-app bureaucrat_helpdesk_lite;
odoo-helper addons install --ual bureaucrat_helpdesk_lite;
# Fetch bureaucrat_knowledge from Odoo market and try to install it
odoo-helper fetch --odoo-app bureaucrat_knowledge;
odoo-helper addons install --ual bureaucrat_knowledge;

# Print list of installed addons
odoo-helper addons find-installed --packager-format;
Expand Down Expand Up @@ -819,9 +822,9 @@ odoo-helper fetch --github crnd-inc/generic-addons
# Install addons from OCA contract
odoo-helper addons install --ual --dir ./repositories/crnd-inc/generic-addons;

# Fetch bureaucrat_helpdesk_lite from Odoo market and try to install it
odoo-helper fetch --odoo-app bureaucrat_helpdesk_lite;
odoo-helper addons install --ual bureaucrat_helpdesk_lite;
# Fetch bureaucrat_knowledge from Odoo market and try to install it
odoo-helper fetch --odoo-app bureaucrat_knowledge;
odoo-helper addons install --ual bureaucrat_knowledge;

# Print list of installed addons
odoo-helper addons find-installed;
Expand Down Expand Up @@ -892,15 +895,15 @@ odoo-helper fetch --github crnd-inc/generic-addons
## Install addons from OCA contract
odoo-helper addons install --ual --dir ./repositories/crnd-inc/generic-addons;

## Fetch bureaucrat_helpdesk_lite from Odoo market and try to install it
odoo-helper fetch --odoo-app bureaucrat_helpdesk_lite;
odoo-helper addons install --ual bureaucrat_helpdesk_lite;
## Fetch bureaucrat_knowledge from Odoo market and try to install it
odoo-helper fetch --odoo-app bureaucrat_knowledge;
odoo-helper addons install --ual bureaucrat_knowledge;

## Print list of installed addons
odoo-helper addons find-installed;

## Run tests for helpdesk lite
odoo-helper test generic_request crnd_wsd
## Run tests for knowledge
odoo-helper test bureaucrat_knowledge

# Drop created databases
odoo-helper db drop odoo15-odoo-test;
Expand Down Expand Up @@ -958,25 +961,78 @@ odoo-helper lsd; # List databases
odoo-helper install website;

## Fetch oca/contract
#odoo-helper fetch --github crnd-inc/generic-addons

## Install addons from OCA contract
#odoo-helper addons install --ual --dir ./repositories/crnd-inc/generic-addons;
odoo-helper fetch --github crnd-inc/generic-addons

## Fetch bureaucrat_helpdesk_lite from Odoo market and try to install it
#odoo-helper fetch --odoo-app bureaucrat_helpdesk_lite;
#odoo-helper addons install --ual bureaucrat_helpdesk_lite;
## Fetch bureaucrat_knowledge from Odoo market and try to install it
odoo-helper fetch --odoo-app bureaucrat_knowledge;
odoo-helper addons install --ual bureaucrat_knowledge;

## Print list of installed addons
#odoo-helper addons find-installed;
odoo-helper addons find-installed;

## Run tests for helpdesk lite
#odoo-helper test generic_request crnd_wsd
odoo-helper test bureaucrat_knowledge

# Drop created databases
odoo-helper db drop odoo16-odoo-test;


#echo -e "${YELLOWC}
#=================================
#Install and check Odoo 17.0 (Py3)
#=================================
#${NC}"

#cd ../;

## Remove odoo 17
## this is needed to bypass gitlab.com limitation of disk space for CI jobs
#rm -rf ./odoo-16.0

## Install odoo 17
#odoo-helper install sys-deps -y 17.0;

#odoo-install --install-dir odoo-17.0 --odoo-version 17.0 \
#--http-port 8569 --http-host local-odoo-16 \
#--db-user odoo16 --db-pass odoo --create-db-user \
#--build-python-if-needed

#cd odoo-17.0;

## Install py-tools and js-tools
#odoo-helper install py-tools;
#odoo-helper install js-tools;

#odoo-helper server run --stop-after-init; # test that it runs

## Show project status
#odoo-helper status;
#odoo-helper server status;
#odoo-helper start;
#odoo-helper ps;
#odoo-helper status;
#odoo-helper server status;
#odoo-helper stop;

## Show complete odoo-helper status
#odoo-helper status --tools-versions --ci-tools-versions;

## Database management
#odoo-helper db create --tdb --lang en_US;

#odoo-helper addons update-list --tdb;
#odoo-helper addons install --tdb --module crm;
#odoo-helper addons test-installed crm;

#odoo-helper lsd; # List databases

### Install addon website via 'odoo-helper install'
#odoo-helper install website;

## Drop created databases
#odoo-helper db drop odoo17-odoo-test;


echo -e "${YELLOWC}
=============================================================
Run 'prepare-docs' script to test generation of help messages
Expand Down

0 comments on commit ee8557b

Please sign in to comment.