Giter Club home page Giter Club logo

minio-jenkins's Introduction

Minio-Storage

This is a simple Jenkins plugin that lets you upload Jenkins artifacts to a Minio Server

Preconditions

  • A Jenkins instance. Installation instructions available here.

  • A Minio server instance. Installation instructions available here.

Build from source

  • To build the plugin, you'll need maven installed on your system. On Ubuntu you can do that using
$ sudo apt-get install mvn
  • Once maven is installed, download the source code from this repo. Then browse to the folder you downloaded the source via CLI and run the command
$ mvn clean install
  • This should create the .hpi plugin file.

Installation

  • Open Jenkins homepage. Navigate to Manage Jenkins >> Manage Plugins >> Advanced >> Upload Plugin. Select the .hpi file that you built in the previous step. Then click Upload. This will install the plugin.

  • Now let us configure the plugin. Navigate to Manage Jenkins >> Configure System >> Minio upload configuration. Enter the Minio server URL, AccessKey and SecretKey (available during Minio server installation) and click Save.

  • Next step is to configure project specific details. Open the Jenkins Job whose artifacts you want to upload to Minio. Click Configure. You'll find a new Post-build Actions called Upload build artifacts to Minio server. Select the Minio server actions and enter the relevant details.

  • Now, all the artifacts as selected under the Source field will be uploaded to your Minio server.

minio-jenkins's People

Contributors

harshavardhana avatar nitisht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minio-jenkins's Issues

File not found

I have equal configurations for standard artifact archive plugin, and minio upload plugin (see screenshot).
Artifacts get archived without problems.
Minio fails with "No such file or directory"

ERROR: Failed to upload files java.io.FileNotFoundException: /Volumes/Data/Repo/workspace/openssl_android/deploy/libcrypto.so (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at java.io.FileInputStream.<init>(FileInputStream.java:93) at org.jenkinsci.plugins.minio.MinioUploader.perform(MinioUploader.java:146) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78) at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665) at hudson.model.Run.execute(Run.java:1753) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:404)
2

Communication error - TimeoutException

I am getting TimeOutException - when i try to upload big size (+400MB) files.

ERROR: Communication error, failed to upload files
java.net.SocketTimeoutException: timeout
at okio.Okio$3.newTimeoutException(Okio.java:207)
at okio.AsyncTimeout.exit(AsyncTimeout.java:261)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:215)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:306)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:300)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:196)
at com.squareup.okhttp.internal.http.Http1xStream.readResponse(Http1xStream.java:186)
at com.squareup.okhttp.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:127)
at com.squareup.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:737)
at com.squareup.okhttp.internal.http.HttpEngine.access$200(HttpEngine.java:87)
at com.squareup.okhttp.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:722)
at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:576)
at com.squareup.okhttp.Call.getResponse(Call.java:287)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:243)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:205)
at com.squareup.okhttp.Call.execute(Call.java:80)
at io.minio.MinioClient.execute(MinioClient.java:826)
at io.minio.MinioClient.executePut(MinioClient.java:1083)
at io.minio.MinioClient.executePut(MinioClient.java:1106)
at io.minio.MinioClient.putObject(MinioClient.java:2353)
at io.minio.MinioClient.putObject(MinioClient.java:2423)
at io.minio.MinioClient.putObject(MinioClient.java:2319)
at org.jenkinsci.plugins.minio.MinioAllPathUploader.invoke(MinioAllPathUploader.java:100)
at org.jenkinsci.plugins.minio.MinioAllPathUploader.invoke(MinioAllPathUploader.java:42)
at hudson.FilePath.act(FilePath.java:998)
at hudson.FilePath.act(FilePath.java:976)
at org.jenkinsci.plugins.minio.MinioUploader.perform(MinioUploader.java:195)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:676)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:621)
at hudson.model.Run.execute(Run.java:1760)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:405)
Caused by: java.net.SocketException: Socket closed
at java.net.SocketInputStream.read(SocketInputStream.java:204)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at okio.Okio$2.read(Okio.java:139)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
... 34 more

Unable to Upload a file

I am trying to upload a text file to minio server using jenkins.I am using minio storage plugin.
I have a bucket created on my minio server with R/W access. When uploading the file its giving me the below error:-

ERROR: Build step failed with exception
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1696)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
at hudson.remoting.Channel.call(Channel.java:909)
at hudson.FilePath.act(FilePath.java:998)
at hudson.FilePath.act(FilePath.java:987)
at org.jenkinsci.plugins.minio.MinioUploader.perform(MinioUploader.java:196)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1752)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
java.lang.NullPointerException
at org.jenkinsci.plugins.minio.MinioAllPathUploader.invoke(MinioAllPathUploader.java:99)
at org.jenkinsci.plugins.minio.MinioAllPathUploader.invoke(MinioAllPathUploader.java:42)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2813)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at hudson.remoting.Engine$1$1.run(Engine.java:94)
at java.lang.Thread.run(Thread.java:748)
Build step 'Upload build artifacts to Minio server' marked build as failure
Finished: FAILURE

screen shot 2018-03-27 at 14 14 14

I have attached my jenkins job config

Support Jenkins Pipelines

Since #8 is closed, I'd like to create this new issue on the topic of proper Jenkins Pipeline support.

Use-Case:
We build our software with Jenkins Declarative Pipelines. The artifacts that are produced in the post build step are only persistent as long as the build is kept. This is where minio comes into play. We want to store build artifacts in a minio bucket.

Workaround:
#8 Already mentioned a syntax to achieve this:

Jenkinsfile:
...
post {
  success {
    step([$class: 'MinioUploader',
                         sourceFile: '*.zip',
                         bucketName: 'artifacts']) 
  }
}

Expected:

Jenkinsfile:
...
post {
  success {
    minioUpload(sourceFiles: "*.zip", bucketName: "artifacts")
  }
}

Also, it would be great to have the possibility to specify the host, accessKey and secretKey on a pipeline level (as additional parameters), so the configuration is not just a global Jenkins thing which effectively allows one Jenkins instance to only talk to one minio server.

Missing file extension

Hi
While trying to upload a .deb file to minio server, file is getting uploaded without the extension.
Best
Ashutosh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.