Changeset View
Changeset View
Standalone View
Standalone View
jobs/templates/swh-mirror-run-tests.groovy.j2
| Show All 15 Lines | pipeline { | ||||
| stages { | stages { | ||||
| stage('Checkout') { | stage('Checkout') { | ||||
| agent { | agent { | ||||
| label "built-in" | label "built-in" | ||||
| } | } | ||||
| steps { | steps { | ||||
| {%- if gitlab_project %} | |||||
| updateGitlabCommitStatus name: 'jenkins', state: 'running' | |||||
| {%- endif %} | |||||
| {%- if not gitlab_project %} | |||||
| git url: "https://forge.softwareheritage.org/source/swh-mirror.git" | git url: "https://forge.softwareheritage.org/source/swh-mirror.git" | ||||
| {%- else %} | |||||
| git url: "{{gitlab_url}}/swh/infra/swh-mirror.git" | |||||
| {%- endif %} | |||||
| } | } | ||||
| } | } | ||||
| stage('Build Docker test images') { | stage('Build Docker test images') { | ||||
| agent { | agent { | ||||
| label "built-in" | label "built-in" | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | always { | ||||
| # Wait for any remaining containers | # Wait for any remaining containers | ||||
| docker container ls --filter=label=com.docker.stack.namespace=swhtest_mirror0 --quiet | xargs --no-run-if-empty docker container wait || true | docker container ls --filter=label=com.docker.stack.namespace=swhtest_mirror0 --quiet | xargs --no-run-if-empty docker container wait || true | ||||
| # Cleanup cruft | # Cleanup cruft | ||||
| docker config ls --filter=label=com.docker.stack.namespace=swhtest_mirror0 --quiet | xargs --no-run-if-empty docker config rm || true | docker config ls --filter=label=com.docker.stack.namespace=swhtest_mirror0 --quiet | xargs --no-run-if-empty docker config rm || true | ||||
| docker volume ls --filter=label=com.docker.stack.namespace=swhtest_mirror0 --quiet | xargs --no-run-if-empty docker volume rm || true | docker volume ls --filter=label=com.docker.stack.namespace=swhtest_mirror0 --quiet | xargs --no-run-if-empty docker volume rm || true | ||||
| ''' | ''' | ||||
| } | } | ||||
| } | } | ||||
| {%- if gitlab_project %} | |||||
| failure { | |||||
| updateGitlabCommitStatus name: 'jenkins', state: 'failed' | |||||
| } | |||||
| success { | |||||
| updateGitlabCommitStatus name: 'jenkins', state: 'success' | |||||
| } | |||||
| aborted { | |||||
| updateGitlabCommitStatus name: 'jenkins', state: 'canceled' | |||||
| } | |||||
| {%- endif %} | |||||
| } | } | ||||
| } | } | ||||