Skip to content

Instantly share code, notes, and snippets.

@mariusavram91
Last active January 19, 2016 17:57
Show Gist options
  • Save mariusavram91/c4f3a652f6bcd0e322a2 to your computer and use it in GitHub Desktop.
Save mariusavram91/c4f3a652f6bcd0e322a2 to your computer and use it in GitHub Desktop.
sh script to check versions for all capistrano stages
#!/bin/sh
#This goes in your devclass/classnew or devclass/classis directory
#To execute it: sh check_cap_versions.sh or ./check_cap_versions.sh,
# if you have +x mode
STAGES=config/deploy
for file in `ls -a $STAGES -I sample.rb -I vagrant.rb -I local.rb -I localhost.rb| grep \.rb$`
do
if [ -n "$file" ]; then
server=`cap ${file%%.*} info:sshconfig`
echo "
------$file------ $server
"
cap ${file%%.*} info:version
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment