## Migrate to laravel 7

- Get corresponding .env file from 1password
- Run composer install or lando composer install (the last one if you are running lando)
- Run php artisan migrate or lando artisan migrate (the last one if you are running lando)
- Run php artisan storage:link or lando artisan storage:link (the last one if you are running lando)
- Copy all files inside /public/uploads from old project to storage/app/public (the storage/app/public should not have the uploads folder, just what is inside it)
- Copy the folder assessment_profiles from the old project to storage/app/assessment_profiles


Check sendmail server configuration in production (SPG was to do it or provide and external smtp service)


## Install / setup project

* run lando
```bash
lando start
```

* import BD (lando db-import somedumpfile.sql.gz)
host: localhost or 127.0.0.0
username: laravel
password: laravel
port: 3307
database: laravel

* config .env file, check 1password searching (Southpole SPG lando env)

* run composer
```bash
lando composer install
```

* Edit website tablet columns (url and hostname) to http://spg.lndo.site and spg.lndo.site

* Install webp
```bash
lando ssh -u root
apt-get update
apt-get install webp
php artisan storage:link
```

* install packages using npm (node v14.x)
```bash
npm install
```

* dev mode
```bash
npm run watch
```

## Troubleshooting

* if you need the images from the site you have to extract them from the server using sftp (ex filezilla)

* if you get upload/thumbs 404 maybe you need change .env file APP_URL=http://spg.lndo.site to APP_URL=http://spg-refact.lndo.site


## Deploy K8S

- First do a merge to master branch
- Enter in github.com -> southpole project -> tab actions ->  Build and Deploy to GKE in sidebar -> run workflow master to staging (can have a delay aprox 12min).
- the URL K8S staging:
```bash
https://sp-website-staging.southpole.com/
```
-  and teh basic auth:
```bash
user: sp
pass: spg343
```
- if all correct on staging, you can repeat these steps but in the run workflow change staging to prod


## Forms

Edit this file (cannot be test on local)
```bash
public/assets/parlot/styles-2.css
```

this file has cache, after deploy, go to <head> search the file and write
```bash
/path/styles-2.css?aaa
```


/var/www/html-staging
npm run development