diff --git a/.gitmodules b/.gitmodules index d7622a88..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +0,0 @@ -[submodule "src/jenkins-job-builder"] - path = src/jenkins-job-builder - url = https://github.com/gforcada/jenkins-job-builder.git - pushurl = git@github.com:gforcada/jenkins-job-builder.git diff --git a/README.rst b/README.rst index ec0ef0ad..2a31447a 100644 --- a/README.rst +++ b/README.rst @@ -5,18 +5,22 @@ PLONE JENKINS/CI ================ This repository is used to configure http://jenkins.plone.org -See ``docs/source/team.rst`` for the members of the Plone testing and CI team, -as well as their responsibilities. - Servers configuration ===================== Our servers and nodes are configured with `ansible`_. Jobs ==== -A jenkins server without any job is quite useless. -All our jenkins jobs are configured through `jenkins-job-builder`_. +Get the repository and python: + +:: + git clone git@github.com:plone/jenkins.plone.org + cd jenkins.plone.org + python3.11 -m venv venv + . venv/bin/activate + pip install -r requirements.txt + +Test creating the jobs locally:: -See the `documentation`_ on how to set them, -the actual configuration files are located at the ``jobs`` folder. + jenkins-jobs --conf jobs/config.ini test jobs/jobs.yml -o output --config-xml diff --git a/jobs/jobs.yml b/jobs/jobs.yml index 51097828..f00e3b10 100644 --- a/jobs/jobs.yml +++ b/jobs/jobs.yml @@ -32,7 +32,7 @@ scm: - buildout-coredev: - branch: '5.2' + branch: '6.0' wrappers: - custom-workspace-cleanup @@ -62,46 +62,29 @@ - 'plone-5.2-python-2.7-robot-chrome' - project: - name: Plone 5.2 on python 3.x - plone-version: - - '5.2' - py: - - '3.8': - python-version: 'Python3.8' - browser: - - chrome - jobs: - - 'pull-request-{plone-version}-{py}' - - 'plone-{plone-version}-python-{py}' - - 'plone-{plone-version}-python-{py}-robot-{browser}' - -- project: - name: Plone 6.0 on python 3.x - plone-version: - - '6.0' - py: - - '3.11': - python-version: 'Python3.11' - - '3.8': - python-version: 'Python3.8' - browser: - - chrome - jobs: - - 'pull-request-{plone-version}-{py}' - - 'plone-{plone-version}-python-{py}' - - 'plone-{plone-version}-python-{py}-robot-{browser}' - -- project: - name: Plone 6.1 on python 3.x + name: Plone 5.2 and 6.x plone-version: - '6.1' + - '6.0' + - '5.2' py: - '3.12': python-version: 'Python3.12' + - '3.11': + python-version: 'Python3.11' - '3.8': python-version: 'Python3.8' browser: - chrome + exclude: + - plone-version: '6.1' + py: '3.11' + - plone-version: '6.0' + py: '3.12' + - plone-version: '5.2' + py: '3.12' + - plone-version: '5.2' + py: '3.11' jobs: - 'pull-request-{plone-version}-{py}' - 'plone-{plone-version}-python-{py}' @@ -124,31 +107,30 @@ - 'plone-{plone-version}-python-{py}-robot-{browser}-scheduled' - project: - name: Plone 6.0 jobs on python 3.x (scheduled) + name: Plone 6.x jobs on python 3.x (scheduled) plone-version: + - '6.1' - '6.0' py: - '3.12': python-version: 'Python3.12' + - '3.11': + python-version: 'Python3.11' - '3.10': python-version: 'Python3.10' - '3.9': python-version: 'Python3.9' browser: - chrome - jobs: - - 'plone-{plone-version}-python-{py}-scheduled' - - 'plone-{plone-version}-python-{py}-robot-{browser}-scheduled' - -- project: - name: Plone 6.1 jobs on python 3.x (scheduled) - plone-version: - - '6.1' - py: - - '3.11': - python-version: 'Python3.11' - browser: - - chrome + exclude: + - plone-version: '6.1' + py: '3.12' + - plone-version: '6.1' + py: '3.10' + - plone-version: '6.1' + py: '3.9' + - plone-version: '6.0' + py: '3.11' jobs: - 'plone-{plone-version}-python-{py}-scheduled' - 'plone-{plone-version}-python-{py}-robot-{browser}-scheduled' @@ -186,26 +168,20 @@ jobs: - 'volto-translations-{branch}' -- project: - name: PLIPs - plip: - - plip-image-scales-metadata: - buildout: plips/plip-image-scales-metadata.cfg - branch: '6.0' - py: - - '3.9': - python-version: 'Python3.9' - - '3.8': - python-version: 'Python3.8' - jobs: - - 'plip-{plip}-{py}' +#- project: +# name: PLIPs +# plip: +# - plip-image-scales-metadata: +# buildout: plips/plip-image-scales-metadata.cfg +# branch: '6.0' +# py: +# - '3.12': +# python-version: 'Python3.9' +# - '3.8': +# python-version: 'Python3.8' +# jobs: +# - 'plip-{plip}-{py}' -- project: - name: QA scripts - jobs: - - qa-undeclared-dependencies - - qa-code-analysis - - plone-package-dependencies-ztc ### # JOBS @@ -414,9 +390,6 @@ - custom-timeout - custom-github-api-key - - inject: - properties-content: ROBOTSUITE_PREFIX=ONLYROBOT - <<: *plone @@ -440,13 +413,8 @@ branch: '{branch}' builders: - - shining-panda: - build-environment: virtualenv - python-version: '{python-version}' - clear: true - nature: shell - command: - !include-raw: scripts/plips.sh + - shell: + !include-raw: scripts/plips.sh publishers: - custom-junit @@ -616,34 +584,6 @@ <<: *plone-basic -- job: - name: plone-package-dependencies-ztc - display-name: 'Plone ZopeTestCase dependencies' - - triggers: - - timed: "@weekly" - - builders: - - shining-panda: - build-environment: virtualenv - python-version: Python2.7 - clear: true - nature: shell - command: - !include-raw: scripts/dependencies-ztc.sh - - publishers: - - archive: - artifacts: 'deps.txt' - allow-empty: 'false' - - wrappers: - - custom-timeout - - custom-workspace-cleanup - - <<: *plone - - - job-template: name: plone-{plone-version}-python-{py}-i18n-find-missing display-name: 'Plone {plone-version} - Python {py} - Find strings' @@ -695,86 +635,6 @@ <<: *plone-basic -- job: - name: qa-undeclared-dependencies - display-name: 'Undeclared dependencies' - - triggers: - - timed: '@weekly' - - builders: - - shining-panda: - build-environment: virtualenv - python-version: Python2.7 - clear: true - nature: shell - command: - !include-raw: scripts/undeclared-dependencies.sh - - publishers: - - archive: - artifacts: 'deps.txt, lines.log, pkgs.log' - allow-empty: 'true' - - - plot: - - title: Undeclared dependencies - num-builds: '500' - yaxis: dependencies not declared - style: line - use-description: true - group: plot - series: - - file: lines.log - format: properties - - title: Compliant packages - num-builds: '500' - yaxis: compliant packages - style: line - use-description: true - group: plot - series: - - file: pkgs.log - format: properties - - wrappers: - - custom-timeout - - custom-workspace-cleanup - - <<: *plone - - -- job: - name: qa-code-analysis - display-name: 'Code analysis' - - triggers: - - timed: '@weekly' - - builders: - - shining-panda: - build-environment: virtualenv - python-version: Python2.7 - clear: true - nature: shell - command: - !include-raw: scripts/qa-global-code-analysis.sh - - publishers: - - violations: - pep8: - pattern: 'qa.txt' - - - archive: - artifacts: 'qa.txt' - allow-empty: 'true' - - wrappers: - - custom-timeout - - custom-workspace-cleanup - - <<: *plone - - ### # MACROS ### diff --git a/jobs/scripts/dependencies-ztc.sh b/jobs/scripts/dependencies-ztc.sh deleted file mode 100644 index 1f2db660..00000000 --- a/jobs/scripts/dependencies-ztc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -x - -pip install -r requirements.txt -buildout buildout:git-clone-depth=1 -c core.cfg -grep -RI ZopeTestCase parts/packages > deps.txt.tmp || echo 0 -sed -i 's|parts/packages||' deps.txt.tmp -grep -Ev '/(Testing|OFS|PloneTestCase|Zope2|ZPublisher)/' deps.txt.tmp > deps.txt diff --git a/jobs/scripts/plips.sh b/jobs/scripts/plips.sh index e5249091..f63bd83e 100644 --- a/jobs/scripts/plips.sh +++ b/jobs/scripts/plips.sh @@ -1,12 +1,22 @@ #!/bin/sh set -x +PYTHON_VERSION="{py}" +PLONE_VERSION="{plone-version}" + +/srv/python${{PYTHON_VERSION}}/bin/python3 -m venv venv +. venv/bin/activate + pip install -r requirements.txt buildout buildout:git-clone-depth=1 -c {buildout} export PATH="/usr/lib/chromium-browser:$PATH" -export ROBOT_BROWSER=headlesschrome +export ROBOT_BROWSER="headlesschrome" +export ROBOTSUITE_PREFIX=ONLYROBOT export PYTHONWARNINGS='ignore' +export PLAYWRIGHT_BROWSERS_PATH='/home/jenkins/robot-browsers/' +bin/rfbrowser init + bin/test --xml --all diff --git a/jobs/scripts/qa-global-code-analysis.sh b/jobs/scripts/qa-global-code-analysis.sh deleted file mode 100644 index 6d53b18b..00000000 --- a/jobs/scripts/qa-global-code-analysis.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -set -x - -# checkout all packages -pip install -r requirements.txt -buildout buildout:git-clone-depth=1 -c core.cfg - -wget https://raw.githubusercontent.com/plone/plone.recipe.codeanalysis/master/.isort.cfg -O .isort.cfg - -buildout \ - code-analysis:jenkins=False \ - buildout:bin-directory=../bin \ - buildout:parts-directory=../parts \ - -c experimental/qa.cfg - -ignorelist="Plone plone.themepreview diazo jquery.recurrenceinput.js mockup mockup-core" -for pkg in src/*; -do - if [ "$(echo $ignorelist | grep -c $pkg)" -eq 0 ]; then - echo "$pkg" - bin/code-analysis "$pkg" - fi -done | tee qa.txt diff --git a/jobs/scripts/undeclared-dependencies.sh b/jobs/scripts/undeclared-dependencies.sh deleted file mode 100644 index beabfa07..00000000 --- a/jobs/scripts/undeclared-dependencies.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -set -x - -# checkout all plone and collective org packages -cat > checkouts.cfg << EOF -[buildout] -git-clone-depth = 1 -always-checkout = force -auto-checkout = -EOF - -for pkg in `grep -E "remotes:(plone|collective)" sources.cfg | cut -d" " -f1 | sed 's/=//'`; -do - echo " ${pkg}" >> checkouts.cfg -done - -# bootstrap and install z3c.dependencychecker -pip install -r requirements.txt -buildout -c core.cfg install dependencies - -# get all dependencies -for pkg in src/*; -do - echo "$pkg" - ./bin/dependencychecker --exit-zero $pkg -done | tee deps.txt - -LINES=`wc -l deps.txt | cut -d" " -f1` -echo "YVALUE=${LINES}" > lines.log -PKGS=`ls src/*/pyproject.toml | wc -l` -echo "YVALUE=${PKGS}" > pkgs.log diff --git a/requirements.in b/requirements.in new file mode 100644 index 00000000..a180f4a5 --- /dev/null +++ b/requirements.in @@ -0,0 +1,3 @@ +ansible +jenkins-job-builder +pip-tools diff --git a/requirements.txt b/requirements.txt index fbc5807e..498e2f13 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,26 +1,75 @@ -ansible==2.7.16 -asn1crypto==0.24.0 -bcrypt==3.1.6 -certifi==2018.11.29 -cffi==1.15.1 -chardet==3.0.4 -cryptography==38.0.1 -fasteners==0.14.1 -idna==2.8 -Jinja2==2.11.3 -MarkupSafe==1.1.1 -monotonic==1.5 +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile requirements.in +# +ansible==9.2.0 + # via -r requirements.in +ansible-core==2.16.3 + # via ansible +build==1.0.3 + # via pip-tools +certifi==2024.2.2 + # via requests +cffi==1.16.0 + # via cryptography +charset-normalizer==3.3.2 + # via requests +click==8.1.7 + # via pip-tools +cryptography==42.0.2 + # via ansible-core +fasteners==0.19 + # via jenkins-job-builder +idna==3.6 + # via requests +jenkins-job-builder==6.0.0 + # via -r requirements.in +jinja2==3.1.3 + # via + # ansible-core + # jenkins-job-builder +markupsafe==2.1.5 + # via jinja2 multi-key-dict==2.0.3 -paramiko==2.4.2 -passlib==1.7.1 -pbr==4.3.0 -pyasn1==0.4.5 -pycparser==2.19 -PyNaCl==1.3.0 -pyparsing==2.4.0 -python-jenkins==1.4.0 -PyYAML==5.4 -requests==2.21.0 -six==1.12.0 -stevedore==1.30.1 -urllib3==1.24.2 + # via python-jenkins +packaging==23.2 + # via + # ansible-core + # build +pbr==6.0.0 + # via + # jenkins-job-builder + # python-jenkins + # stevedore +pip-tools==7.3.0 + # via -r requirements.in +pycparser==2.21 + # via cffi +pyproject-hooks==1.0.0 + # via build +python-jenkins==1.8.2 + # via jenkins-job-builder +pyyaml==6.0.1 + # via + # ansible-core + # jenkins-job-builder +requests==2.31.0 + # via python-jenkins +resolvelib==1.0.1 + # via ansible-core +six==1.16.0 + # via + # jenkins-job-builder + # python-jenkins +stevedore==5.1.0 + # via jenkins-job-builder +urllib3==2.2.0 + # via requests +wheel==0.42.0 + # via pip-tools + +# The following packages are considered to be unsafe in a requirements file: +# pip +# setuptools diff --git a/src/jenkins-job-builder b/src/jenkins-job-builder deleted file mode 160000 index 3b7e830d..00000000 --- a/src/jenkins-job-builder +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3b7e830de18ccfe62fa1ef406bdd8abaf2800f0a