Skip to end of metadata
Go to start of metadata

Plugin Information

View Inedo ProGet Plugin on the plugin site for more information.

The current version of this plugin may not be safe to use. Please review the following warnings before use:

This plugin integrates Inedo ProGet with Jenkins allowing Jenkins jobs to create and upload, or download and extract, universal packages.It requires ProGet version 4.0.12 or higher to work correctly.

Usage

First, you need to ensure that an api key as been configured in ProGet at ProGet > Administration > API Keys & Access Logs 

Without this the plugin will still work to a certain point but will have reduced functionality in the job configuration - i.e. you will need to fill in certain details rather than select values from a drop down list, of feeds, groups and packages.

Next, you need to go to Jenkins' system config screen to tell Jenkins where's your ProGet installation resides and the username and password of a user with permission to upload files to ProGet.

Finally, you need to add either an "ProGet Upload Package" or "ProGet Download Package" build step to your Jenkins job.

Upload Package

In it basic form, this simply require specifying the files in your work space that you'd like to package, supplying some metadata that that describes the package and the job is done.

Please consult the help text in the plugin configuration screen for more information on each setting.

There are some more advanced options that allow you to tweak the files that will be included in the package and the supply additional metadata.


Download Package

Downloads a universal ProGet package in the requested format (package, zip, or tgz) to specified folder and will optionally unpack it for you.

The environment variable PROGET_FILE will be populated with the name of the downloaded file

Please consult the help text in the plugin configuration screen for more information on each setting.

Pipeline Script

Script can be generated using the pipeline syntax snippet generator.

Scripted Pipeline Example
node {
    bat '''DEL *.TXT /Q
        DEL *.upack /Q
        ECHO Build Tag: %BUILD_TAG% > Example.txt'''
    uploadProgetPackage artifacts: 'Example.txt', feedName: 'Example', groupName: 'jenkins/pipleline', packageName: 'JenkinsPackage', version: "1.0.${BUILD_NUMBER}"
    downloadProgetPackage downloadFolder: "${WORKSPACE}", downloadFormat: 'pkg', feedName: 'Example', groupName: 'jenkins/pipleline', packageName: 'JenkinsPackage', version: "1.0.${BUILD_NUMBER}"
}
Declarative Pipeline Example
pipeline {
  agent any

  stages {
    stage('Main') {
      steps {
        bat '''DEL *.TXT /Q
            DEL *.upack /Q
            ECHO Build Tag: %BUILD_TAG% > Example.txt'''
        uploadProgetPackage artifacts: 'Example.txt', feedName: 'Example', groupName: 'jenkins/pipleline', packageName: 'JenkinsPackage', version: "1.0.${BUILD_NUMBER}"
        downloadProgetPackage downloadFolder: "${WORKSPACE}", downloadFormat: 'pkg', feedName: 'Example', groupName: 'jenkins/pipleline', packageName: 'JenkinsPackage', version: "1.0.${BUILD_NUMBER}"
      }
    }
  }
}

History

Version 1.0 (28 July, 2018)
Version 0.8 (Mar 12, 2018)
  • Add authorization for download package
Version 0.7 (Jan 15, 2017)
  • Pipeline script support
Version 0.6 (Nov 14, 2016)
  • Support running on Jenkins slaves/nodes
  • Prevent caching of requests
Version 0.4 (Oct 17, 2016)
  • Download to node
Version 0.3 (May 17, 2016)
  • Expand 'Files to package' upload variable correctly
  • Validate format version number
Version 0.2 (May 17, 2016)
  • Initial Release

2 Comments

  1. I'm having trouble setting the version name with this.  A version like 1.0.0 works fine, but a version like 1.0.%BUILD_NUMBER% does not.  As an alternative, you can use curl to do the upload.  Is the plugin code not doing environment variable substitutions?

    curl -i -X POST -H "Content-Type: application/zip" --upload-file "Output%BUILD_NUMBER%.zip" http://YOURSERVER/upack/feed-name/upload/Group/Package-Name/1.0.%BUILD_NUMBER%

     

     

    1. It already supports variable substitution, I think the problem is the syntax you've used.  Try 1.0.${BUILD_NUMBER} instead

Write a comment…