Skip to content

Pull deployment script for Windows

Prerequisites

  • Application use Java Service Wrapper.

  • Packaged as zip file

Download script - pseudo code

  1. Input version to deploy. Latest = "latest" Command line input windows
  2. Find latest version in repository Find latest version in NEXUS repo
  3. Compare version installed with latest. Text compare in Windows
    1. Do nothing (print info message to screen) if file name and file size is identical to current.
  4. Download zip file from Nexus Download latest Artifact from Nexus (/)
  5. Unzip
  6. Copy configuration folders from old service.
  7. Execute stop and uninstall service
  8. Execute install and start scripts/windows service see Download latest Artifact from Nexus
  9. Print success message with info about service name, port, jmx port, logs folder
  10. Improvement: stop new service and start previous service if start up failed (check exit code)

Full script

Download script - implementation tips

  • Use a version control system

    • installation scripts
    • installation property files
    • binaries (curl, wget, etc)
    • config_override
  • A single generic installation script for all installations.

  • A separate installation property file per installation

Download

Use wget or curl, should rely only on a single file, not on any installation. It is also possible to use powershell - http://superuser.com/questions/362152/native-alternative-to-wget-in-windows-powershell.

Resources

http://www.vectorsite.net/tsbatch.html

https://docs.sonatype.com/display/SPRTNXOSS/Nexus+FAQ#NexusFAQ-Q.HowcanIretrieveasnapshotifIdon%27tknowtheexactfilename%3F

http://mytechscratchpad.blogspot.no/2012/03/download-latest-snapshot-from-nexus.html

Downloading artifacts from Nexus with bash

Windows XP batch help

http://en.wikibooks.org/wiki/Guide_to_Windows_commands

http://www.askapache.com/windows/advanced-batch-scripting.html#PARAMTESTHELP_show_params_returns_CALLer