项目作者: akinom

项目描述 :
command line scripts accessing and modifying DSpace content
高级语言: Ruby
项目地址: git://github.com/akinom/dspace-cli.git
创建时间: 2016-03-08T00:15:36Z
项目社区:https://github.com/akinom/dspace-cli

开源协议:

下载


dpace-cli

This repo contains command line sripts that report on as well as modify the content of a DSpace instance.
Scripts are impemented with the help of the jrdspace gem.

Most of scripts here are actively used at Princeton University; some are tailored to the specific Princeton needs.

Installation

Prerequisite

Installation

clone this repository

Install the gems used by the scripts:

  1. bundle install

Usage

set the DSPACE_HOME environment variable to point to the installation directory of your DSpace repository

run a scripts - works only in this directory

  1. dspace script_file

Scripts either prompt for input or have a —help option

Usage with Docker

There is a Docker image on docker hub, but I do not promise to keep it up with this repo;

If you want to add your own scripts or do changes to the scripts here, you need to build your own image.

Build and run your own image

  1. # cd into the cloned code directory for thsi repo
  2. # clone dspace-jruby
  3. git clone https://github.com/akinom/dspace-jruby
  4. # build an image and name it dspace-cli
  5. docker build -t dspace-cli .
  6. # run a container based on the image
  7. # this maps the local /dspace diretory onto /dspace in the container
  8. # it also maps the current directory on the host to /dspace/cli in the container
  9. # it then starts the given jruby script, eg netid/create.rb
  10. docker run -v '/dspace:/dspace' -v `pwd`:/dspace-cli dspace-cli netid/create.rb
  11. # to run the inertace dspace console
  12. docker run -it -v '/dspace:/dspace' -v $PWD:/dspace-cli dspace-cli dspace-jruby/bin/idspace
  13. # to connect with a interactive bash shell
  14. docker run -it -v '/dspace:/dspace' -v `pwd`:/dspace-cli dspace-cli
  15. # once the shell starts you can run any of the scripts interactively, for example
  16. > ./print.rb handel1 handle2 handle3

Miscellaneous docker commands

  1. docker save -o dspace-cli.docker dspace-cli
  2. docker load -i dspace-cli.docker
  3. @ with given user id
  4. docker run -it -v '/dspace:/dspace' -v `pwd`:/dspace-cli -u 67381 dspace-cli bash
  5. # leave containers running by Ctrl-C Ctrl-D out of bash then restart
  6. docker exec -it dspace-cli bash

Write your Own

Have a look at the jrdspace gem.
Feel free to send an email to akinom if you ned help or find bugs.