-
Notifications
You must be signed in to change notification settings - Fork 38
Build Server
##Continuous integration and the build-server Continuous integration (CI) is the practice of building a repository several times a day, checking that there are no compilation errors and test failures. Additionally before any commit is merged to the master, it must build successfully on the build-server. (This is part of a code-review / build-test, see below).
All code that is merged to master from a feature branch should be proposed by issuing a pull-request. The code should then be reviewed by a collaborator to catch bugs and inefficient implementations. At the time a pull-request is opened the build-server will automatically start a build. The result of this build is reported back to github where the pull-request status is updated accordingly (see below for more explanations).
To warm up, let's see how many bugs you can spot in the following example:
int main() {
int* foo = new int[4], *bar = new int[4];
std::thread{[&](){bar++;}}.detach();
delete foo;
return *foo + (*++bar) + bar[3];
}
###Basic usage: ####Accessing the build server The build server can be accessed from here: http://129.132.38.183:8080/
####Logging in We use github as authentification backend. So after pressing the login button on any page of the build server it should take you to github for authentification. After logging in you have access to additional features including the ability to trigger builds.
####Build server gui
The build-server job overview looks like this:
Missing the READ permission: You need to be member of the ethzasl organization and make your membership public. If the access does not work, write a mail to [email protected]. ####Manually triggering a build
- Select a build job that you want to use from the overview page.
- Trigger a job by clicking "Build with Parameters"
- Specifying a
branch
or theSHA
of a particular commit. - Click
build
to start the build.
- When you send a pull-request (Code-review-process) to a repository which is integrated to the build-server, a build will be automatically triggered.
- Whenever you push a new commit to a branch where there is a pull-request opened already, this new commit will be automatically build.
- To manually rebuild the last commit of a pull-request, add the following comment to the pull-request:
Jenkins, test this please.
using the commenting function at the pull-request page.
The status of a build is marked in two ways:
- Next to each commit a check-mark or cross signals if a build was successful. Clicking on the icon takes you to the build-status page on the build server.
- The merge button at the end of the pull-request is yellow if the build failed or is pending. The button turns green if the build is successful.
Never merge a branch that does not build on the build-server.
Access the failed build by clicking the red-cross-icon next to a commit in a pull-request.
- Click on Console-Output to access the output of the compiler. (You might need to click on "full-log" at the top to see the full output).
- You can use the "Parsed Console Output" menu item from the menu on the left to access filtered output with just errors and warnings.
You can access particular builds for a project:
- by going to the build-server, project page, then picking a build-number from the list on the left.
- by clicking the icon next to a commit in a pull-request.
You can now see a couple of additional tools, by selecting their summary pages from the menu on the left or from the summary page of a build:
- Test results: The results from gtests automatically run after the build passed.
- Compiler Warnings: The number of compiler warnings and history thereof.
-
Open Tasks: The code-base is automatically crawled for comments including
TODO
orFIXME
and these are then summarized. - Cpp-check: A static analysis is run on the code to identify common problems. E.g. null-ptr dereferencing, undefined value usage etc.
The best thing is to copy existing jobs.
- Go to the main Jenkins page http://129.132.38.183:8080/
- Click the button on the top right to log in.
- Click on "new item" from the menu on the left.
- Give an item name (job-name == usually the repository name)
- Click "Copy existing job"
- Enter one of the following names:
- ethzasl_msf for a catkin or rosbuild based project
- libnabo for a pure cmake build project or any other build-system
- Click ok to create the job.
- In the newly created project adjust the "github project" URL.
- Under "Source Code Management" set the URL of the repository. (e.g. SSH git link).
- Under "Additional Behaviours" adjust the "Local subdirectory for repo" option.
- Under "Build" adjust the "Execute Shell" command:
~/continuous_integration/run_build.sh
--dependencies="[email protected]:ethz-asl/asctec_mav_framework_devel.git"
--packages="msf_core msf_updates"
- dependencies (optional) You can list a space separated lists of github repositories which your project depends on. These repositories are checkout out at the master branch and included in the build. This is required if your repository has dependencies on other projects, because otherwise the workspace will contain only your package.
- packages (optional) You can list a space separated list of packages you want to build instead of just building all packages. This invokes
rosbuild your_packages
orcatkin build --pkg your_packages
respectively.
http://wiki.asl.ethz.ch/index.php/Server_Configuration#Build_Server