asd
This commit is contained in:
parent
994a3297c9
commit
3a060d5477
10
create.sh
10
create.sh
@ -3,6 +3,8 @@
|
||||
name="$1"
|
||||
sshURL="$2"
|
||||
|
||||
echo "starting $sshURL on $name"
|
||||
|
||||
eval "$(ssh-agent -s)"
|
||||
ssh-add /root/.ssh/id_github_rsa
|
||||
mkdir /var/www/gitwrapper/$name
|
||||
@ -17,15 +19,19 @@ git clone $sshURL .
|
||||
|
||||
./scripts/setup.sh
|
||||
|
||||
source env/bin/activate
|
||||
|
||||
cp /var/www/local_settings.py project/settings/local_settings.py
|
||||
echo "BRANCH = '$name'" >> project/settings/local_settings.py
|
||||
|
||||
echo "checking out to prod for set up"
|
||||
git checkout prod
|
||||
|
||||
python manage.py createcachetable
|
||||
python3 manage.py createcachetable
|
||||
python3 manage.py migrate
|
||||
python3 manage.py loaddata /var/www/django.json
|
||||
|
||||
echo "checking out to $name for set up"
|
||||
git checkout $name
|
||||
|
||||
./scripts/setup.sh
|
||||
@ -34,6 +40,8 @@ python3 manage.py collectstatic --noinput
|
||||
python3 manage.py migrate
|
||||
chmod 777 db.sqlite3
|
||||
|
||||
echo "creating apache VirtualHost file"
|
||||
|
||||
echo "<VirtualHost *:80>" > /etc/apache2/sites-enabled/$name.conf
|
||||
echo " ServerName $name.staging.bytedev.co" >> /etc/apache2/sites-enabled/$name.conf
|
||||
echo " Alias /static /var/www/gitwrapper/$name/staticfiles" >> /etc/apache2/sites-enabled/$name.conf
|
||||
|
@ -10,18 +10,21 @@ var install_dir = '/var/www/gitwrapper/'
|
||||
|
||||
var calls = {
|
||||
create: function(req, res, name, sshURL){
|
||||
console.log("create =========================");
|
||||
return exec('bash /var/www/gitdeploy/create.sh '+name+' '+sshURL, function(err, stdout, stderr){
|
||||
console.log(err, stdout, stderr);
|
||||
return res.json({ title: stdout });
|
||||
});
|
||||
},
|
||||
update: function(req, res, name, sshURL){
|
||||
console.log("update =========================");
|
||||
return exec('bash /var/www/gitdeploy/update.sh '+name+' '+sshURL, function(err, stdout, stderr){
|
||||
console.log(err, stdout, stderr);
|
||||
return res.json({ title: stdout });
|
||||
});
|
||||
},
|
||||
delete: function(req, res, name, sshURL){
|
||||
console.log("delete =========================");
|
||||
return exec('bash /var/www/gitdeploy/delete.sh '+name+' '+sshURL, function(err, stdout, stderr){
|
||||
console.log(err, stdout, stderr);
|
||||
return res.json({ title: stdout });
|
||||
|
Loading…
x
Reference in New Issue
Block a user