Get started with Jenkins
Jump to navigation
Jump to search
Want to run the CI directly in Gitlab?[edit | edit source]
The shared runner in Gitlab needs to be allowed by a Forge Admin. Contact cti_support at etsi dot org for more information.
Build scripts[edit | edit source]
The default build command for Jenkins on Forge is as follows:
#!/bin/bash bash .jenkins.sh
This means that Jenkins will look for a file called .jenkins.sh (note the dot at the beginning!) and will exectude the shell commands inside.
Guidelines for writing your build script[edit | edit source]
- Jenkins uses the returned exit code of the script to determine the outcome of the build:
- Exit status 0: successful build
- Exit status 1: build failed
Basic build script example[edit | edit source]
A very basic example for a script, assuming you need to run the compile command on a text file and check that an HTML file has been created
#!/bin/bash
compile myfile.txt
if [ -f myfile.html ] ; then
exit 0
else
exit 1