Skip to content

lfit/releng-nexus-upload

Repository files navigation

Nexus file upload shell script

Script to automate the upload of files to Nexus servers

Getting started

Make sure the script is executable on your system

chmod a+x nexus-upload.sh

Help is available directly from the command-line:

./nexus-upload.sh -h
Usage: nexus-upload.sh [-h] [-u user] [-p password] [-s upload-url] [-e extension] [-d folder]
 -h  display this help and exit
 -u  username (or export variable NEXUS_USERNAME)
 -p  password (or export variable NEXUS_PASSWORD)
 -s  upload URL (or export variable NEXUS_URL)
     e.g. https://nexus3.o-ran-sc.org/repository/datasets/
 -e  file extensions to match, e.g. csv, txt
 -d  local directory hosting files/content to be uploaded

You can set the username, password and URL for the nexus server by exporting the variables:

  • NEXUS_URL (mandatory, must be set or -s flag supplied with a valid URL)
  • NEXUS_USERNAME (if not set or supplied with -u flag, will be prompted)
  • NEXUS_PASSWORD (if not set or supplied with -p flag, will be prompted)

A local folder containing files to upload can be supplied using the optional "-d" flag. If this is not set then the current directory will be used, but caution should be exercised, as if no file extensions are specified, then the script itself may be matched by the default wildcard (*) file matching behaviour. To prevent this, specify an extension restricting the files to be uploaded using the "-e" flag. Alternatively, put the files into a local folder, and sepficy the folder location using the "-d" flag.