Concurrent builds in jenkins - jenkins-plugins

I am very new to Jenkins. In my company we are moving build process from cruisecontrol.net to Jenkins. So I did all the set-up. Now what I need is, I want to trigger 3 downstream builds same time after the success of one upstream build.
Example: After success of A, it should trigger the build B,C,D.
Please let me know the way. Thanks in advance

In the 'Post-build Actions', add 'Build other projects'. A comma-separated list of projects can be entered. Also, you have the option of having it only trigger these jobs upon a stable build.
Click below for more details about this and other options:
How to use Jenkins for Job Chaining and Visualizations

Related

How do I run occasional tasks that update data in a database?

Ooccasionaly I need to run tasks that update data in a database. I might need to run them ever again, or not a new server - no idea. For I need to run them once and in a certain release only. And they should be outside of git index.
Some tutorial suggest that I run them with "custom migration", in which a 2nd directory for migrations is created called "custom_migrations" and they'll be run from there via Ecto.Migrator. But this will case a problem: I run all of the custom_migrations, then delete all of migration files (because I won't need them anywhere else, not on a new server either, once I've run them), then create new ones when a need arises, and then Ecto.Migrator will complain about absense of the migrations that I've deleted.
I'm also aware of ./bin/my_app eval MyApp.Tasks.custom_task1 but it's not convinient because I'll have to call it manually and passing arguments to a function isn't convinient via the command line.
What I want is: create a several files that I want to be run in this current release, once. Store them in a certain directory of an application. Deploy a application. They'll get run automatically, probably on application boot and then I remove them. Then, after some time, I may want to create new ones and only those new ones will need to get run.
How to do this? What's a recommended way in Ellixir/Phoenix?

Change data at specific condition in sequelize

I am using PostgreSQL with sequelize on Javascript project. It is about managing project schedule and I want to update my data on specific condition. For example
There is one Project with 'due_date' and 'current_status'.
If I set 'due_date' then 'current_status' become 'ongoing'.
When current date passes 'due_date', then 'current_status' should become 'delayed'.
I want to make step 3 automatically, but I have no idea where to handle. Currently I am looking for hooks but I can not find any hooks that can satisfy it. Is there any solution for this?
You will need to schedule a job to actively look for rows that need updating.
The job can be fired by some external scheduler (e.g. cron) or by the pg_cron extension if you're able to install it.

Is there a way to tell if a release is fired by a schedule in octopus

We have a project in Octopus that has been configured to release to an environment on a schedule.
In the process definition we use a step template for Slack to send the team a notification when a release takes place. We would like to avoid sending this Slack message if the release was fired by the schedule - rather than user initiated.
I was hoping there would be a system variable that we could check before running the Slack step - but I can't seem to find anything documented as such, and google didn't turn anything up.
TIA
If you are using Octopus 2019.5.0 or later, there are two variables that will be populated if the deployment was created by a trigger.
Octopus.Deployment.Trigger.Id
Octopus.Deployment.Trigger.Name
You can see the details at https://github.com/OctopusDeploy/Issues/issues/5462
For your Slack step, you can use this run condition to skip it if the trigger ID is populated.
#{unless Octopus.Deployment.Trigger.Id}True#{/unless}
I hope that helps!

Jenkins pipeline - Extended Choice Parameter

I am using Jenkins version - v2.73.2 and Jenkins pipeline - 2.5 and wanted to have below multi select options. Users should be able to choose more than one option.
Build
Deploy
Analysis
Test
For example, if user selects the options- Build , Analysis and Test. First Build job should be executed then Analysis and Test. If user selects the 'Analysis' option , sub-options need to be displayed like 'Choose Instance' - Dev , QA, PreProd and Prod.
Right now i am able to create the multi select options to select Build, Deploy , Analysis and Test using 'Extended Choice Parameter plugin' and now i want to add sub list option if 'Analysis' is selected. Please share your inputs how can i acheive this scenario.
This is not possible in Jenkins build with parameters page. Parameters are loaded all at once, and cannot have logic that depends on the value of another one.
If you truly need this you will need to use an input step after job kickoff to evaluate the 1st provided param and provide a list for the user to choose from.
This is because params are 'post processed', they are evaluated/executed during job execution. This is why you need a single run of a pipeline job before 'Build' becomes 'Build with parameters'.

When switching to Jenkins mid-project, how to build artifacts for old tags?

I'm working on a project that has already been going on for a while. Unless I am mistaken, part of the use of Jenkins is to store artifacts for desired builds (i.e., releases or tags). This is preferable to me because I don't want to store binaries in the VCS system (SVN).
Moving forward, I can tag successful builds through Jenkins, and the artifacts will be stored forever. But what about old tags? Is there any way I can build all of the previous SVN tags so that the artifacts are available to anyone who needs?
I guess I could make a separate build for each tag, but that would be very tedious and make it difficult to find the artifacts.
You can add parameters to the jenkins task, and have the parameter dropdowns populate from the SCM tags. You can then use the parameter variables in the URL for the scm pulls.
So, when you go to run a build task, you can select the tag, and the appropriate source will be pulled.
If this is inline with what you're envisioning. I'd be glad to expand.
You can create a parameterized build task, which will check out by tag to build. thus, you need only input the tag name at each build.
But I think you are mistaken -- Jenkins does store artifacts, but it does so more as a side effect of the build, and generally keeps only a couple of the last builds for disk space management. If you want to maintain a library of previous builds, you probably want something like artifactory.

Resources