This file is based on doubts that I had/have when I got in at Din Digital and when I forget some stuff.
Note: some paths depend of your own enviroment.
This:
- Creating a new project
- Importing Data Base
- Exporting
- Uploading the Virtual Box
- Deploy on server
- Bower Stuff
- Generating assets
- How GULP and GRUNT works
- Bonus
- Create/clone a directory project on your directory enviroment
- Duplicate the
config
file - Change the hosts (
sudo vi /etc/hosts
) - add ip address + address > and then run:wq
to quit vagrant reload
to reload virtual box at/mvs/dev/
, for example
- Create a new schema on mysql workbench
- Go to inside of your virtual box. Ex:
cd > cd mvs/dev > vagrant ssh
- Then go to your directory project. Ex:
cd /var/www/direcotry-name
// inside of the virtual box - Importing:
mysql -u root -pmysql schema-name < file-name.sql
Note: Connect on virtual box, and not just get in the directory. To connect: cd > cd mvs/dev/
and run vagrant ssh
.
Then you'll can see what is inside of it. Ex: inside of the dev directory (/var/www
).
With this type of file, just give double click on it, wait the MySQL open and press:
- On a Mac:
command + ctrl + Y
- On a Windows:
ctrl + windows + Y
To export (generate DUMP): mysqldump -u username -p[password] db_name > file.sql
.
If you get errors, try run:
- Log out from VM
- Log in as super user:
su
- Type and enter
vagrant
- Done
Get in into vagrant ssh > su
mysqldump -u username -p -h {{IP.ADDRESS}} database > database_file.sql
Here the password will be asked later.
- Or just run again
- Go to your directory. Ex:
cd > cd mvs/dev/
- Run
sudo vagrant up
- Get in the server. Just run
ssh root@ip
. Example:ssh [email protected]
- Get in the directory:
cd /var/www/directory-name/
- Clone/update repo:
git pull origin branch-name
- Go to the directory where bower is installed
- Put the oficial name from git
- Version - ambiente de dev: "latest" - Example:
https://github.com/stevenwanderski/bxslider-4/blob/master/bower.json
- Run
bower install
Go to the root of your project and run php compressor.php
.
Let's call GULP and GRUNT if GG. The GG are automation tasks, where they helps the programmer on simple tasks that get some time from programmer to being complete.
To find your ssh key, just run vi ~/.ssh/id_rsa.pub
or cat ~/.ssh/id_rsa.pub
.
To connect din's development server go to Google Drive, download both id_rsa files, give permissions and run:
ssh [email protected] -i /Users/dindigital02/Downloads/[email protected]/id_rsa
More information here.