How to run a specific job with GithubActions - devops

When some of my GithubActions jobs has failed, I don't have the possibility to re-run the specific failing job, only "Re-run all jobs". Is there any way to achieve this?

This is all working now in GitHub, the caveat is you can only run "specific jobs in a workflow run up to 30 days after its initial run."
https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs#reviewing-previous-workflow-runs

I’m the workflow file you want to be able to manually trigger, add workflow_dispatch to the “on:” clause. Then go to the actions tab on github, select the action and you should see the option to manually run it. Before asking this type of question, please use google next time. When looking for “triggger github workflow manually” the first result is a article written by github on how to do it. https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow

Unfortunately, re-run a single job is not possible yet.
Their repository does have an Open Issue to implement this feature.
https://github.com/actions/runner/issues/432
The good news is it is officially in their roadmap and is scheduled for Q1 2022.
https://github.com/github/roadmap/issues/271

Related

How to start another build on CodeClimate after the initial build fails?

Here's the first fail build. I forgot to configure file. So I added it again and recommit. Now it won't fire again.
Do I have to get a CI (using Travis CI) to first successfully test it first?
You can press the refresh button in the top right corner on your repo.
Support got back to me and told me it was a problem on their end.
Sorry that your repository got stuck in that weird "limbo" state.
Currently, we don't automatically install our webhook for open-source
repositories and without that we don't see any subsequent commits if
the first analysis errors. Our dev team plans to improve this
experience, but in the meantime, I'd recommend installing our webhook.
This hook is what notifies us of certain events happening in your
repository including commits made to your default branch.
To get that installed you'll need to run through steps 5-7 in this
help doc here: https://docs.codeclimate.com/docs/github#pull-requests.

Jenkins: trending graph for build step time

My project has about 20 build steps and i want to monitor how much time each step takes over builds. I found Jenkins doesn't display such info.
Can use any of Jenkins tools or plugin to do that?
Was just looking for the same and found your post. There is this plugin though it doesn't show you a nice graph or anything it will add the raw timestamps to your log lines on a per project basis. https://wiki.jenkins-ci.org/display/JENKINS/Timestamper If you install it you have to configure each project separately to check the add timestamps to console box (there is a script for doing all projects at once but I didn't want to chance that and only need it to diagnose a particularly slow build).
Did you try this. Makes sense to your case.
https://wiki.jenkins-ci.org/display/JENKINS/build-metrics-plugin

Access properties of old builds in a Workflow job

Is it possible to access the last failed build and the last successful build informations within a Workflow Job?
The information I need is the start time of those builds.
This was reposted and some options made available in JENKINS-29563. In particular I suggest reading the Snippet Generator documentation for currentBuild.

Jenkins Dependent build for common branch

I have a requirement to do a dependent build using Jenkins Following is the requirement:
Project 1 has a branch which is used among two release lines. For example project1 development branch ikt/master is share in two release line rel1.2_4GB and rel_1.2_2JB.
When ever a change is submitted in ikt/master of project1 it should trigger build of both the release line rel1.2_4GB and rel_1.2_2JB simultaneously.
Build results should wait for other build to pass means both builds should be green.
Please suggest me steps using both plugin as well as without plugin (if possible).
Kind Regards,
I think your best option is to use the Parameterized Trigger Plugin to do this.
It's very simple and easy to use and you can trigger several child jobs and wait for their results. Based on their results, you can choose to fail or pass the build.
I suggest you read some more about it and do some experimenting. It works very well for me.
I hope this helps.
NOTE - I suggest not wasting time looking for a non plugin solution. If you have a good tool, use it. Don't loose time trying to be smarter...

Jenkins conditional project

The projects concerned in my linked solution are the initialise database, import database and export database.
If the initialisation succeeds then 'export' should be called. If it fails then 'import' should be called.
dbinit
/ \
export import
Logically this is simple enough; however, due to my lack of Jenkins experience, it's causing considerable grief.
I've looked at the following plugins:
Conditional BuildStep - this basically adds an 'if' statement to the build. I investigated this with the idea that the export/import projects can be collaborated into one project, using the condition to decide which course of action to take. This could work if I was able to check the condition of the upstream build (success or failure)
Post Build Task - executes a shell script based on the log output. This would go in the dbinit project. The problem with this is that I would like import/export jobs to be separated from dbinit. This would work IF I could call another job from the shell
Parameterized Trigger - This could be perfect. This would basically solve the problem by deciding which job to run based on the status of that build. However, at the time of writing, this plugin does not perform correctly with Jenkins version 1.481 or above. This problem was raised a month ago (see error link, dated the 12th Sep 2012) and has still not been fixed, therefore I am still looking for another solution.
Can anyone tell me how to overcome the identified problems with any of these plugins?
Or is there another route that I've overlooked?
Many Thanks,
Rory
In case jenkins 1.481 or later doesn't give you anything you need, and Parametrized Trigger works, then simply use 1.480, and wait 'till problem gets fixed (it is sure to get fixed, that's so popular plugin).
Would the Build Result Trigger help you?
With the BuildResultPlugin, you configure jobB to monitor jobA build result. A build is scheduled if there is a new build result matches your criteria (unstable, failure, ...)

Resources