update make file

This commit is contained in:
hoangvv 2025-01-06 11:42:15 +07:00
parent ab34f3792e
commit 08037d0a44
2 changed files with 12 additions and 2 deletions

View File

@ -3,7 +3,7 @@ include deployment/.env
PWD = $(shell pwd)
UID = $(shell id -u)
GID = $(shell id -g)
PYTHON=/root/.pyenv/shims/python
PYTHON=python
DOCKERCMD=docker
DOCKER_BUILD=$(DOCKERCMD) build
DOCKER_PUSH=$(DOCKERCMD) push
@ -11,6 +11,10 @@ DOCKER_IMAGE=$(DOCKERCMD) image
DEPLOY_PATH=${PWD}/deployment
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
HASH := $(shell git rev-parse HEAD)
CONFIG=odoo.conf
install:
sudo apt install python3-pip libldap2-dev libpq-dev libsasl2-dev && \
pip install -r requirements.txt
update_env:
@awk '/^ODOO_TAG=/ { $$0 = "ODOO_TAG=${BRANCH}" } 1' ${DEPLOY_PATH}/.env > ${DEPLOY_PATH}/.env.tmp && mv ${DEPLOY_PATH}/.env.tmp ${DEPLOY_PATH}/.env
build-image: update_tag
@ -18,4 +22,4 @@ build-image: update_tag
push-image:
$(DOCKERPUSH) ${ODOO_IMAGE}
run-server:
${PYTHON} odoo-bin
${PYTHON} odoo-bin --config=${CONFIG}

6
odoo.conf.sample Normal file
View File

@ -0,0 +1,6 @@
[options]
db_host = localhost
db_port = 5432
db_user = changeme
db_password = password