-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproduce the Jenkins CI linux build locally #923
Comments
docker build uses Using docker compose it is also not fully clean since UID/GUI seems not easy to deal with: services:
jenkins-build:
image: buildoo/jenkinsbuild
build:
context: .
dockerfile: Dockerfile
args:
GID: ${GID}
USERID: ${USERID}
USER: ${USER} Via: USERID=$(id -u) GID=$(id -g) docker compose build
USERID=$(id -u) GID=$(id -g) docker compose run --rm -e DISPLAY=unix${DISPLAY} -v /sys:/sys:ro -v /tmp/.X11-unix:/tmp/.X11-unix:rw -e TERM=xterm-256color -v /dev/log:/dev/log:ro -v /run/log:/run/log:ro jenkins-build |
While debugging an services:
jenkins-build:
image: buildoo/jenkinsbuild
build:
context: .
dockerfile: Dockerfile
args:
GID: ${GID}
USERID: ${USERID}
USER: ${USER}
run-jenkins-build:
image: buildoo/jenkinsbuild
stdin_open: true
tty: true
environment:
- DISPLAY=unix${DISPLAY}
- TERM=xterm-256color
- GID=${GID}
- USERID=${USERID}
- USER=${USER}
volumes:
- /sys:/sys:ro
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- /dev/log:/dev/log:ro
- /run/log:/run/log:ro
entrypoint: ['./build.sh'] Via:
That will reproduce the build of for example https://build.osrfoundation.org/job/ros_gzharmonic_bridge-install-pkg_iron-ci-jammy-amd64 . To obtain a debugging shell in the fail of the
|
The noble images could be currently broken since they have a default ubuntu user with UID 1000. This could match the local user UID hence broken. |
After #1191, the SHELL_ON_ERRORS var is ready, the code could be something like:
|
It should be possible trying to reproduce a Linux build on Jenkins in a local system in a non very difficult way. They mainly consist in a Docker enviroment + build.sh script and a custom way of running them in using
docker run
parameters.Roadmap:
Dockerfile
andbuild.sh
from each Linux build Export Dockerfile/build.sh as artifacts from each build #279--home
.gzdev
small module.Known problems:
/home/jenkins/workspace/xxx-debbuilder/build
does not exist/home/jenkins/workspace/sdformat15-debbuilder/pkgs
not a directory but a fileThe text was updated successfully, but these errors were encountered: