This repository has been archived by the owner on Nov 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage.json
46 lines (46 loc) · 2.99 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"name": "drop",
"version": "1.0.0",
"description": "Vagrant environment for new and existing Drupal projects.",
"config": {
"ssh_user": "root",
"ssh_port": "22",
"ssh_ip": "YOUR_SERVER_IP",
"ssh_dir": "/var/www/WEBSITE_DIR/",
"ssh_exclude": "--exclude=node_modules --exclude=*.sql --exclude=*.sql.gz",
"local_url": "http://drop.local/",
"prod_url": "http://WEBSITE.COM/",
"restore_db_file": "latest"
},
"scripts": {
"create": "npm run dump:prod; npm run sync:htdocs; npm start; npm run uli; vagrant ssh",
"start": "restore=$npm_package_config_restore_db_file vagrant up",
"d7": "site=d7 vagrant up",
"d8": "site=d8 vagrant up",
"sync:info": "ssh -tp $npm_package_config_ssh_port $npm_package_config_ssh_user@$npm_package_config_ssh_ip \"cd $npm_package_config_ssh_dir; du -hd2 $npm_package_config_ssh_exclude | sort -h\"",
"sync:htdocs": "rsync -avze \"ssh -p $npm_package_config_ssh_port\" $npm_package_config_ssh_user@$npm_package_config_ssh_ip:$npm_package_config_ssh_dir www/htdocs $npm_package_config_ssh_exclude;",
"sync:db": "ssh -tp $npm_package_config_ssh_port $npm_package_config_ssh_user@$npm_package_config_ssh_ip \"cd $npm_package_config_ssh_dir; drush sql-dump --gzip > ~/latest.sql.gz;\"; rsync -avze \"ssh -p $npm_package_config_ssh_port\" $npm_package_config_ssh_user@$npm_package_config_ssh_ip:~/latest.sql.gz www/init/backup --remove-source-files; vagrant ssh -c \"cd /usr/share/nginx/htdocs; drush -y sql-drop;gunzip -c /usr/share/nginx/init/backup/latest.sql.gz | drush sql-cli;rm /usr/share/nginx/init/backup/latest.sql.gz\"",
"sync": "npm run sync:htdocs; npm run sync:db",
"dump": "vagrant ssh -c \"cd /usr/share/nginx/htdocs && drush sql-dump --gzip > /usr/share/nginx/init/backup/`date +%Y%m%d_%H%M`_local_backup.sql.gz\"",
"dump:prod": "ssh -tp $npm_package_config_ssh_port $npm_package_config_ssh_user@$npm_package_config_ssh_ip \"cd $npm_package_config_ssh_dir; drush sql-dump --gzip > ~/`date +%Y%m%d_%H%M`_prod_backup.sql.gz;\"; rsync -avze \"ssh -p $npm_package_config_ssh_port\" $npm_package_config_ssh_user@$npm_package_config_ssh_ip:~/*prod_backup.sql.gz www/init/backup --remove-source-files",
"uli": "vagrant ssh -c \"cd /usr/share/nginx/htdocs && drush uli --uri=$npm_package_config_local_url\"",
"rename": "sed -i.bak s/drop.local/$rename/g Vagrantfile; sed -i.bak s/drop.local/$rename/g www/init/default; sed -i.bak s/drop.local/$rename/g package.json; ",
"test": "if [ ! -d 'www/htdocs' ]; then echo 'No project in www/htdocs found!'; else [ $(ls www/init/backup) ] && echo 'Ready for restore.' || echo 'No sql file found in www/init/backup!'; fi"
},
"repository": {
"type": "git",
"url": "git+https://github.com/iampuma/drop.git"
},
"keywords": [
"drupal",
"vagrant",
"drop"
],
"author": "[email protected]",
"license": "MIT",
"bugs": {
"url": "https://github.com/iampuma/drop/issues"
},
"homepage": "https://github.com/iampuma/drop#readme",
"main": "index.js"
}