Monday, 22 January 2018

D8

drupalvm


Uruchamianie i zamykanie

make up
make stop

Docker

Import bazy:
1. Logowanie do mariadb przez portainer
2. Wrzucić dump z mariadb-init do mariadb-manual
3. Dump po zalogowaniu do containera powinien byc dostepny w /var/lib/mysql/dumps
4. Import bazy drupal/drupal/drupal (najpierw drop database, potem create, potem import, potem drush cr w php container).

Free up local storage


With each drupalvm instance setup (by set up I mean git clone of drupalvm and vagrant up) it's downloading new base box image. These images are kept in VirtualBox VM's folder in separated directories like:

packer-ubuntu-16.04-amd64_2232343245445_23344/packer-ubuntu-16.04-amd64-disk001.vmdk
packer-ubuntu-16.04-amd64_3343354343455_33224/packer-ubuntu-16.04-amd64-disk001.vmdk
packer-ubuntu-16.04-amd64_2323434243223_56566/packer-ubuntu-16.04-amd64-disk001.vmdk

etc.


The image that is downloaded is treated as base image to set up your environment based on your settings in yaml file. While vagrant up is running it copies this image into the separate folder with the name of your project eg. drupalvm.dev and installs all the required packages listed in yaml file. However when vagrant up is completed the base file stays in packer-ubuntu-16.04-amd64_2232343245445_23344 directory. And it's not used anymore because new one was generated for you based on this one. This file takes almost 2GB of data. And you can easily delete this file.


Directory structure (let's assume that VirtualBox VMs folder stores all the boxes):

Before any vagrant build it's empty:

/VirtualBox VMs
.
..

After gitclone and vagrant up (in completely separated directory, code of your site and drupalvm code from github has nothing to do with directories below). Assume your projects name is 'drupal':

/VirtualBox VMs
.
..
drupal/
packer-ubuntu-16.04-amd64_2232343245445_23344/

In this case you can delete this folder packer-ubuntu-16.04-amd64_2232343245445_23344/

IMPORTANT UPDATE
It seems like last setup I made has changed. I cloned drupalvm and run vagrant up. After the build base box image located in one of this: packer-ubuntu-16.04-amd64_2323434243223_56566/packer-ubuntu-16.04-amd64-disk001.vmdk is used to run the environment, so it looks like drupalvm no longer copies this file into your projects directory and makes changes on it. I don't really know how it works right now, but there are two possibilities:

1. It makes changes directly into packer-ubuntu-16.04-amd64_2323434243223_56566/packer-ubuntu-16.04-amd64-disk001.vmdk file so it reflects your yaml config.

2. It does not change packer-ubuntu-16.04-amd64_2323434243223_56566/packer-ubuntu-16.04-amd64-disk001.vmdk at all but all the dependencies are located in your project VM directory. This approach is rather not possible, it's really hard to imagine that it changed so much that dependencies are separated into another folder.


Hoteltreats

Sass

This command should be run in main theme directory from main system (not VM):
sass --watch scss/style.scss:css/style.css

Konfiguracja danej domeny/strony

Znajduje się w hoteltreats/private/hotel-x.hoteltreats.test.yml
Wszystkie zmienne znajdujące się w hotelstyles.settings są również opisane w themes/hotelstyles/config/schema/hotelstyles.schema.yml

Logowanie

drush uli

Zarzadzanie Treats

Structure -> Treats
Form: Property -> Le Meridian, published, english
Edit any node -> Micorsie Tab -> In collections field (eg. Best Experiences)

Nadpisywanie zmiennych

1. W pierwszej kolejności zmienne SASS deklarujemy w _default-variables.scss
2. Następnie wpisujemy tą zmienną w _css-vars.scss
3. Następnie używamy jej w plikach w /components jako mixin var (tutaj nie jest deklarowana zmienna, a wywolywana juz wczesniej zdeklarowana w :root)
4. Jesli ostatecznie chcemy nadpisac ta zmienna uzywamy jej w /private/microsites/something.yml