Skip to content

Instantly share code, notes, and snippets.

@tingletech
Last active December 14, 2015 15:39
Show Gist options
  • Save tingletech/5109201 to your computer and use it in GitHub Desktop.
Save tingletech/5109201 to your computer and use it in GitHub Desktop.

ArchivesSpace binary distribution

The .jar file distribution requires that users type a complex java command line to start the application.

Proposal: distribute a .zip file that contains the .jar as well as some wrapper scripts to start up the server.

Assumes either java 6 or java 7 is on the $PATH or %PATH%.

This is what you would get when you unpack the file:

archivesspace/
├── archivesspace.jar         # jar file version of archivesspace         
├── archivesspace.bat         # windows batch file
├── archivesspace.sh          # bash script for OS X and linux
├── config                    # directory to hold local config.rb
│   └── config.rb
├── data                      # keep application working data here
│   ├── derby
│   └── solr
├── log                       # log files from running java -jar redirected here
└── templates                 # ideally _template.erb.html could be overridden at run time

Running

The wrapper script will supply all the java command line options, set up log files.

The script should work like an init.d script.

archivesspace.sh start 

For windows, the .bat (or .cmd?) should work with RunAsService

http://stackoverflow.com/a/415453/1763984 run a batch file as a windows service

bash script for linux and OS X should use a cross platform technique to fork and detach from the tty.

nohup ./myscript 0<&- &> my.admin.log.file &

http://stackoverflow.com/a/10908325/1763984

# double background your script to have it detach from the tty
# cf. http://www.linux-mag.com/id/5981 
(./program.sh &) & 

http://stackoverflow.com/a/3430969/1763984

Upgrades

unzipping a new version on top of an old version will just update binary files, leaving data and configuration intact.

Creation

Something like:

./build/run dist:zip

should create the .zip distribution from the checked out source.

@marktriggs
Copy link

I really like this idea. The only slight unknown will be getting the templates under 'templates/' to override what's in the .jar, but I'm sure there's a way to do it.

Another nice side effect of distributing as a .zip is that we can split the gem dependencies out of archivesspace.jar and slim down the whole binary package. Currently it sits at around 100MB but that's mainly because of the gymnastics I had to pull to ship the whole lot as a single .jar file--it could definitely be much smaller. We could even pull the individual .war files out of the archivesspace.jar to make it easier for people to find them and deploy under other servlet containers if need be.

@dltj
Copy link

dltj commented Mar 11, 2013

Is the way to deal with the templates to have the application create the templates/ directory and its contents at launch if they aren't already there? That would seem to take care of the first-run issue and the on-upgrade issue.

@anarchivist
Copy link

I also like this idea and @dltj's suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment