Coder Social home page Coder Social logo

artifact-promotion-plugin's Introduction

Artifact Promotion Plugin

This is a simple plugin to promote artifacts. This is done on the artifact repository server and due to this the promotion process is specific to the used repository server.

In the first step, this plugin will support Sonatype Nexus OSS.

Artifact Promotion in Sonatype Nexus OSS

Nexus OSS doesn't support staging repositories like Nexus Pro. And, in addition, it does't support custom metadata. Due to this, an artifact promotion could only be handled by moving an artifact from a staging repository into a 'release' repository (... or however you want to call your stage).

Some guys say this is an anti pattern like in this blog (http://www.alwaysagileconsulting.com/pipeline-antipattern-mutable-binary-location/) but there is no chance to do it the right way with Nexus OSS.

Usage

The plugin is in development and should not be used currently for production environments as many parts are subject to change. Especially the support for multiple repository servers will change the GUI and result in some internal refactorings.

Job DSL

The plugin adds an extension to the Job DSL plugin to allow defining Artifact Promotion build steps in Job DSL scripts. The extension can be used with the Job DSL plugin version 1.35 or higher.

job {
	steps {
	    artifactPromotion {
	      groupId(String groupId)
	      artifactId(String artifactId)
	      version(String version)
	      extension(String extension = "jar")
	      stagingRepository(String url, String user, String password, boolean skipDeletion = false)
	      releaseRepository(String url, String user, String password)
	      debug(boolean debug)
	    }
	}
}

Creates a build step to promote an artifact from a staging to a release repository.

job('example') {
	steps {
		// assumes default repo system (NexusOSS)
	    artifactPromotion {
	      groupId("com.example.test")
	      artifactId("my-artifact")
	      version("1.0.0")
	      extension("zip")
	      stagingRepository("http://nexus.myorg.com:8080/content/repositories/release-candidates", "foo", "s3cr3t")
	      releaseRepository("http://nexus.myorg.com:8080/content/repositories/releases", "foo", "s3cr3t")
	    }
	}
}

Hint: If the first Build of the generated Job runs into a java.lang.ClassNotFoundException: org.jenkinsci.artifactpromotion.NexusOSSPromotor error you should go into the (generated) project configuration and save the project once.

Contributions

Please feel free to contribute for other repository servers like

  • Nexus Pro
  • Artifactory and Aertifactory Pro
  • Apache Archiva

Don't hesitate to come up with your suggestions.

Useful links

artifact-promotion-plugin's People

Contributors

hcguersoy avatar timizki avatar

Watchers

 avatar

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.