0

I'm trying to use Jenkins as a CI/CB system (unit testing included) using headless Eclipse/TrueStudio for embedded C. There doesn't seem to be many examples for this, and even the Jenkins site itself doesn't have an example Jenkins file. I've used a CI like CircleCI before, but that was a terrible experience as they were transitioning from CircleCI 1.0 to 2.0 and the specific setup i was using was largely devoid of material. I spent over 100 commits linking Android Studio, Git, and Firebase together. Anyone have a C/C++ based example Jenkinsfile I can look at?

So far I've got this as a Jenkinsfile:

pipeline {
    agent any

    stages {
        stage('Build') {
            steps {
                echo 'Building..'
            }
        }
        stage('Test') {
            steps {
                echo 'Testing..'
            }
        }
        stage('Deploy') {
            steps {
                echo 'Deploying....'
            }
        }
    }
}

I'm using one machine for this as the project is small in size. The code is stored in a git repo on the same machine. We're using TrueStudio which is modified Eclipse, and has a headless mode bat file. One example from comments in bat file:

Example usage: 
REM   1. Performs a rebuild on build configuration "config" for project "proj" in workspace "MyWorkspace".
REM      Command: headless.bat -data C:\MyWorkspace -build proj/config

I'm currently working on syncing up the git repo and Jenkins.

ConductedForce
  • 194
  • 2
  • 14
  • Does the `Jenkinsfile` you posted here run? If so, it should just be a matter of replacing your `echo` lines with whatever commands you'd actually use to build/test/deploy. I don't have any experience using TrueStudio/Eclipse so I'm not sure where to start with figuring out the commands, but try building on the command line directly, without your IDE. – Stephen Newell Apr 03 '20 at 04:30
  • Had to learn a shortcut with git, but the sample I posted seems to work. Jenkins setup is different than CircleCI so I had a small learning curve to get over. I'm using a multibranch pipeline at the moment, but I think it'll work well once I put the eclipse portion in. – ConductedForce Apr 04 '20 at 07:08

0 Answers0