From 8f4a080962e5ade1e845d64a66f0e0c3dc8ab34f Mon Sep 17 00:00:00 2001 From: Ludo Stellingwerff Date: Fri, 9 Nov 2018 11:54:35 +0100 Subject: [PATCH] More documentation --- README.md | 32 +++++++++++++++++++++++++++++++- installAsset.js | 2 +- manifest2label.js | 2 +- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 07002f9..a4e7a31 100644 --- a/README.md +++ b/README.md @@ -171,8 +171,38 @@ label2manifest [] [] Through the additional images you can create a multiple image asset, but the meta-information should be placed as labels only in the first image of the set. For these cases it is expected that those labels contain a series of: _vf-OS.compose.1.*_ labels to configure these extra images. (and _vf-OS.compose.2.*_ for the second extra image, etc.) -#### Install asset locally +The script will create a zipfile in the folder where you run the script, called *imageid.zip*, e.g. *asset-c.zip*. +#### Deploy asset to local quarantine registry +In the final setup of the platform, all assets will be installed from the vf-OS Store, by downloading, checking, intermediate storing in the quarantine registry, and installation of the asset into the local docker environment. This is a complex, multi-step process that is annoying and slow during development testing. +To ease this for developers, a script is provided that bypasses many of these steps and can deploy the asset from the zipfile, directly into the quarantine repository. This script is called *manifest2label.js* to mimic it's mirror counterpart. + +```shell +user@host:~/platform$ manifest2label.js $PWD/asset-c.zip true true +Read manifest: { binaryFile: 'asset-c', + 'vf-OS': 'true', + depends: 'asset-b', + icon: 'img/3.png' } +Images: [ [ 'asset-c:latest' ] ] +Labels from:asset-c:latest { 'vf-OS': 'true', + 'vf-OS.depends': 'asset-b', + 'vf-OS.icon': 'img/3.png' } +Cleaning up behind me. +Done cleanup. +Also cleaned images. +``` +There are four parameters to this script: +``` shell +manifest2label [] [] [] +``` +* fullPath2zipfile: The zipfile to unpack, NOTE: Must be a full path at this time. (see example to use the current working dir.) +* deleteArtifacts: Should the script cleanup the unpackaged image and manifest.json file it created after uploading? Simple *true* or *false* parameter, defaults to *false*. +* push2Repos: Should the script push the image from the local Docker daemon to the quarantine registry as well? Simple *true* or *false* parameter, defaults to *false*. +* registryHost: The hostname of the quarantine registry, defaults to *localhost* which never needs to change. #### Deploy asset to vf-OS Store +TODO + +#### Install asset locally + diff --git a/installAsset.js b/installAsset.js index 0939203..a90b0bc 100755 --- a/installAsset.js +++ b/installAsset.js @@ -101,7 +101,7 @@ new Promise((resolve, reject) => { } }) } - } catch (e) { console.log('could parse vf-OS.compose.0.socket', e) } + } catch (e) { console.log('Had trouble parsing the labels!', e) } // console.log(JSON.stringify(labels)) // console.log(JSON.stringify(result)) diff --git a/manifest2label.js b/manifest2label.js index c4e8998..42aa5de 100755 --- a/manifest2label.js +++ b/manifest2label.js @@ -13,7 +13,7 @@ const pushToRepository = process.argv[4] ? JSON.parse(process.argv[4]) : false const registerHost = process.argv[5] ? process.argv[5] : 'localhost' if (!zipFile) { - console.log('Call this script as: ' + process.argv[1] + ' ') + console.log('Call this script as: ' + process.argv[1] + ' [] [] []') process.exit(1) }