Skip to content

Instantly share code, notes, and snippets.

@froemken
Last active May 7, 2018 13:52
Show Gist options
  • Save froemken/fc03b3f281ed3f30cbe73106dbb0f00a to your computer and use it in GitHub Desktop.
Save froemken/fc03b3f281ed3f30cbe73106dbb0f00a to your computer and use it in GitHub Desktop.
A little shell script to update our projects composer environment
#!/bin/bash
# Remote Server
# If you don't use a SSH-Key you have to use format: user[:password]@jweilandXYZ.net
# else domainname is enough
server="jweiland124.net"
path="~/typo3cms/SCRIPTS/"
#System variables
localSsh="/usr/bin/ssh"
if [ -z "$1" ]
then
echo "You have to set the stage as first parameter like 'dev', 'stage' or 'prod'"
exit 1
fi
case "$1" in
"dev" | "development")
${localSsh} ${server} "${path}update-development.sh"
;;
"stage" | "staging")
if [ -z "$2" ]
then
echo "You have to define a package name as second argument'. F.e. jweiland/events2"
exit
fi
${localSsh} ${server} "${path}update-staging.sh $2"
;;
"live" | "prod" | "production")
if [ -z "$2" ]
then
echo "You have to define a package name as second argument'. F.e. jweiland/events2"
exit
fi
${localSsh} ${server} "${path}update-production.sh $2"
;;
*) echo "Invalid stage detected. Please use one of 'dev', 'stage' or 'prod'"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment