Skip to content
Snippets Groups Projects
Commit 0d7bd28e authored by Luca Cristaldi's avatar Luca Cristaldi
Browse files

Merge branch 'development' into 'master'

Development

See merge request !5
parents a560528d 3294479e
Branches master
No related tags found
1 merge request!5Development
Pipeline #531 passed
variables:
TRYTON_PATH: /home/tryton/tryton-4.8
TRYTON_CONF: /home/tryton/tryton-4.8/trytond-4.8.conf
TRYTON_PATH: /home/tryton/tryton-5.0
TRYTON_CONF: /home/tryton/tryton-5.0/trytond-5.0.conf
DATABASE_NAME: trytontest
DATABASE_URI: postgresql://tryton:@tryton-testing.hq.mittelab.org:5432
DATABASE_URI: postgresql://tryton:@tryton-testing.hq.mittelab.org:5432/
MODULE_NAME: party_italy
DEPLOY_URL: tryton-testing.hq.mittelab.org
DEPLOY_USER: tryton
DEPLOY_PATH: /home/tryton/tryton-4.8
DEPLOY_SAO_PATH: /home/tryton/sao
PACKAGE_NAME: party_italy
stages:
......@@ -15,12 +22,12 @@ before_script:
- export PATH=$PATH:$HOME/.local/bin
pep8:
image: wifasoi/python-pep8:latest
image: git-registry.mittelab.org/infra/tryton/commodity-docker/python-pep8:latest
stage: check
script:
- pycodestyle
unit-test:
.unit-test:
stage: check
image: wifasoi/python-trytond-unitest:latest
script:
......@@ -34,12 +41,71 @@ test_install:
variables:
POSTGRES_DB: $DATABASE_NAME
POSTGRES_USER: tryton
image: python:3.7.0-slim-stretch
image: git-registry.mittelab.org/infra/tryton/commodity-docker/trytond-base:latest
script:
- python3 -m pip install lxml psycopg2
- python3 setup.py install
- echo -e "[database]\nuri = postgresql://$POSTGRES_USER:@postgres:5432\n[web]\nlisten=[::]:8000" > trytond.conf
- export TRYTONPASSFILE=phonypass.notpassword
- echo "TheContainerWillBeDelatedAnyway" > $TRYTONPASSFILE
- trytond-admin -c trytond.conf -d $DATABASE_NAME -v --all --email r@ndom.peni --update-modules-list
- trytond-admin -c trytond.conf -d $DATABASE_NAME -v -u $MODULE_NAME --install-dependencies
- trytond-admin -c trytond.conf -d $DATABASE_NAME -v -u $MODULE_NAME --activate-dependencies
.review_module:
stage: deploy
environment:
name: review/$CI_COMMIT_REF_NAME
url: http://tryton-testing.hq.mittelab.org:8000
on_stop: stop_module
image: alpine:latest
only:
- branches
except:
- master
script:
- apk add openssh-client
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" > ssh.key
- chmod 600 ssh.key
- ssh-add ssh.key
- ssh -o StrictHostKeyChecking=no -t $DEPLOY_USER@$DEPLOY_URL "
sudo systemctl stop trytond;
if [ ! -d ${DEPLOY_PATH} ]; then
mkdir -p ${DEPLOY_PATH} &&
cd ${DEPLOY_PATH} &&
echo -e \"[database]\\nuri = ${DATABASE_URI}\\n[web]\\nlisten=[::]:8000\\nroot=${DEPLOY_SAO_PATH}\" > trytond.conf;
else
pipenv uninstall ${CI_PROJECT_NAME} &&
rm -rf ${DEPLOY_PATH}/${CI_PROJECT_NAME};
fi;"
- scp -r ${CI_PROJECT_DIR} $DEPLOY_USER@$DEPLOY_URL:$DEPLOY_PATH
- ssh -o StrictHostKeyChecking=no -t $DEPLOY_USER@$DEPLOY_URL "
cd ${DEPLOY_PATH} &&
pipenv install psycopg2-binary &&
pipenv install ${DEPLOY_PATH}/${CI_PROJECT_NAME} &&
pipenv update &&
pipenv run trytond-admin -c trytond.conf -d ${DATABASE_NAME} -v --all &&
pipenv run trytond-admin -c trytond.conf -d ${DATABASE_NAME} -v -u ${PACKAGE_NAME} --install-dependencies &&
sudo systemctl start trytond"
.stop_module:
stage: deploy
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
image: alpine:latest
when: manual
only:
- branches
except:
- master
script:
- apk add openssh-client
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" > ssh.key
- chmod 600 ssh.key
- ssh-add ssh.key
- ssh -o StrictHostKeyChecking=no -t $DEPLOY_USER@$DEPLOY_URL "
sudo systemctl stop trytond &&
cd ${DEPLOY_PATH} &&
pipenv uninstall ${CI_PROJECT_NAME} &&
pipenv update"
\ No newline at end of file
Pipfile 0 → 100644
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
[dev-packages]
[requires]
python_version = "3.7"
from trytond.pool import Pool
from .party import *
from .party import PartyIdentifier
__all__ = ['register']
......
[tryton]
version=4.8.0
version=5.0.0
depends:
ir
party
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment