I have hudson job which will do both Build (ant) / deployment(shell commands) tasks in one job; is there a way, i can make deployment task optional so that i can run my build step on schedule basis and run deployment step on-demand basis?
Two options:
Just separate jobs
Make parametrized job (see http://wiki.hudson-ci.org/display/HUDSON/Parameterized+Build) and add validation before deployment job, e.g.
if [ -e "$deploy" ] ; then
#deployment
fi
Related
I'd like to create a CI flow on GitHub Actions for a compilation process of my ESP-IDF-based project, over my self-hosted runner.
The ESP-IDF require exporting numerous shell variables and other shell-related tasks before the compilation. They provide a an export.sh script for that and expect the user (me) to source export.sh before the compilation steps.
How can I guarantee that all steps under a certain job are done under a custom shell with the ESP-IDF requirements?
I'm aware that I can have multi-line run commands in GitHub Actions, but that will require me to source export.sh on each step, won't it? This will slow down the job.
Thanks
You can use the docker image given by Espressif itself.
Here the GitHub guide
https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action
Here the Espressif guide to their docker image
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html
I have a jenkins job to build my project run tests and then run sonar with sonar jenkins-plugin.
but when tests failed sonar analysis skipped.
You can trigger Sonar Analysis as a build step and not a post-build step. Take a look at this.
But my question is, why you should want to run a quality analysis for a project failing its build?
You can use flexible publish plugin in Jenkins.
https://wiki.jenkins-ci.org/display/JENKINS/Flexible+Publish+Plugin
As a post build action, use Conditional action to "Always". Whatever be the previous step result, the action would be run. Select sonar analysis as the action.
I have implemented Hudson master, slave job configuration and it is working fine. In which i have to run 2 scripts in a job from hudson master. can you help me is there possibility to run 2 scripts? as well both scripts are dependencies like the second should run after the first script executed.
Thanks in advance - sri
All you need to do is include the script as a build step in your current build for example.
Pull down source
Build it
Run the script, as part of the build step.
This option is only available for Free Style Jobs.
Here is where the scripts would go or path to script to execute.
Goodluck.
I have a bunch of Maven projects building in Hudson with Sonar sitting in the side-lines. Sonar gives me Sonar stats, FindBugs stats, and code-coverage.
I've noticed that regardless of if I use Sonar or if I use EMMA via Maven directly, the entire build cycle runs twice. This includes init (which in my case, reinitializes the database -- expensive) and unit tests (a few hundred -- also expensive).
How can I prevent this? I did a lot of reading, and it seems like this is due to the design of code-coverage plugins -- to keep uninstrumented classes separated from instrumented ones.
I've tried configurations like:
Maven runs: deploy, EMMA
Maven runs: deploy; deploy to Sonar on completion
The sonar documentation recommends running the sonar plugin in 2 stages:-
mvn clean install -Dtest=false -DfailIfNoTests=false
mvn sonar:sonar
The tests are bypassed in the first phase and run implicitly in the second stage.
A one line alternative is to run the following command:-
mvn clean install sonar:sonar -Dmaven.test.failure.ignore=true
but this will run the tests twice - as you have found.
To add to #Strawberry's answer, you could reuse the unit test reports instead of running them again. Refer to the section Reuse existing unit test reports in the sonar documentation
Once this is done, you can configure the following in Hudson
clean deploy sonar:sonar
Ive set up deployment in hudson. SVN > Build > copy to production. I need to set up a schedule build to test for build error which is running every hour or so. What I dont want is the schedules builds to deploy to production.
Is it posible to detect, in nant, if the current build is a scheduled build or a manually started build. Or should I create a seperate project for the schedule build?
The cleanest option is to create a separate job for your scheduled build; you can then keep other artifacts like test results separated (since I assume your scheduled job will be running a different set of tests).
If you're just running the scheduled job to look for build errors, this will also keep the checked-out code that you're building separate from the triggered builds, which will minimize the risk of the production builds getting polluted with artifacts created by the test build.