54 lines
1.1 KiB
Bash
Executable File
54 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
toUpperCase() {
|
|
echo "$*" | tr '[:lower:]' '[:upper:]';
|
|
}
|
|
GIT_REPO=$GIT_REPO
|
|
ORGANIZATION=$ORGANIZATION
|
|
|
|
if [ "$ORGANIZATION" == "" ]; then
|
|
ORGANIZATION=format
|
|
fi
|
|
|
|
PUBLIC_PROXY=$(toUpperCase $PUBLIC_PROXY)
|
|
SMARTHOST_PROXY=$(toUpperCase $SMARTHOST_PROXY)
|
|
GIT_REPOSITORY=$GIT_REPOSITORY
|
|
HOST=$HOST
|
|
PORT=$PORT
|
|
cd /root
|
|
|
|
if [ "$PORT" == "" ]; then
|
|
PORT=20202
|
|
fi
|
|
|
|
if [ "$GIT_REPOSITORY" == "" ]; then
|
|
GIT_REPOSITORY=git.format.hu
|
|
fi
|
|
|
|
if [ "$HOST" == "" ]; then
|
|
HOST=git.format.hu
|
|
fi
|
|
|
|
sed -i "s/GIT_REPOSITORY/$GIT_REPOSITORY/g" /root/.ssh/config;
|
|
sed -i "s/HOST/$HOST/g" /root/.ssh/config;
|
|
sed -i "s/PORT/$PORT/g" /root/.ssh/config;
|
|
|
|
# Check git repository permissions"
|
|
|
|
if [[ "$PUBLIC_PROXY" == "YES" || "$PUBLIC_PROXY" == "TRUE" ]]; then
|
|
PROXY_TYPE=public-proxy;
|
|
fi
|
|
|
|
if [[ "$SMARTHOST_PROXY" == "YES" || "$SMARTHOST_PROXY" == "TRUE" ]]; then
|
|
PROXY_TYPE=smarthost-proxy" "$PROXY_TYPE;
|
|
fi
|
|
|
|
if [ "$PROXY_TYPE" == "" ] ; then
|
|
echo "No proxy type deployment defined, exiting."
|
|
exit;
|
|
fi
|
|
|
|
sh /deploy.sh
|
|
|
|
echo "Successfully deployed $PROXY_TYPE"
|