Jenkins pipeline send zip files in a website - jenkins

I would like to send my results from Jenkins to another website. The files are available in zip. Is there anybody who can give advice, what can i use to realize this ? I wrote my pipeline in groovy
Thank you

You can use curl in the jenkins job to upload the files.

Related

Send file from Jenkins to Discord through Pipelin

I need help about sending file (log file) from Jenkins to Discord using Pipeline. I have seen there is an option on post-build action using Freestyle project, but for this project I need to use Pipeline.
Thank you in advance
I have read this site https://plugins.jenkins.io/discord-notifier/ but still got no clue how to send log file to Discord.

Jenkins pipeline to return results-file after build

I'm running a few tests in my pipeline, results are written to a few .txt files.
Is it possible to upload the .txt files to the jenkins job?
Meaning that the person running the pipeline will receive the results in the browser, and simply download them.
note - junit could have provide a suitable solution, but im not working with XML but with simple txt files
use archiveArtifacts 'myfile.txt'
https://jenkins.io/doc/pipeline/tour/tests-and-artifacts/
Also have a look at the links shared by Dibakar.
If you want to go further, I would recommend to record your test results on another system than jenkins because usually we keep a limited numbers of builds on jenkins. A standard solution is to use sonarqube (there is a Jenkins plugin to help you upload test result on sonar) but you could also upload your results to a database like influxdb (with jenkins influxdb plugin)

Get build steps using Jenkins Pipeline REST API

I would like to ask is there any way to query run time build steps by using Jenkins pipeline REST API? I refer to this link https://github.com/jenkinsci/pipeline-stage-view-plugin/tree/master/rest-api and it seems like I can't get a run time build steps command line that I configure for Jenkins pipeline job.
Any suggestions?
It seems there is no possibility to get this information via the REST API. I found a solution somewhere.
With
http://Serverurl/job/jobname/config.xml
you can download the config file and parse the XML. Doing it with PowerShell and it's working fine.

Exporting code in Jenkins file for build pipeline

I have couple of build pipelines configured in Jenkins. Is there a way to export them into Jenkinsfiles so that it can be checked in source code (I want to use it pipeline as a code).
Thanks!
You can use the pipeline as code steps to add a Jenkinsfile to your codebase. Please refer the below link.
https://jenkins.io/solutions/pipeline/
You can also look out for Declarative Pipeline as well.
https://jenkins.io/blog/2017/02/03/declarative-pipeline-ga/
If you have already have the pipeline steps, please create a Jenkinsfile(by copying the contents of the pipeline code) at the root folder of your repo and create a Pipeline/MultiBranch Pipeline/Github Organization job based on your convenience.
Please let me know if you would require further information on the same.

Got different zip structure from artifacts from Jenkins

I have been using Cloudbees Jenkins as a service and I'm trying to setup my local Jenkins which I got different results from Cloudbees Jenkins.
If I use this curl command to get the latest successful artifact.
curl http://endpoint.cloudbees.com/job/jobname/20/artifact/project_name/build/distributions/*zip*/distributions.zip
I got a zip file with this structure.
distributions/my_artifact.zip
But if I do the same command on my local Jenkins
curl http://localhost:8080/job/jobname/20/artifact/project_name/build/distributions/*zip*/distributions.zip
I just got
my_artifact.zip
which one is correct? And why they are different? I actually want my local Jenkins to produce the same results as as cloudbees.
I'm using Jenkins 1.534.
The behavior on the CloudBees hosted Jenkins is the traditional and intended behavior. It looks like you found a bug in development builds of Jenkins, which I filed as JENKINS-19947.
http://jenkins-ci.org/changelog
Read it.
* As of 1.532 download of artifact ZIPs was broken. (issue 19752)

Resources