Skip to content

Commit 98396b4

Browse files
adeebshihadehclaude
andcommitted
run as root for USB access, chmod cleanup for Jenkins
USB device access requires root. Use reuseNode to share the parent workspace, and chmod 777 in post-always to ensure Jenkins can clean up root-owned build artifacts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cda98fa commit 98396b4

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

Jenkinsfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,22 @@ pipeline {
7474
agent {
7575
docker {
7676
image 'python:3.12'
77-
args '--privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host'
77+
args '--user=root --privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host'
7878
reuseNode true
7979
}
8080
}
81-
environment {
82-
HOME = "${env.WORKSPACE}"
83-
}
8481
steps {
8582
timeout(time: 10, unit: 'MINUTES') {
8683
retry (3) {
8784
sh './setup.sh && . .venv/bin/activate && export PYTHONWARNINGS=error && scons && python3 ./tests/hitl/reset_jungles.py'
8885
}
8986
}
9087
}
88+
post {
89+
always {
90+
sh 'chmod -R 777 . || true'
91+
}
92+
}
9193
}
9294

9395
stage('parallel tests') {
@@ -121,16 +123,18 @@ pipeline {
121123
agent {
122124
docker {
123125
image 'python:3.12'
124-
args '--privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host'
126+
args '--user=root --privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host'
125127
reuseNode true
126128
}
127129
}
128-
environment {
129-
HOME = "${env.WORKSPACE}"
130-
}
131130
steps {
132131
sh './setup.sh && . .venv/bin/activate && export PYTHONWARNINGS=error && pytest ./tests/som/test_bootkick.py'
133132
}
133+
post {
134+
always {
135+
sh 'chmod -R 777 . || true'
136+
}
137+
}
134138
}
135139
*/
136140
}

0 commit comments

Comments
 (0)