update
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped

This commit is contained in:
hoangvv 2025-02-13 11:11:14 +07:00
parent 5024679f14
commit d4f55b586d

View File

@ -7,6 +7,7 @@ UID = $(shell id -u)
GID = $(shell id -g)
PIP=${PWD}/venv/bin/pip
PYTHON=${PWD}/venv/bin/python
VENV := $(shell [ -d "${PWD}/venv" ] && echo "exists" || echo "missing")
DOCKERCMD=docker
DOCKER_COMPOSE_CMD=docker-compose
DOCKER_BUILD=$(DOCKERCMD) build
@ -27,9 +28,24 @@ VERSION := community
ADDONS=${PWD}/addons,${PWD}/odoo/addons,${PWD}/extra-addons
BACKUP=${CDN}/raw/branch/main/backup/${VERSION}/odoo18-main_2025-01-15_08-05-47.zip
##### Native Deployment#########
AUTOMATION_PATH=${PWD}/automation
install:
########### Automation #########
deploy-native:
@echo "Not implemented"
##### Virtual Environment #####
check-virtualenv:
@if [ "$(VENV)" = "missing" ]; then \
echo "Creating virtual environment..."; \
python3 -m venv venv; \
echo "Installing pip dependencies..."; \
$(PIP) install --upgrade pip; \
else \
echo "Skipping Creating virtual environment..."; \
fi;
##### Native Deployment#########
install: check-virtualenv
sudo apt update -y && \
sudo apt install -y python3-pip libldap2-dev libpq-dev libsasl2-dev postgresql-client libreoffice && \
${PIP} install --no-input -r requirements.txt --break-system-packages
@ -53,9 +69,12 @@ run_test:
${PYTHON} odoo-bin --test-tags :TestAccountMove.test_out_invoice_auto_post_monthly,TestAccountMove.test_included_tax --log-level=test --test-enable -d testdb-${TAG} --stop-after-init --config=${CONFIG}
${PYTHON} odoo-bin db --config=${CONFIG} drop testdb-${TAG}
restore_database:
@read -p "Enter the database name: " DBNAME; \
@read -p "Backup Path [default: ${PWD}/deployment/backup/backup.zip]: " InputbackupDB; \
BackupDB=$${InputbackupDB:-${PWD}/deployment/backup/backup.zip}; \
read -p "Enter the database name: " DBNAME; \
echo "Restoring database: $$DBNAME"; \
${PYTHON} odoo-bin db --config=${CONFIG} load $$DBNAME ${PWD}/deployment/backup/backup.zip
${PYTHON} odoo-bin db --config=${CONFIG} load "$$DBNAME" "$$BackupDB"
##### Docker Deployment #########
run_test_docker:
@ -105,4 +124,3 @@ clean_up:
-print0 | sudo xargs -0 rm -rf {} && \
sudo rm -rf ${DEPLOY_PATH}/etc/*