ard

Archiva Release Downloader

Usage no npm install needed!

<script type="module">
  import ard from 'https://cdn.skypack.dev/ard';
</script>

README

ARD - Archiva Release Downloader

Usage

Downloads the latest release mstv-panasonic artifact

ard dl com.xumo.myspacetv mstv-panasonic latest

Downloads the 1.1.8 version artifact

ard dl com.xumo.myspacetv mstv-panasonic 1.1.8

Downloads the latest snapshot version artifact

ard dl com.xumo.myspacetv mstv-panasonic snapshot

Downloads the specific snapshot version artifact

ard dl com.xumo.myspacetv mstv-panasonic 1.1.9-SNAPSHOT

Downloads and extracts in the same operation

ard dlx com.xumo.myspacetv mstv-panasonic 1.1.10

Config

ard.json in your home dir or cwd = profit!

{
  "url": "http://archiva.xumo.com:9081",
  "authRequired": true
  "username": "developers",
  "password": ""
}

Module usage

var ard = require('ard');

ard.config('./ard.json');

// or embed directly

ard.config({
  "url": "http://archiva.xumo.com:9081",
  "authRequired": true
  "username": "developers",
  "password": ""
});

ard.package('com.xumo.myspacetv');
ard.artifact('mstv-panasonic');

// ard.version('1.1.10') // to extract an already downloaded WAR file

ard.download('snapshot', function(err, path) {
  if (err) {
    console.log('Error: ' + err);
    return;
  }

  ard.extract('directory', function(err) { // requires 'unzip' exec
    // will unzip war to %artifact%-%version%, if dir not specified
    if (err) {
      console.log(err);
    }
  });
  
  console.log(path); // /tmp/mstv-panasonic-1.1.9-SNAPSHOT.war
});

Credits

Robin Duckett <rduckett@xumo.com>