cat $0 printf "==================================================" printf "\nOutput from running above script:\n\n\n" # Upgrade the system and install developer tools. pacman --noconfirm -Sy pacman pacman --noconfirm -Syu pacman --noconfirm -Sy base-devel # Install language and language packaging system. pacman --noconfirm -Sy python curl -O http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg bash setuptools-0.6c11-py2.6.egg pacman --noconfirm -Sy ruby # Install gems. gem install do_sqlite3 gem install datamapper # Install bazaar. easy_install bzr easy_install paramiko # Download code to run. bzr branch sftp://sshuser:sshpassword@example.com/path/to/bzr-repos/simcode # Create a directory to store results. mkdir results # Execute the code. cd simcode MODELS=models/*.rb for m in $MODELS do OUTFILE=`basename $m` printf "\nRunning file: $m\n\n" ruby $m > ../results/$OUTFILE.out mkdir ../results/$OUTFILE.dir mv results/* ../results/$OUTFILE.dir/ done cd .. # Copy results of script.out into results. # Assuming you run this script with: # bash conf.sh &> script.out &; tail -f script.out cp script.out results/ # Bundle files we want to save for export. export FILENAME=results-`uuidgen`.tgz tar -czvf $FILENAME results # Install cadaver for WebDAV. pacman --noconfirm -Sy cadaver # Create a config file for cadaver. cat < ~/.netrc machine www.example.com login webdabuser password webdavpassword EOF # Upload the tgz of results to remote webdav store. echo "put $FILENAME" | cadaver http://www.example.com/webdav/