diff --git a/jobs/debian/update-scripts.yaml b/jobs/debian/update-scripts.yaml --- a/jobs/debian/update-scripts.yaml +++ b/jobs/debian/update-scripts.yaml @@ -1,13 +1,14 @@ -- job: - name: debian/maintenance/update-scripts - description: 'Update debian scripts from the jenkins-jobs repository' +- job-template: + name: "debian/{name}" + gitlab_project_name: swh/infra/ci-cd/swh-jenkins-jobs + description: "Update debian scripts from the jenkins-jobs repository" project-type: matrix child-workspace: . axes: - !include: axis-slave.yaml.inc scm: - git: - url: https://forge.softwareheritage.org/source/swh-jenkins-jobs/ + url: "{gitlab_url}/{gitlab_project_name}.git" branches: - master wipe-workspace: false @@ -20,3 +21,8 @@ - shell: chmod go+rX -R scripts/debian/ - shell: rsync -az --delete scripts/debian/ /usr/share/jenkins/debian-scripts/ - shell: rsync -az --delete keyrings/ /usr/share/keyrings/extra-repositories/ + +- project: + name: "maintenance/update-scripts" + jobs: + - "debian/{name}" diff --git a/jobs/defaults.yaml b/jobs/defaults.yaml --- a/jobs/defaults.yaml +++ b/jobs/defaults.yaml @@ -1,7 +1,7 @@ - defaults: name: global - gitlab_host: gitlab-staging.swh.network + gitlab_host: gitlab.softwareheritage.org gitlab_url: https://{gitlab_host} gitlab_ssh_url: git@{gitlab_host} - gitlab_connection_name: gitlab-staging + gitlab_connection_name: gitlab-swh gitlab_project: false diff --git a/jobs/swh-docs.yaml b/jobs/swh-docs.yaml --- a/jobs/swh-docs.yaml +++ b/jobs/swh-docs.yaml @@ -12,7 +12,7 @@ name: "{name}/publish" description: Build the documentation and publish it node: swh-sphinx - auth-token: ph4br1cat0r + gitlab_project_name: swh/devel/swh-environment properties: - build-discarder: days-to-keep: 90 @@ -22,7 +22,7 @@ scm: - git: - url: https://forge.softwareheritage.org/source/swh-environment.git + url: "{gitlab_url}/{gitlab_project_name}.git" builders: - shell: | @@ -72,7 +72,7 @@ name: "{name}/dev" description: Build the documentation from git repos node: swh-sphinx - auth-token: ph4br1cat0r + gitlab_project_name: swh/devel/swh-environment properties: - build-discarder: days-to-keep: 90 @@ -82,7 +82,7 @@ scm: - git: - url: https://forge.softwareheritage.org/source/swh-environment.git + url: "{gitlab_url}/{gitlab_project_name}.git" builders: - shell: | diff --git a/jobs/swh-environment.yaml b/jobs/swh-environment.yaml --- a/jobs/swh-environment.yaml +++ b/jobs/swh-environment.yaml @@ -1,11 +1,13 @@ -- project: - name: DENV - display-name: swh-environment +- job-group: + name: swh-environment-jobs-{name} + gitlab_project_name: swh/devel/swh-environment jobs: - "{name}" + - "{name}/run-all-tests" -- job: - name: DENV/tests +- job-template: + name: "{name}/run-all-tests" + display-name: tests description: Run tests for each swh module in development version node: swh-sphinx @@ -14,7 +16,7 @@ scm: - git: - url: https://forge.softwareheritage.org/source/swh-environment.git + url: "{gitlab_url}/{gitlab_project_name}.git" branches: - "*/master" wrappers: @@ -53,9 +55,9 @@ then # pipe checks and tests output to stdout and log file make check 2>&1 | tee ../$module.log - tests_status=${PIPESTATUS[0]} + tests_status=${{PIPESTATUS[0]}} make test 2>&1 | tee -a ../$module.log - tests_status=$(($tests_status + ${PIPESTATUS[0]})) + tests_status=$(($tests_status + ${{PIPESTATUS[0]}})) # remove log file if tests succeeded if [[ "$tests_status" == "0" ]] then @@ -73,3 +75,9 @@ - archive: artifacts: "*.log" allow-empty: true + +- project: + name: DENV + display-name: swh-environment + jobs: + - "swh-environment-jobs-{name}" diff --git a/jobs/tools/setup-gitlab-webhooks.groovy.j2 b/jobs/tools/setup-gitlab-webhooks.groovy.j2 --- a/jobs/tools/setup-gitlab-webhooks.groovy.j2 +++ b/jobs/tools/setup-gitlab-webhooks.groovy.j2 @@ -13,7 +13,7 @@ $class: 'GitSCM', branches: [[name: 'master']], userRemoteConfigs: [[ - url: "http://forge.softwareheritage.org/source/swh-jenkins-jobs.git", + url: "${gitlab_url}/{{gitlab_project_name}}.git", ]], ]) } diff --git a/jobs/tools/setup-gitlab-webhooks.yaml b/jobs/tools/setup-gitlab-webhooks.yaml --- a/jobs/tools/setup-gitlab-webhooks.yaml +++ b/jobs/tools/setup-gitlab-webhooks.yaml @@ -1,5 +1,6 @@ - job-template: name: jenkins-tools/{name} + gitlab_project_name: swh/infra/ci-cd/swh-jenkins-jobs project-type: pipeline description: Setup Jenkins integration for a GitLab repository node: built-in diff --git a/scripts/debian/README.md b/scripts/debian/README.md --- a/scripts/debian/README.md +++ b/scripts/debian/README.md @@ -3,5 +3,5 @@ These scripts live in [swh-jenkins-jobs][] in the scripts/debian subdirectory and are updated by a [jenkins job][]. -[swh-jenkins-jobs]: https://forge.softwareheritage.org/source/swh-jenkins-jobs/ +[swh-jenkins-jobs]: https://gitlab.softwareheritage.org/swh/infra/ci-cd/swh-jenkins-jobs [jenkins job]: https://jenkins.softwareheritage.org/debian/maintenance/update-scripts