Storing Maven Artifacts from a Jenkins Job in a Bucket Volume

Describes how to use the HPE Ezmeral Data Fabric Object Store as a back end for storing Jenkins information.

This page describes how to use a Minio plugin to copy Maven artifacts generated as part of a Jenkins job into a bucket within the HPE Ezmeral Data Fabirc Object Store.

Prerequisites

The following procedure requires a Data Fabric cluster running release 7.0.0 or later and a Jenkins server with network access to the Data Fabric cluster.

Installing the Minio Plug-in and Configuring Access

  1. On the Jenkins server, install the following Minio plug-in. Use the How to install instructions provided on the download page:

    Minio PluginVersion1.3.3-rc93.9e92f846d4cf

  2. On the Jenkins server node, use keytool to import the chain-ca.pem certificate (opt/mapr/conf/ca/chain-ca.pem) into the Java key store as follows:
    <JAVA_HOME>/bin/keytool -noprompt -importcert -file /opt/mapr/conf/ca/chain-ca.pem -alias maprca -keystore  <JAVA_HOME>/lib/security/cacerts -storepass changeit
  3. Verify that the certificate was added successfully to the Java key store:
    keytool -list -keystore /usr/lib/jvm/jre-11-openjdk-11.0.13.0.8-1.el8_4.x86_64/lib/security/cacerts | grep -i 'maprca'
    Warning: use -cacerts option to access cacerts keystore
    Enter keystore password:  changeit
    maprca, Jun 27, 2022, trustedCertEntry,
  4. Add the Minio credentials to the Jenkins credential manager. The credentials are the access key and secret key generated in the object store either from MCS or from the mc command line. To generate the keys, see Create Access and Secret Keys.
  5. Configure the Jenkins job (type Maven Artifact) in the post-build actions step as shown below:
    • HOST
    • Minio Credentials
    • Provide Bucket Name

Running and Verifying the Jenkins Job

  1. Run the Jenkins job???
  2. On job completion, artifacts are copied to a bucket and can be viewed in the job console log. For example:
    Storing [Dockerfile] in bucket [testbucket1] , mime [application/octet-stream] Storing [README.md] in bucket [testbucket1] , mime 
    [text/markdown] Storing [pom.xml] in bucket [testbucket1] , mime [text/xml] Storing[pom.xml] in bucket [testbucket1] , mime [text/xml] Storing 
    [Greeter.java] in bucket [testbucket1] , mime [text/plain] Storing [index.apt] in bucket [testbucket1] , mime [application/octet-stream] Storing 
    [TestGreeter.java] in bucket [testbucket1] , mime [text/plain] Storing [pom.xml] in bucket [testbucket1] , mime [text/xml] Storing [web.xml] in bucket 
    [testbucket1] , mime [text/xml] Storing [index.jsp] in bucket [testbucket1] , mime [application/octet-stream]
  3. Verify that the artifacts are published inside the specified folder and bucket. For example:
    $ /opt/mapr/bin/mc lsmyalias/testbucket1/artifactfolder-1
    
    [2022-06-28 06:45:38 PDT]   133B Dockerfile
    [2022-06-28 06:45:38 PDT]   266B Greeter.java
    [2022-06-28 06:45:38 PDT]    38B README.md
    [2022-06-28 06:45:38 PDT]   739B TestGreeter.java
    [2022-06-28 06:45:38 PDT]    19B index.apt
    [2022-06-28 06:45:38 PDT]    54B index.jsp
    [2022-06-28 06:45:38 PDT] 1.1KiB pom.xml
    [2022-06-28 06:45:38 PDT]   616B web.xml