Last active
August 29, 2015 14:21
-
-
Save simplyadrian/df6d9873fc5db5cc5d77 to your computer and use it in GitHub Desktop.
bash script to install archiva
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Package requirements: archiva | |
#Archiva home directory: Recommended directory is "/mnt/storage1/" | |
if test "$RS_REBOOT" = "true" -o "$RS_ALREADY_RUN" = "true" ; then | |
logger -t RightScale "Archiva Install, skipped on a reboot." | |
exit 0 | |
fi | |
cd $ARCHIVAHOME | |
#Download archiva standalone edition. | |
wget $ARCHIVA_DOWNLOAD_URL | |
#Pull archiva standalone edition into a string. | |
ARCHIVAPACK=`ls $ARCHIVAHOME -1 2>/dev/null | grep "apache-archiva" | head -1` | |
#Unpack archiva standalone edition. | |
echo 'Unpacking Archiva server...' | |
tar xvfz $ARCHIVAPACK | |
if [ $? -eq 0 ]; then | |
echo "Archiva server unpacking done" | |
else | |
echo "Archiva server unpacking failed. Aborting installation!" | |
logger -t RightScale 'Archiva server unpacking failed. Aborting installation!' | |
exit 1 | |
fi | |
#Instantiate archiva directory | |
ARCHIVADIRECTORY=`echo ${ARCHIVAPACK} | cut -d'-' -f 1,2,3` | |
#Start archiva standalone edition server. | |
$ARCHIVAHOME/$ARCHIVADIRECTORY/bin/archiva start | |
logger -t RightScale 'Archiva server starting...' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment