include: - file: python3-lint-needs.gitlab-ci.yaml project: xcg/ci-templates - file: docker-build.gitlab-ci.yaml project: xcg/ci-templates - file: deploy-doc.gitlab-ci.yaml project: xcg/ci-templates variables: HTML_DOC_SOURCES: doc/_build/html TEMP_IMAGE_BASENAME: registry.xcg.io/ci/$CI_PROJECT_PATH_SLUG # do not use $TEMP_IMAGE_BASENAME, it will not be correctly replaced by GitLab TEMP_IMAGE: registry.xcg.io/ci/$CI_PROJECT_PATH_SLUG:hg-$CI_COMMIT_HG_SHA build-docker-image: needs: [] stage: build script: - DOCKER_IMAGE=$TEMP_IMAGE_BASENAME docker-build import_jsonrpc_odoo11_test: stage: test needs: [] image: name: registry.xcg.io/odoo/odoo:11.0-bionic entrypoint: [""] services: - name: postgres:12-alpine command: ["-c", "fsync=off"] alias: db variables: POSTGRES_USER: odoo POSTGRES_HOST_AUTH_METHOD: trust ODOO_ADDONS_PATH: "" ODOO_TYPE: odoo11 before_script: # install modules - $CI_PROJECT_DIR/start --db_host=db -d test_setup --max-cron-threads=0 --without-demo=all --data-dir /var/lib/odoo --init base --stop-after-init script: # restart odoo with installed modules and use it in background - $CI_PROJECT_DIR/start --db_host=db -d test_setup --max-cron-threads=0 --data-dir /var/lib/odoo & - sleep 3 # then test the setup files - import_jsonrpc -v --host localhost --password admin -d test_setup --protocol jsonrpc -p 8069 --directory tests/import - import_jsonrpc -v --host localhost --password admin -d test_setup --protocol jsonrpc -p 8069 --file tests/context_import/res.company.csv --context test=value - import_jsonrpc -v --host localhost --password admin -d test_setup --protocol jsonrpc -p 8069 --directory tests/import_emptyyaml --delimiter ";" - import_sql -v --host postgres --user odoo --database test_setup --directory tests/import_sql # clean up background process - pkill --echo --full /usr/bin/python3 - pkill --echo --full zsh import_base_import_odoo11_test: extends: import_jsonrpc_odoo11_test script: # restart odoo with installed modules and use it in background - $CI_PROJECT_DIR/start --db_host=db -d test_setup --max-cron-threads=0 --data-dir /var/lib/odoo & - sleep 3 # then test the setup files - import_base_import -v --host localhost --password admin -d test_setup --protocol jsonrpc -p 8069 --directory tests/import - import_sql -vv --host postgres --user odoo --database test_setup --directory tests/import_sql # clean up background process - pkill --echo --full /usr/bin/python3 - pkill --echo --full zsh import_jsonrpc_odoo13_test: extends: import_jsonrpc_odoo11_test image: name: registry.xcg.io/odoo/odoo:13.0 entrypoint: [""] variables: ODOO_TYPE: odoo13 import_base_import_odoo13_test: extends: import_base_import_odoo11_test image: name: registry.xcg.io/odoo/odoo:13.0 entrypoint: [""] variables: ODOO_TYPE: odoo13 allow_failure: true docker_build_copy_test: needs: - job: build-docker-image stage: test image: $TEMP_IMAGE script: - docker_build_copy - docker_build_clean build-documentation: # done in test stage to be able to use the built image stage: test needs: - job: build-docker-image image: $TEMP_IMAGE artifacts: paths: - doc/_build expire_in: 10m script: - apk add make - cd doc - pip3 install -r requirements hg-evolve - for language in en fr ; do LANGUAGE=$language BUILDDIRSUFFIX=/$CI_COMMIT_HG_BRANCH make html ; done publish_documentation: needs: - job: build-documentation artifacts: true only: - /^branch\/.*/ publish: extends: build-docker-image stage: deploy needs: - job: docker_build_copy_test - job: import_jsonrpc_odoo11_test - job: import_jsonrpc_odoo13_test - job: import_base_import_odoo13_test - job: import_base_import_odoo11_test variables: TAG_LATEST: branch/default script: - DOCKER_BASE_IMAGE_NAME="$TEMP_IMAGE" DOCKER_IMAGE="registry.xcg.io/xcgd/odoo_scripts" tag-img - DOCKER_BASE_IMAGE_NAME="$TEMP_IMAGE" DOCKER_IMAGE="xcgd/odoo_scripts" tag-img