execute PAF scripts in a pipeline in GIT Lab - ipaf

I create a project in git lab. I'm trying to use pipelines . Is it possible to execute PAF scripts in a pipeline in GIT Lab?

Yes, you can configure PAF scripts execution in a GitLab pipeline.

Related

How to run a PowerShell script after check in the code to AzureDevOps

I have a PowerShell script to push a package to AzureDevOps.
I want to run it, automatically, every time that I Check In the code to AzureDevOps in Visual Studio.
Is this possible? How can I do this?
If you are pushing package to git in Azure DevOps you can create build pipeline that will execute this package, and this build pipeline will have trigger to run after each commit.
IF you are pushing packages to Azure DevOps Artifacts then you have option to use Azure DevOps RestApi or Power Shell Module for Azure DevOps and trigger specific build.

Jenkins Multi-Branch Pipeline -- include another script into local Jenkinsfile

We are just starting out using Jenkins Multi-branch pipelines. I like the idea of Jenkins automatically creating a new Jenkins job when a new branch is created. It will make sure that all releasable development is being built in Jenkins. We have about 40 or 50 projects that get branched for almost every release, and creating those 40 or so jobs every time we branch is error prone work.
However, I see there are two types of pipeline builds in Jenkins:
Regular Pipeline builds: You specify the location and branch in your Jenkins job. However, you can specify whether you want to use the script inside your Jenkins job configuration, or a script from your source repository. This would allow us to maintain a single Jenkinsfile for all of our jobs. If we change something in the build procedure, we only have to edit a single Jenkinsfile.
Multi-Branch Pipeline builds: Jenkins will automatically create a new Jenkins job for you when a new branch is created. This means we no longer have to create dozens of new Jenkins projects when a new branch occurs. However, it looks like the Jenkinsfile must be located on the root of the project. If you make a basic change in your build procedure, you have to update all Jenkins projects.
I'd like to be able to use the Multi-branch Pipeline build, but I want to either specify where to pull up the Jenkinsfile from our repository, or include a master Jenkinsfile from a repository URL.
Is there a way to do this with Jenkins Multi-branch pipelines?
If you have common build logic across repos, you can move most of the pipeline logic to a separate groovy script. This script can then be referenced in any Jenkinsfile.
This could be done either by checking another checkout of the repo that the the groovy script is in to another directory and then doing a standard groovy load or, probably the better approach would be by storing it as a groovy script in the Jenkins Global Script Library - which is essentially a self-contained git repo within Jenkins
(see https://github.com/jenkinsci/workflow-cps-global-lib-plugin/blob/master/README.md for more details).
We had a similar requirement, and created a global groovy method in a script that was maintained in Git and deployed to Jenkins' Global script library under /vars/ when it changed:
e.g. the script 'scriptName.groovy' has
def someMethod(){
//some build logic
stage 'Some Stage'
node(){
//do something
}
}
That way the common function could be called in any Jenkinsfile via
scriptName.methodName()

Is it possible to make Jenkins run a script after a job is created?

I have a code management app that integrates with Jenkins via CLI, creating, deleting and building jobs. After I create a new Jenkins job, I need to run a shell script. This script depends on some directories created by Jenkins, namely the workspace.
Jenkins CLI is non blocking, thus I can't just wait for the command to terminate. Is it possible, maybe with a plugin (I couldn't find any...), to trigger the execution of a shell script post job creation?
jenkins CLI command build has the command option -s which will block the trigger action until is finished.
See YOUR_JENKINS_URL/cli

How to trigger hudson job through "execute shell"?

I want to write a shellscript, in which it git pulls the remote repository.
and if the local repository is not up-to-date then trigger the build of hudson job.
In further scenario :
1) where to link up this shellscript (my shellscript ".sh" file) in hudson. so that it gets executed periodically before build.
Is there a way in configure Job :
2) Adding "execute shell" build step in hudson? and writing my shellscript over here.
Please specify me with shellscript code too.
From what you describe you should just use Jenkins' Git plugin. Is there something you are trying to do that isn't covered by it?

Jenkins CI + Ant + SSH Plugin

So the way I have this setup is:
Jenkins Polls for changes on repo
Jenkins Initiates Ant
Jenkins uses SSH plugin to run a script on a remove server (to run a git pull)
The problem is that if Ant fails, Jenkins still moves on to step 3 and processes the script.
How do I make Jenkins just stop everything after step 2? Or is there a better way of doing my process?
I think what I really needed was Publish Over SSH instead. This enables you to include it in the Post Build Options.

Resources