nexus-push
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
Artifactory plugin for pushing artifacts to A Nexus Staging Repository (for example, oss.sonatype.org). 1. Setup: 1.1. Place this script under ${ARTIFACTORY_HOME}/etc/plugins. 1.2. Place profile file under ${ARTIFACTORY_HOME}/etc/stage. Profile file should be a Java properties file and contain 3 mandatory parameters: stagingUrl, stagingUsername, stagingPassword. The only optional parameter currently supported is comma separated list of exclusions in form of ant fileset patterns; files, matched by those patterns won't be staged. Example for local Nexus install with default credentials: stagingUrl=http://localhost:8081/nexus stagingUsername=admin stagingPassword=admin123 # Comma separated exclusions (using Ant pattern format); matched files won't be staged exclusions=**/*.zip, **/*.tar.gz 2. Execute POST request authenticated with Artifactory admin user with the following parameters separated by pipe (|): 2.1. 'stagingProfile': name of the profile file (without the 'properties' extension). E.g. for profile saved in ${ARTIFACTORY_HOME}/etc/stage/sample.properties the parameter will be profile=sample 2.2. Query parameters can be one of the two: 2.2.1. By directory: defined by parameter 'dir'. The format of the parameter is repo-key/relative-path. It's the desired directory URL just without the base Artifactory URL. E.g. dir=lib-release-local/org/spacecrafts/spaceship-new-rel/1.0 2.2.2. By build properties: any number of 'property=value1,value2,valueN' pairs are allowed, applying "AND" clause both on properties and on property values, where the 'property' is the full name of Artifactory property (inc. set name). All artifacts with combination of those properties will be pushed. E.g. build.name=spaceship-new-rel|build.number=143 2.3. 'close': whether the staging repository should be closed or not. Boolean expression, true by default - the repository will be closed. 3. Examples of the request using CURL: 3.1. Query by directory, upload only (without closing): curl -X POST -v -u admin:password "http://localhost:8090/artifactory/api/plugins/execute/nexusPush?params=stagingProfile=sample|close=false|dir=lib-release-local%2Forg%spacecrafts%2Fspaceship-new-rel%2F1.0" 3.2. Query by properties: curl -X POST -v -u admin:password "http://localhost:8090/artifactory/api/plugins/execute/nexusPush?params=stagingProfile=sample|build.name=spaceship-new-rel|build.number=143"