Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mittelab_party_italy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Infrastruttura
Tryton
mittelab_party_italy
Commits
0d7bd28e
Commit
0d7bd28e
authored
6 years ago
by
Luca Cristaldi
Browse files
Options
Downloads
Plain Diff
Merge branch 'development' into 'master'
Development See merge request
!5
parents
a560528d
3294479e
Branches
master
Branches containing commit
No related tags found
1 merge request
!5
Development
Pipeline
#531
passed
6 years ago
Stage: check
Stage: install
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+74
-8
74 additions, 8 deletions
.gitlab-ci.yml
Pipfile
+11
-0
11 additions, 0 deletions
Pipfile
__init__.py
+1
-1
1 addition, 1 deletion
__init__.py
tryton.cfg
+1
-1
1 addition, 1 deletion
tryton.cfg
with
87 additions
and
10 deletions
.gitlab-ci.yml
+
74
−
8
View file @
0d7bd28e
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
This diff is collapsed.
Click to expand it.
Pipfile
0 → 100644
+
11
−
0
View file @
0d7bd28e
[[source]]
url
=
"https://pypi.org/simple"
verify_ssl
=
true
name
=
"pypi"
[packages]
[dev-packages]
[requires]
python_version
=
"3.7"
This diff is collapsed.
Click to expand it.
__init__.py
+
1
−
1
View file @
0d7bd28e
from
trytond.pool
import
Pool
from
.party
import
*
from
.party
import
PartyIdentifier
__all__
=
[
'
register
'
]
...
...
This diff is collapsed.
Click to expand it.
tryton.cfg
+
1
−
1
View file @
0d7bd28e
[tryton]
version
=
4.8
.0
version
=
5.0
.0
depends:
ir
party
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment