dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
prj-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed too long password for mysql. Fixed no enable-drupal target. Fixed no email...
[prj-utils.git]
/
prj-site-make
diff --git
a/prj-site-make
b/prj-site-make
index 741783cf35f7513b52f56267ceaf6618a9dfb16b..f1009016ebb338abfd9e32a188f0400b8978bd82 100755
(executable)
--- a/
prj-site-make
+++ b/
prj-site-make
@@
-1,10
+1,8
@@
-#email="dlugolecki.rafal@gmail.com"
-sql_user = rdlugoleck_${name}
-# this allows me to evaluate pwgen result to value
-$(eval sql_password := $(shell pwgen -1 -s 50))
+email="example@example.com"
apache_sites = '/etc/apache2/sites-available'
project_dir = `pwd`/${name}
apache_sites = '/etc/apache2/sites-available'
project_dir = `pwd`/${name}
-host = ${name}.localhost
+host = ${name}
+host_conf = ${name}.conf
help:
echo "Usage: prj-site OPERATION NAME [type] "
help:
echo "Usage: prj-site OPERATION NAME [type] "
@@
-37,13
+35,13
@@
create-permissions: create-directories
echo "> Setting group permissions of {project}/www to www-data, need root permissions to do that."
sudo chgrp -R www-data ${project_dir}/www
echo "> Setting group permissions of {project}/www to www-data, need root permissions to do that."
sudo chgrp -R www-data ${project_dir}/www
-${apache_sites}/${host}:
+${apache_sites}/${host
_conf
}:
echo "> Creating project's site configuration"
echo "> Creating project's site configuration"
- sudo cp ${apache_sites}/dummy.
localhost ${apache_sites}/${host
}
+ sudo cp ${apache_sites}/dummy.
conf ${apache_sites}/${host_conf
}
-create-vhost: ${apache_sites}/${host
}
- sudo sed -e "s/dummy/${name}/g" -i ${apache_sites}/${host}
- sudo sed -e "s@/var/www/${name}@${project_dir}/www@" -i ${apache_sites}/${host}
+create-vhost: ${apache_sites}/${host
_conf}
+ sudo sed -e "s/dummy/${name}/g" -i ${apache_sites}/${host
_conf
}
+ sudo sed -e "s@/var/www/${name}@${project_dir}/www@" -i ${apache_sites}/${host
_conf
}
sudo a2ensite ${host}
sudo service apache2 reload
sudo a2ensite ${host}
sudo service apache2 reload
@@
-54,14
+52,14
@@
remove-directories:
sudo rm -r ${project_dir}
remove-vhost:
sudo rm -r ${project_dir}
remove-vhost:
- if test -f ${apache_sites}/${host}; then \
+ if test -f ${apache_sites}/${host
_conf
}; then \
echo "> Removing apache configuration file"; \
echo "> Removing apache configuration file"; \
- sudo rm ${apache_sites}/${host}; \
+ sudo rm ${apache_sites}/${host
_conf
}; \
fi;
enable: enable-${type}
echo "[+] Enabling ${name}"
fi;
enable: enable-${type}
echo "[+] Enabling ${name}"
- if test -f
/etc/apache2/sites-available/${host
}; then \
+ if test -f
${apache_sites}/${host_conf
}; then \
echo "> Enabling project's vhost..."; \
sudo a2ensite ${host}; \
sudo service apache2 reload; \
echo "> Enabling project's vhost..."; \
sudo a2ensite ${host}; \
sudo service apache2 reload; \
@@
-103,7
+101,7
@@
symfony2: create-directories create-vhost
cd ${project_dir} && php composer.phar install
chmod -R 777 ${project_dir}/app/cache
chmod -R 777 ${project_dir}/app/logs
cd ${project_dir} && php composer.phar install
chmod -R 777 ${project_dir}/app/cache
chmod -R 777 ${project_dir}/app/logs
- sudo sed -e "s@${project_dir}/www@${project_dir}/web@" -i ${apache_sites}/${host}
+ sudo sed -e "s@${project_dir}/www@${project_dir}/web@" -i ${apache_sites}/${host
_conf
}
create-drupal: create-directories
echo "[+] Drupal installation begins..."
create-drupal: create-directories
echo "[+] Drupal installation begins..."
@@
-127,6
+125,8
@@
create-drupal: create-directories
cd ${project_dir}/www && drush en seven toolbar shortcut -y
cd ${project_dir}/www && drush vset admin_theme seven
cd ${project_dir}/www && drush en seven toolbar shortcut -y
cd ${project_dir}/www && drush vset admin_theme seven
+enable-drupal:
+
purge-drupal:
echo "> Removing SQL user"
sudo mysql --defaults-file=/etc/mysql/debian.cnf -e "DROP USER '${sql_user}'@'localhost';"
purge-drupal:
echo "> Removing SQL user"
sudo mysql --defaults-file=/etc/mysql/debian.cnf -e "DROP USER '${sql_user}'@'localhost';"