marked build as failure in jenkins - jenkins

sshpass -p Naveen#1604 scp -r /var/lib/jenkins/workspace/fastpostclose stellar#192.168.25.154:/var/www/html/fastpostclose
Build step 'Execute shell' marked build as failure
Finished: FAILURE
im using this command for moving files from jenkins to ubuntu server but it is showing build failure

Related

pushing maven artifact to nexus through jenkins

I want to push my artifact from jenkins to nexus but I am getting this error
Error response from daemon: login attempt to http:142.93.XXX.XXX:8081/v2/ failed with status: 404 Not Found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
My Docker commands
docker build -t 142.93.XXX.XX:8081/java-maven-app:1.0 .
echo $PASSWORD | docker login -u $USERNAME --password-stdin 142.93.XXX.XX:8081
docker push 142.93.XXX.XX:8081/java-maven-app:1.0
Everything is correct except the v2 folder that is not on the repository. I was thinking that should be created automatically. How do I solve this issue and I cant create the folder manually.

Job is failing on jenkins when activating python virtual environment

I am trying to activate python Virtual environment.Jenkins war file is deployed in tomcat server.please advice what is causing this error
Running as SYSTEM
Building in workspace /opt/bitnami/apps/jenkins/jenkins_home/workspace/COMP_Admin_V2-FreeStyle
[COMP_Admin_V2-FreeStyle] $ /bin/sh -xe /opt/bitnami/apache-tomcat/temp/jenkins8889266070033436161.sh
python3.6 --version
Python 3.6.8
python3.6 -m venv ./env
source /opt/bitnami/apps/jenkins/jenkins_home/workspace/COMP_Admin_V2-FreeStyle/env/bin/activate
/opt/bitnami/apache-tomcat/temp/jenkins8889266070033436161.sh: 3: /opt/bitnami/apache-tomcat/temp/jenkins8889266070033436161.sh: source: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Jenkins - groovy script returned exit code 126

I got a very simple Groovy script in Jenkins running in pipeline
For this code:
sh 'chmod +x gradlew'
sh './gradlew build --info'
I'm getting this error:
[Pipeline] sh
+ ./gradlew build --info
/var/jenkins_home/workspace/Pipeline with Gradle#tmp/durable-646d54ad/script.sh: line 1: ./gradlew: Permission denied
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 126
Finished: FAILURE
What am I missing here?
Looks like it does not have permission to run gradlew from your error message.
line 1: ./gradlew: Permission denied
You can do the following:
SSH into the jenkins machine
Switch to jenkins user
sudo su jenkins -
Check the permissions on the file gradlew using the command
ls -l /var/lib/jenkins/workspace/Pipeline with Gradle
Run the connand ./gradlew build --info from terminal and make sure it works before you run the job again
I use declarative pipelines using groovy and it works fine. I have grails installed on the machine and jenkins user can run the command. I use:
sh './gradlew dependencies && ./gradlew assemble && find ./ -name "*.war"'
Please add a comment if you have any more questions...

Cannot execute a shell script with docker command from Jenkins Pipeline step

I am using Jenkins version 2.121.1 with Pipeline On MacOS-HighSierra.
I've a shell script called build_docker_image.sh that builds a docker image using the following command:
docker build -t test_api:1 -f test-dockerfile
test-dockerfile is a Dockerfile and has instructions to build an image.
From CLI the whole set up works!
However, when I run it from Jenkins server Pipeline context, it is failing at the above line with an error: docker: command not found
The step that triggers from Jenkins server is simple. Call the script:
stage ('Build-Docker-Image') {
steps {
sh '/path/to/build-docker_image.sh'
}
}
In Jenkinsfile, I made sure the $PATH is including the path to Docker.
The issue was that I was appending the actual docker application like this /Applications/Docker.app/Contents/Resources/bin/docker, instead of the directory /Applications/Docker.app/Contents/Resources/bin

Why can't Jenkins build script change to a directory?

I am trying to build a jenkins job with below lines of code and it is failing.
cd ../../../../../
cd /home/skasturi/sdk/
cp -pr 8.0_Sprint2 8.0_Sprint3
Console output of jenkins build:
Building in workspace /var/lib/jenkins/workspace/SMGR_SDK
[SMGR_SDK] $ /bin/sh -xe /tmp/jenkins3461562069624051922.sh
+ cd ../../../../../
+ cd /home/skasturi/sdk/
/tmp/jenkins3461562069624051922.sh: line 3: cd: /home/skasturi/sdk/: Not a directory
Build step 'Execute shell' marked build as failure
Finished: FAILURE
What might be the cause of the observer behavior?

Resources