commit 895a2e24671afe03adac80af2881738015cabded Author: lukas Date: Fri Mar 18 09:59:38 2022 +0100 initial diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..06112c2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +README.md merge=ours +.gitlab-ci.yml merge=ours +requirements.txt merge=ours \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..818770f --- /dev/null +++ b/.gitignore @@ -0,0 +1,75 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +/.venv +/.pytest_cache + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +bin/ +build/ +develop-eggs/ +dist/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg +*.eggs + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo + +# Pycharm +.idea + +# Eclipse +.settings + +# Visual Studio cache/options directory +.vs/ +.vscode + +# OSX Files +.DS_Store + +# Django stuff: +*.log + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Rope +.ropeproject + +# Sphinx documentation +docs/_build/ + +# Backup files +*~ +*.swp + +# OCA rules +!static/lib/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d65cbf1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,315 @@ +image: ubuntu:focal + +stages: + - testall + - testsingle + +variables: + POSTGRES_DB: postgres + POSTGRES_USER: flectra + POSTGRES_PASSWORD: flectra + POSTGRES_HOST: postgres + POSTGRES_PORT: "5432" + +services: + - name: postgres:12-alpine + alias: psql + + +test_all_modules: + stage: testall + image: + name: registry.gitlab.com/jamotion/flectra/ubuntudev:2-latest + entrypoint: ["/bin/sh", "-c"] + script: + - apt-get install -y p7zip-full + - apt-get install -y expect-dev + - su - flectra -c "mkdir ~/others" + - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 + - mkdir ${CI_PROJECT_DIR}/ci_data + - wget -O ${CI_PROJECT_DIR}/ci_data/test_base.zip https://gitlab.com/flectra-community/devops/oca2fc/raw/master/ci_data/test_base.zip + - 7z x -o ${CI_PROJECT_DIR}/ci_data/ ${CI_PROJECT_DIR}/ci_data/test_base.zip + - export PGPASSWORD="flectra" + - createdb -h psql -U flectra -O flectra -T template1 test_all + - psql -h psql -U flectra -d test_all -f ${CI_PROJECT_DIR}/ci_data/dump.sql + - su - flectra -c "mkdir -p ~/.local/share/filestore" + - mv ${CI_PROJECT_DIR}/ci_data/filestore /opt/flectra/.local/share/filestore/test_all + - chown -R flectra.flectra /opt/flectra/.local/share/filestore/test_all + - su - flectra -c "/opt/flectra/flectra-bin + --addons-path ${CI_PROJECT_DIR} + --db_host psql + --db_port 5432 + --db_user flectra + --db_password flectra + --database test_all + --test-enable + --init website_product_configurator_mrp,product_configurator_sale,product_configurator,product_configurator_purchase,website_product_configurator,product_configurator_mrp,product_configurator_stock,product_configurator_sale_mrp + --stop-after-init + --log-level error + --log-handler flectra.addons.website_product_configurator_mrp:TEST + --log-handler flectra.addons.product_configurator_sale:TEST + --log-handler flectra.addons.product_configurator:TEST + --log-handler flectra.addons.product_configurator_purchase:TEST + --log-handler flectra.addons.website_product_configurator:TEST + --log-handler flectra.addons.product_configurator_mrp:TEST + --log-handler flectra.addons.product_configurator_stock:TEST + --log-handler flectra.addons.product_configurator_sale_mrp:TEST + " + + +test_module_website_product_configurator_mrp: + stage: testsingle + when: on_failure + image: + name: registry.gitlab.com/jamotion/flectra/ubuntudev:2-latest + entrypoint: ["/bin/sh", "-c"] + script: + - apt-get install -y p7zip-full + - apt install -y expect-dev + - su - flectra -c "mkdir ~/others" + - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 + - mkdir ${CI_PROJECT_DIR}/ci_data + - wget -O ${CI_PROJECT_DIR}/ci_data/test_base.zip https://gitlab.com/flectra-community/devops/oca2fc/raw/master/ci_data/test_base.zip + - 7z x -o ${CI_PROJECT_DIR}/ci_data/ ${CI_PROJECT_DIR}/ci_data/test_base.zip + - export PGPASSWORD="flectra" + - createdb -h psql -U flectra -O flectra -T template1 test_website_product_configurator_mrp + - psql -h psql -U flectra -d test_website_product_configurator_mrp -f ${CI_PROJECT_DIR}/ci_data/dump.sql + - su - flectra -c "mkdir -p ~/.local/share/filestore" + - mv ${CI_PROJECT_DIR}/ci_data/filestore /opt/flectra/.local/share/filestore/test_website_product_configurator_mrp + - chown -R flectra.flectra /opt/flectra/.local/share/filestore/test_website_product_configurator_mrp + - su - flectra -c "/opt/flectra/flectra-bin + --addons-path ${CI_PROJECT_DIR} + --db_host psql + --db_port 5432 + --db_user flectra + --db_password flectra + --database test_website_product_configurator_mrp + --test-enable -i website_product_configurator_mrp + --stop-after-init + --log-level error + --log-handler flectra.addons.website_product_configurator_mrp:TEST" + +test_module_product_configurator_sale: + stage: testsingle + when: on_failure + image: + name: registry.gitlab.com/jamotion/flectra/ubuntudev:2-latest + entrypoint: ["/bin/sh", "-c"] + script: + - apt-get install -y p7zip-full + - apt install -y expect-dev + - su - flectra -c "mkdir ~/others" + - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 + - mkdir ${CI_PROJECT_DIR}/ci_data + - wget -O ${CI_PROJECT_DIR}/ci_data/test_base.zip https://gitlab.com/flectra-community/devops/oca2fc/raw/master/ci_data/test_base.zip + - 7z x -o ${CI_PROJECT_DIR}/ci_data/ ${CI_PROJECT_DIR}/ci_data/test_base.zip + - export PGPASSWORD="flectra" + - createdb -h psql -U flectra -O flectra -T template1 test_product_configurator_sale + - psql -h psql -U flectra -d test_product_configurator_sale -f ${CI_PROJECT_DIR}/ci_data/dump.sql + - su - flectra -c "mkdir -p ~/.local/share/filestore" + - mv ${CI_PROJECT_DIR}/ci_data/filestore /opt/flectra/.local/share/filestore/test_product_configurator_sale + - chown -R flectra.flectra /opt/flectra/.local/share/filestore/test_product_configurator_sale + - su - flectra -c "/opt/flectra/flectra-bin + --addons-path ${CI_PROJECT_DIR} + --db_host psql + --db_port 5432 + --db_user flectra + --db_password flectra + --database test_product_configurator_sale + --test-enable -i product_configurator_sale + --stop-after-init + --log-level error + --log-handler flectra.addons.product_configurator_sale:TEST" + +test_module_product_configurator: + stage: testsingle + when: on_failure + image: + name: registry.gitlab.com/jamotion/flectra/ubuntudev:2-latest + entrypoint: ["/bin/sh", "-c"] + script: + - apt-get install -y p7zip-full + - apt install -y expect-dev + - su - flectra -c "mkdir ~/others" + - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 + - mkdir ${CI_PROJECT_DIR}/ci_data + - wget -O ${CI_PROJECT_DIR}/ci_data/test_base.zip https://gitlab.com/flectra-community/devops/oca2fc/raw/master/ci_data/test_base.zip + - 7z x -o ${CI_PROJECT_DIR}/ci_data/ ${CI_PROJECT_DIR}/ci_data/test_base.zip + - export PGPASSWORD="flectra" + - createdb -h psql -U flectra -O flectra -T template1 test_product_configurator + - psql -h psql -U flectra -d test_product_configurator -f ${CI_PROJECT_DIR}/ci_data/dump.sql + - su - flectra -c "mkdir -p ~/.local/share/filestore" + - mv ${CI_PROJECT_DIR}/ci_data/filestore /opt/flectra/.local/share/filestore/test_product_configurator + - chown -R flectra.flectra /opt/flectra/.local/share/filestore/test_product_configurator + - su - flectra -c "/opt/flectra/flectra-bin + --addons-path ${CI_PROJECT_DIR} + --db_host psql + --db_port 5432 + --db_user flectra + --db_password flectra + --database test_product_configurator + --test-enable -i product_configurator + --stop-after-init + --log-level error + --log-handler flectra.addons.product_configurator:TEST" + +test_module_product_configurator_purchase: + stage: testsingle + when: on_failure + image: + name: registry.gitlab.com/jamotion/flectra/ubuntudev:2-latest + entrypoint: ["/bin/sh", "-c"] + script: + - apt-get install -y p7zip-full + - apt install -y expect-dev + - su - flectra -c "mkdir ~/others" + - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 + - mkdir ${CI_PROJECT_DIR}/ci_data + - wget -O ${CI_PROJECT_DIR}/ci_data/test_base.zip https://gitlab.com/flectra-community/devops/oca2fc/raw/master/ci_data/test_base.zip + - 7z x -o ${CI_PROJECT_DIR}/ci_data/ ${CI_PROJECT_DIR}/ci_data/test_base.zip + - export PGPASSWORD="flectra" + - createdb -h psql -U flectra -O flectra -T template1 test_product_configurator_purchase + - psql -h psql -U flectra -d test_product_configurator_purchase -f ${CI_PROJECT_DIR}/ci_data/dump.sql + - su - flectra -c "mkdir -p ~/.local/share/filestore" + - mv ${CI_PROJECT_DIR}/ci_data/filestore /opt/flectra/.local/share/filestore/test_product_configurator_purchase + - chown -R flectra.flectra /opt/flectra/.local/share/filestore/test_product_configurator_purchase + - su - flectra -c "/opt/flectra/flectra-bin + --addons-path ${CI_PROJECT_DIR} + --db_host psql + --db_port 5432 + --db_user flectra + --db_password flectra + --database test_product_configurator_purchase + --test-enable -i product_configurator_purchase + --stop-after-init + --log-level error + --log-handler flectra.addons.product_configurator_purchase:TEST" + +test_module_website_product_configurator: + stage: testsingle + when: on_failure + image: + name: registry.gitlab.com/jamotion/flectra/ubuntudev:2-latest + entrypoint: ["/bin/sh", "-c"] + script: + - apt-get install -y p7zip-full + - apt install -y expect-dev + - su - flectra -c "mkdir ~/others" + - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 + - mkdir ${CI_PROJECT_DIR}/ci_data + - wget -O ${CI_PROJECT_DIR}/ci_data/test_base.zip https://gitlab.com/flectra-community/devops/oca2fc/raw/master/ci_data/test_base.zip + - 7z x -o ${CI_PROJECT_DIR}/ci_data/ ${CI_PROJECT_DIR}/ci_data/test_base.zip + - export PGPASSWORD="flectra" + - createdb -h psql -U flectra -O flectra -T template1 test_website_product_configurator + - psql -h psql -U flectra -d test_website_product_configurator -f ${CI_PROJECT_DIR}/ci_data/dump.sql + - su - flectra -c "mkdir -p ~/.local/share/filestore" + - mv ${CI_PROJECT_DIR}/ci_data/filestore /opt/flectra/.local/share/filestore/test_website_product_configurator + - chown -R flectra.flectra /opt/flectra/.local/share/filestore/test_website_product_configurator + - su - flectra -c "/opt/flectra/flectra-bin + --addons-path ${CI_PROJECT_DIR} + --db_host psql + --db_port 5432 + --db_user flectra + --db_password flectra + --database test_website_product_configurator + --test-enable -i website_product_configurator + --stop-after-init + --log-level error + --log-handler flectra.addons.website_product_configurator:TEST" + +test_module_product_configurator_mrp: + stage: testsingle + when: on_failure + image: + name: registry.gitlab.com/jamotion/flectra/ubuntudev:2-latest + entrypoint: ["/bin/sh", "-c"] + script: + - apt-get install -y p7zip-full + - apt install -y expect-dev + - su - flectra -c "mkdir ~/others" + - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 + - mkdir ${CI_PROJECT_DIR}/ci_data + - wget -O ${CI_PROJECT_DIR}/ci_data/test_base.zip https://gitlab.com/flectra-community/devops/oca2fc/raw/master/ci_data/test_base.zip + - 7z x -o ${CI_PROJECT_DIR}/ci_data/ ${CI_PROJECT_DIR}/ci_data/test_base.zip + - export PGPASSWORD="flectra" + - createdb -h psql -U flectra -O flectra -T template1 test_product_configurator_mrp + - psql -h psql -U flectra -d test_product_configurator_mrp -f ${CI_PROJECT_DIR}/ci_data/dump.sql + - su - flectra -c "mkdir -p ~/.local/share/filestore" + - mv ${CI_PROJECT_DIR}/ci_data/filestore /opt/flectra/.local/share/filestore/test_product_configurator_mrp + - chown -R flectra.flectra /opt/flectra/.local/share/filestore/test_product_configurator_mrp + - su - flectra -c "/opt/flectra/flectra-bin + --addons-path ${CI_PROJECT_DIR} + --db_host psql + --db_port 5432 + --db_user flectra + --db_password flectra + --database test_product_configurator_mrp + --test-enable -i product_configurator_mrp + --stop-after-init + --log-level error + --log-handler flectra.addons.product_configurator_mrp:TEST" + +test_module_product_configurator_stock: + stage: testsingle + when: on_failure + image: + name: registry.gitlab.com/jamotion/flectra/ubuntudev:2-latest + entrypoint: ["/bin/sh", "-c"] + script: + - apt-get install -y p7zip-full + - apt install -y expect-dev + - su - flectra -c "mkdir ~/others" + - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 + - mkdir ${CI_PROJECT_DIR}/ci_data + - wget -O ${CI_PROJECT_DIR}/ci_data/test_base.zip https://gitlab.com/flectra-community/devops/oca2fc/raw/master/ci_data/test_base.zip + - 7z x -o ${CI_PROJECT_DIR}/ci_data/ ${CI_PROJECT_DIR}/ci_data/test_base.zip + - export PGPASSWORD="flectra" + - createdb -h psql -U flectra -O flectra -T template1 test_product_configurator_stock + - psql -h psql -U flectra -d test_product_configurator_stock -f ${CI_PROJECT_DIR}/ci_data/dump.sql + - su - flectra -c "mkdir -p ~/.local/share/filestore" + - mv ${CI_PROJECT_DIR}/ci_data/filestore /opt/flectra/.local/share/filestore/test_product_configurator_stock + - chown -R flectra.flectra /opt/flectra/.local/share/filestore/test_product_configurator_stock + - su - flectra -c "/opt/flectra/flectra-bin + --addons-path ${CI_PROJECT_DIR} + --db_host psql + --db_port 5432 + --db_user flectra + --db_password flectra + --database test_product_configurator_stock + --test-enable -i product_configurator_stock + --stop-after-init + --log-level error + --log-handler flectra.addons.product_configurator_stock:TEST" + +test_module_product_configurator_sale_mrp: + stage: testsingle + when: on_failure + image: + name: registry.gitlab.com/jamotion/flectra/ubuntudev:2-latest + entrypoint: ["/bin/sh", "-c"] + script: + - apt-get install -y p7zip-full + - apt install -y expect-dev + - su - flectra -c "mkdir ~/others" + - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 + - mkdir ${CI_PROJECT_DIR}/ci_data + - wget -O ${CI_PROJECT_DIR}/ci_data/test_base.zip https://gitlab.com/flectra-community/devops/oca2fc/raw/master/ci_data/test_base.zip + - 7z x -o ${CI_PROJECT_DIR}/ci_data/ ${CI_PROJECT_DIR}/ci_data/test_base.zip + - export PGPASSWORD="flectra" + - createdb -h psql -U flectra -O flectra -T template1 test_product_configurator_sale_mrp + - psql -h psql -U flectra -d test_product_configurator_sale_mrp -f ${CI_PROJECT_DIR}/ci_data/dump.sql + - su - flectra -c "mkdir -p ~/.local/share/filestore" + - mv ${CI_PROJECT_DIR}/ci_data/filestore /opt/flectra/.local/share/filestore/test_product_configurator_sale_mrp + - chown -R flectra.flectra /opt/flectra/.local/share/filestore/test_product_configurator_sale_mrp + - su - flectra -c "/opt/flectra/flectra-bin + --addons-path ${CI_PROJECT_DIR} + --db_host psql + --db_port 5432 + --db_user flectra + --db_password flectra + --database test_product_configurator_sale_mrp + --test-enable -i product_configurator_sale_mrp + --stop-after-init + --log-level error + --log-handler flectra.addons.product_configurator_sale_mrp:TEST" + diff --git a/gather_readme.md b/gather_readme.md new file mode 100644 index 0000000..03a93cc --- /dev/null +++ b/gather_readme.md @@ -0,0 +1,32 @@ +# Flectra Community Module Gather + +for i in {1..3}; do + repos=$(curl -s "https://gitlab.com/api/v4/groups/flectra-community/projects?per_page=100&page=${i}") + git config --global merge.ours.driver true + for row in $(echo "${repos}" | jq -r '.[] | @base64'); do + _jq() { + echo ${row} | base64 --decode | jq -r ${1} + } + url=$(_jq '.http_url_to_repo') + name=$(_jq '.name') + + echo ${name} + echo ${url} + + git remote add $name $url + git fetch $name + git checkout 2.0 + git merge --no-edit --allow-unrelated-histories $name/2.0 + git merge --no-edit --allow-unrelated-histories $name/2.0-fixed + git checkout 2.0-upstream + git merge --no-edit --allow-unrelated-histories $name/2.0-upstream + git checkout 1.0 + git merge --no-edit --allow-unrelated-histories $name/1.0 + git checkout 1.0-fixed + git merge --no-edit --allow-unrelated-histories $name/1.0-fixed + git checkout 1.0-upstream + git merge --no-edit --allow-unrelated-histories $name/1.0-upstream + git remote remove $name + git gc --prune=now + done +done \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29