Question

I am trying to build my C++ project using scons on jenkins which is running on an ubuntu box (running only a master).

I have installed scons from command-line using apt-get and have installed the Jenkins Scons plugin: In the master configuration I have configured the path to the scons binary:

enter image description here

In the job config (freestyle project) I have:

enter image description here

When I run the build I get:

Building in workspace /var/lib/jenkins/workspace/my-project
Checkout:my-project / /var/lib/jenkins/workspace/my-project - hudson.remoting.LocalChannel@5d56ead7
Using strategy: Default
Last Built Revision: Revision d919f00fb2e59ce1214e276e6c60e834d4035d5b (origin/master)
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
Commencing build of Revision d919f00fb2e59ce1214e276e6c60e834d4035d5b (origin/master)
Checking out Revision d919f00fb2e59ce1214e276e6c60e834d4035d5b (origin/master)
[my-project] $ /usr/bin/scons -f scons9080484787377372778.generated -C my-project
scons: Entering directory `/var/lib/jenkins/workspace/my-project'
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.
Finished: SUCCESS

but that is not correct. Any ideas why the project/SConstruct located in the root of the workspace is not read/build?

Was it helpful?

Solution

I add the shell script :

first_is_success=`echo $?`
echo $first_is_success
if [ $first_is_success -ne 0 ]
then 
    exit 1
fi

OTHER TIPS

u123,

SCons found your SConstruct file (besides only showing Reading SConscript files). What your log shows is that everything the default SCons target(s) had to build are built already, probably because you built this job before and no source files changed since then.

Try Workspace > Wipe Out Current Workspace in Jenkins and building this job again (Build Now). The log file for the new build must show the full SCons build sequence then.

A nice thing to do is to add a build step with scons -c (Options = -c) before your scons target to clean and force a full rebuild afterwards.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top