jenkins-pipeline

How do I know which stage of jenkins pipeline has failed

核能气质少年 提交于 2020-02-18 08:08:18
问题 In my Jenkins pipelines I generally use post declarative function to send me an email incase the pipeline has failed. A simple syntax of the post function is as under: post { failure { mail to: 'team@example.com', subject: "Failed Pipeline: ${currentBuild.fullDisplayName}", body: "Something is wrong with ${env.BUILD_URL}" } } In the above email, I also want to mention which stage (lets say the pipeline has 5 to 6 stages) of the pipeline has failed. How can I do that? Any help is much

script.sh: line 1: ./gradlew: No such file or directory on Jenkins

杀马特。学长 韩版系。学妹 提交于 2020-02-15 06:49:32
问题 This is error message I got ./gradlew clean assembleRelease /Users/bhanukaisuru/.jenkins/workspace/OrelGo@tmp/durable-b74adbad/script.sh: line 1: ./gradlew: No such file or directoryPipeline Script Pipeline Script stage('Build Release APK') { sh "./gradlew clean assembleRelease" } 回答1: You do not need to specify the Jenkins workspace with the commands sh and bat if you want to execute a command on the root level of it. sh 'mkdir test' would create a folder in <jenkins_workspace>/test for

script.sh: line 1: ./gradlew: No such file or directory on Jenkins

妖精的绣舞 提交于 2020-02-15 06:46:37
问题 This is error message I got ./gradlew clean assembleRelease /Users/bhanukaisuru/.jenkins/workspace/OrelGo@tmp/durable-b74adbad/script.sh: line 1: ./gradlew: No such file or directoryPipeline Script Pipeline Script stage('Build Release APK') { sh "./gradlew clean assembleRelease" } 回答1: You do not need to specify the Jenkins workspace with the commands sh and bat if you want to execute a command on the root level of it. sh 'mkdir test' would create a folder in <jenkins_workspace>/test for

script.sh: line 1: ./gradlew: No such file or directory on Jenkins

时光毁灭记忆、已成空白 提交于 2020-02-15 06:46:26
问题 This is error message I got ./gradlew clean assembleRelease /Users/bhanukaisuru/.jenkins/workspace/OrelGo@tmp/durable-b74adbad/script.sh: line 1: ./gradlew: No such file or directoryPipeline Script Pipeline Script stage('Build Release APK') { sh "./gradlew clean assembleRelease" } 回答1: You do not need to specify the Jenkins workspace with the commands sh and bat if you want to execute a command on the root level of it. sh 'mkdir test' would create a folder in <jenkins_workspace>/test for

Jenkins pipeline error - “process apparently never started in …”

﹥>﹥吖頭↗ 提交于 2020-02-15 06:44:42
问题 Getting below strange error in Jenkins pipeline [Pipeline] withDockerContainer acp-ci-ubuntu-test does not seem to be running inside a container $ docker run -t -d -u 1002:1006 -u ubuntu --net=host -v /var/run/docker.sock:/var/run/docker.sock -v /home/ubuntu/.docker:/home/ubuntu/.docker -w /home/ubuntu/workspace/CD-acp-cassandra -v /home/ubuntu/workspace/CD-acp-cassandra:/home/ubuntu/workspace/CD-acp-cassandra:rw,z -v /home/ubuntu/workspace/CD-acp-cassandra@tmp:/home/ubuntu/workspace/CD-acp

How to pass choice parameter to call a job inside jenkins pipeline

て烟熏妆下的殇ゞ 提交于 2020-02-07 02:26:11
问题 How can I pass choice parameters for the downstream job when called inside a stage in the jenkins pipeline? I tried the below solutions but none worked: stage('build job') { steps{ script{ build job: 'test', parameters: [ choice(choices: "option1\noption2\noption3\n", description: '', name: 'choiceParam') ] } } } fails with java.lang.UnsupportedOperationException: no known implementation of class hudson.model.ParameterValue is using symbol ‘choice’ Tried these as well: parameters: [ [$class:

Using multiple JDKs in single scripted pipeline

為{幸葍}努か 提交于 2020-02-06 11:09:42
问题 We have a situation where JDK1.7 is used to compile a project and JDK1.8 is used in sonar pipeline job on the aforementioned compiled code. Is it possible to use 2 JDKs in a single scripted job. If sonar stage is reached, then JDK 1.8 must be used. Currently this is our pipeline. node('jenkins_uat_sdg_1g'){ env.JAVA_HOME="${tool 'JDK1.7_110'}" env.PATH="${env.JAVA_HOME}/bin:${env.PATH}" deleteDir() try{ try{ stage('SCM Code Checkout'){ echo "Checking out source code from SVN..." echo

How do i trigger jenkis build for every 2hours through jenkins file

北城余情 提交于 2020-02-06 07:57:33
问题 Below is my jenkins file: #!groovy node('EJ2Release') { try { deleteDir() stage('Import') { git url: 'https://gitlab.syncfusion.com/essential-studio/ej2-groovy-scripts.git', branch: 'master', credentialsId: env.JENKINS_CREDENTIAL_ID shared = load 'src/shared.groovy' } stage('Checkout') { checkout scm shared.getProjectDetails() shared.gitlabCommitStatus('running') } if(shared.checkCommitMessage()) { stage('Install'){ shared.install() } stage('Build') { sh 'npm run build' } stage('Publish') {

Jenkins pipeline, bitbucket hook and maven release plugin infinite loop

纵然是瞬间 提交于 2020-02-02 10:46:11
问题 I haven't been able to find any info about this, so i hope you guys can help me on this one I've a maven project hosted in bitbucket that has a BitBucket WebHook pointing to someurl/bitbucket-hook/ , this hooks triggers the build of my project that is defined by a pipeline that has this structure: node { stage 'Checkout' git url: 'https:...' def mvnHome = tool 'M3' #Various stages here ... stage 'Release' sh "${mvnHome}/bin/mvn -B clean install release:prepare release:perform release:clean" }

Jenkins pipeline, bitbucket hook and maven release plugin infinite loop

孤街浪徒 提交于 2020-02-02 10:45:28
问题 I haven't been able to find any info about this, so i hope you guys can help me on this one I've a maven project hosted in bitbucket that has a BitBucket WebHook pointing to someurl/bitbucket-hook/ , this hooks triggers the build of my project that is defined by a pipeline that has this structure: node { stage 'Checkout' git url: 'https:...' def mvnHome = tool 'M3' #Various stages here ... stage 'Release' sh "${mvnHome}/bin/mvn -B clean install release:prepare release:perform release:clean" }