Skip to content

Instantly share code, notes, and snippets.

@itechGroup
Created April 14, 2011 06:21
Show Gist options
  • Save itechGroup/918987 to your computer and use it in GitHub Desktop.
Save itechGroup/918987 to your computer and use it in GitHub Desktop.
Скрипт по установке сайта на bitrix под управление системы контроля версий, включает в себя предыдущие скрипты
if test -z $1
then
echo "$0 : You must set a project name"
exit 1
else
if test -d /srv/sites/$1/www/
then
if test -d /srv/sites/$1/www/bitrix/modules/main/
then
echo 'packing site...'
/bin/bash /srv/git/bin/bitrix_tar.sh $1
fi
cd /srv/git/
mkdir $1
cd $1
git --bare init
cp ../def_rep/config ./
cd /srv/sites/$1/www/
cp /srv/git/def_rep/gitignore_bitrix ./.gitignore
git init
echo "[remote \"origin\"]" >> .git/config
echo " url = ssh://git@localhost/srv/git/$1" >> .git/config
echo ' fetch = +refs/heads/*:refs/remotes/origin/*' >> .git/config
echo "[branch \"master\"]" >> .git/config
echo " remote = origin" >> .git/config
echo " merge = refs/heads/master" >> .git/config
git add .
git commit -m 'Init commit'
git push /srv/git/$1 master:master
echo 'unpacking site...'
/bin/bash /srv/git/bin/bitrix_untar.sh $1
else
echo "There is no such a project"
exit 1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment