Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D Dev Documentation
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • crnd-public
  • Dev Documentation
  • Wiki
  • File templates
  • gitlab ci.yml

gitlab ci.yml · Changes

Page history
Update gitlab ci.yml authored Dec 15, 2021 by Dmytro Katyukha's avatar Dmytro Katyukha
Hide whitespace changes
Inline Side-by-side
File-Templates/gitlab-ci.yml.md
View page @ b8da7b72
### Standard `.gitlab-ci.yml` config for Odoo addons ### Standard `.gitlab-ci.yml` config for Odoo addons
```yml ```yml
image: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:13.0-simple image: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:14.0-simple
variables: variables:
SERIES_BRANCH: '13.0' SERIES_BRANCH: '14.0'
ODOO_ADMIN_PASS: admin ODOO_ADMIN_PASS: admin
CI_JOB_TOKEN_GIT_HOST: 'gitlab.crnd.pro'
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.hidden-pip-cache" PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.hidden-pip-cache"
.only-stable-branch: &only_stable_branch
only:
- "14.0"
.only-dev-branch: &only_dev_branch
only:
- /^14.0-.*$/
.except-auto-commits: &except_auto_commits
except:
variables:
- $CI_COMMIT_MESSAGE =~ /\[CI-AUTO-UPDATE\]/
- $CI_COMMIT_MESSAGE =~ /Translated using Weblate/
# Disable global cache # Disable global cache
cache: {} cache: {}
...@@ -31,21 +46,26 @@ build_env: ...@@ -31,21 +46,26 @@ build_env:
- python --version - python --version
- odoo-helper --version - odoo-helper --version
- odoo-helper status --tools-versions --ci-tools-versions - odoo-helper status --tools-versions --ci-tools-versions
- echo "Checking branch compatability $CI_COMMIT_BRANCH" && [[ "$CI_COMMIT_BRANCH" =~ ^14.0(-.*)?$ ]]
flake8: flake8:
stage: static-test stage: static-test
script: script:
- odoo-helper lint flake8 . - odoo-helper lint flake8 .
<<: *except_auto_commits
pylint: pylint:
stage: static-test stage: static-test
script: script:
- odoo-helper lint pylint "--license_allowed=OPL-1" . - odoo-helper lint pylint .
<<: *except_auto_commits
stylelint: stylelint:
stage: static-test stage: static-test
script: script:
- odoo-helper lint style . - odoo-helper lint style .
allow_failure: true
<<: *except_auto_commits
bandit: bandit:
stage: static-test stage: static-test
...@@ -54,54 +74,54 @@ bandit: ...@@ -54,54 +74,54 @@ bandit:
- odoo-helper pip install bandit - odoo-helper pip install bandit
script: script:
- odoo-helper exec bandit -r . - odoo-helper exec bandit -r .
<<: *except_auto_commits
check-versions: check-versions:
stage: static-test stage: static-test
script: script:
- odoo-helper ci check-versions-git . origin/$SERIES_BRANCH $CI_COMMIT_SHA - odoo-helper ci check-versions-git . origin/$SERIES_BRANCH $CI_COMMIT_SHA
only: <<: *only_dev_branch
- /^13.0-.*$/ # only branches that started with '13.0-' <<: *except_auto_commits
ensure-changelog: ensure-changelog:
stage: static-test stage: static-test
script: script:
- odoo-helper ci ensure-changelog --format md . origin/$SERIES_BRANCH $CI_COMMIT_SHA - odoo-helper ci ensure-changelog --format md . origin/$SERIES_BRANCH $CI_COMMIT_SHA
only:
- /^13.0-.*$/ # only branches that started with '13.0-'
allow_failure: true allow_failure: true
<<: *only_dev_branch
<<: *except_auto_commits
ensure-icons: ensure-icons:
stage: static-test stage: static-test
script: script:
- odoo-helper ci ensure-icons . - odoo-helper ci ensure-icons .
only:
- /^13.0-.*$/ # only branches that started with '13.0-'
allow_failure: true allow_failure: true
<<: *only_dev_branch
<<: *except_auto_commits
tests: tests:
image: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:13.0-ci image: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:14.0-ci
stage: test stage: test
<<: *pip_cache_definition <<: *pip_cache_definition
before_script: before_script:
- odoo-helper link . - odoo-helper link .
- apt update -q
- apt install -qy poppler-utils
script: script:
- odoo-helper --use-unbuffer test --coverage --coverage-report --coverage-skip-covered --create-test-db --dir . - odoo-helper --use-unbuffer test --coverage --coverage-report --coverage-skip-covered --coverage-fail-under 90 --create-test-db --dir .
<<: *except_auto_commits
coverage: '/^TOTAL\s+\d+\s+\d+\s+(\d+\%)/' coverage: '/^TOTAL\s+\d+\s+\d+\s+(\d+\%)/'
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
when: on_failure
expire_in: 1 day
paths:
- /tmp/odoo_tests/
migration_tests: migration_tests:
image: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:13.0-ci image: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:14.0-ci
stage: test stage: test
variables: variables:
ODOO_DB_NAME: test-db ODOO_DB_NAME: test-db
<<: *pip_cache_definition <<: *pip_cache_definition
before_script: before_script:
- apt update -q
- apt install -qy poppler-utils
- git checkout $SERIES_BRANCH - git checkout $SERIES_BRANCH
- git pull - git pull
- odoo-helper link . - odoo-helper link .
...@@ -113,17 +133,11 @@ migration_tests: ...@@ -113,17 +133,11 @@ migration_tests:
- odoo-helper --use-unbuffer addons update-list - odoo-helper --use-unbuffer addons update-list
- odoo-helper --use-unbuffer addons update --db $ODOO_DB_NAME --dir . - odoo-helper --use-unbuffer addons update --db $ODOO_DB_NAME --dir .
script: script:
- odoo-helper --use-unbuffer test --coverage --coverage-report --coverage-skip-covered --dir . - odoo-helper --use-unbuffer test --coverage --coverage-report --coverage-skip-covered --coverage-fail-under 90 --dir .
coverage: '/^TOTAL\s+\d+\s+\d+\s+(\d+\%)/' coverage: '/^TOTAL\s+\d+\s+\d+\s+(\d+\%)/'
only: <<: *only_dev_branch
- /^13.0-.*$/ # only branches that started with '13.0-' <<: *except_auto_commits
allow_failure: true allow_failure: true
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
when: on_failure
expire_in: 1 day
paths:
- /tmp/odoo_tests/
.deploy_review_definition: &deploy_review_definition .deploy_review_definition: &deploy_review_definition
stage: deploy stage: deploy
...@@ -132,27 +146,26 @@ migration_tests: ...@@ -132,27 +146,26 @@ migration_tests:
script: script:
- ci-review-app start - ci-review-app start
tags: tags:
- traefic
- review-apps
- deploy - deploy
- odoo-review-ci4-shared
- review-apps
deploy_review_dev: deploy_review_dev:
<<: *deploy_review_definition <<: *deploy_review_definition
environment: environment:
name: review/$CI_COMMIT_REF_NAME name: review/$CI_COMMIT_REF_NAME
url: http://$CI_ENVIRONMENT_SLUG-$CI_PROJECT_ID.ci3.crnd.pro url: http://$CI_ENVIRONMENT_SLUG-$CI_PROJECT_ID.ci4.crnd.pro
on_stop: stop_review_dev on_stop: stop_review_dev
only: <<: *only_dev_branch
- /^13.0-.*$/ # only branches that started with '13.0-'
when: manual when: manual
deploy_review_stable: deploy_review_stable:
<<: *deploy_review_definition <<: *deploy_review_definition
environment: environment:
name: stable/$CI_COMMIT_REF_NAME name: stable/$CI_COMMIT_REF_NAME
url: http://$CI_ENVIRONMENT_SLUG-$CI_PROJECT_ID.ci3.crnd.pro url: http://$CI_ENVIRONMENT_SLUG-$CI_PROJECT_ID.ci4.crnd.pro
only: <<: *only_stable_branch
- "13.0"
stop_review_dev: stop_review_dev:
stage: deploy stage: deploy
...@@ -165,9 +178,9 @@ stop_review_dev: ...@@ -165,9 +178,9 @@ stop_review_dev:
- ci-review-app stop - ci-review-app stop
when: manual when: manual
tags: tags:
- traefic
- review-apps
- deploy - deploy
only: - odoo-review-ci4-shared
- /^13.0-.*$/ # only branches that started with '13.0-' - review-apps
<<: *only_dev_branch
``` ```
\ No newline at end of file
Clone repository
  • CI Review App
  • Development Process
  • File Templates
    • .gitignore
    • gitlab ci.yml
    • odoo packager.yml
  • Odoo Packager
  • Set up develpment environment
  • Useful Links
  • Home
  • Процеси
    • Процес створення нового модуля в новому репозитарії
  • Тестові задачі
    • KPI
    • OKR
    • Weather Measurement
    • Робоче місце охорони