Skip to content
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 Jenkins builds locally #54

Open
j-rivero opened this issue Mar 15, 2022 · 0 comments
Open

Reproduce Jenkins builds locally #54

j-rivero opened this issue Mar 15, 2022 · 0 comments

Comments

@j-rivero
Copy link
Contributor

j-rivero commented Mar 15, 2022

Steps that I usually run manually to reproduce jenkins:

debbuilder builds

  1. Download Dockerfile and build.sh (wget) from artifacts archived in the Jenkins run to reproduce
  2. chmod +x build.sh
  3. Docker build in the same way is being done in the build log (changing tag to test):

    docker build --build-arg GID=1001 --build-arg USERID=1001 --build-arg USER=jenkins --tag test .

  4. Docker run to go into the container

    docker run -i -t test /bin/bash

  5. Inside the container, some tweaks to deal with Jenkins paths (replace foo with debbuilder name):

    mkdir -p /home/jenkins/workspace/$foo-debbuilder/build

  6. Run build.sh (need to use bash):

    bash -x build.sh

other builds
Need to deal with git checkouts done in Jenkins that usually goes under: $WORKDIR/$software_name . The git checkouts are usually linked to input parameters in PARAMS such as sha1, DEST_BRANCH or similar.

i.e:/home/jenkins/workspace/ignition_gazebo-abichecker-any_to_any-ubuntu_auto-amd64/ign-gazebo

Looks like it is possible to run git init in $WORKDIR/$software_name and after that parse the build log for git commands starting with > at the beggining of the log and reproduce the actions of the plugin.

The recommended git tool is: NONE
No credentials specified
 > git rev-parse --resolve-git-dir /home/jenkins/workspace/ignition_gazebo-abichecker-any_to_any-ubuntu_auto-amd64/ign-gazebo/.git # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/gazebosim/gz-sim.git # timeout=10
Fetching upstream changes from https://github.com/gazebosim/gz-sim.git
 > git --version # timeout=10
 > git --version # 'git version 2.25.1'
 > git fetch --tags --force --progress -- https://github.com/gazebosim/gz-sim.git +refs/pull/*:refs/remotes/origin/pr/* +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse origin/main^{commit} # timeout=10
Checking out Revision a7071ec49d0c136fef8d3157409b9d33a8116999 (origin/main)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f a7071ec49d0c136fef8d3157409b9d33a8116999 # timeout=10
Commit message: "Acoustic comms plugin (#1608)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant