Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker setup is not supporting project specific theme development #22

Open
kandrejevs opened this issue Apr 16, 2019 · 3 comments
Open
Assignees

Comments

@kandrejevs
Copy link

kandrejevs commented Apr 16, 2019

Describe the bug
Current docker setup is tailored for core development and is not working correctly with project specific theme development.

To Reproduce
Create custom theme through cli command, e.g. MyCompany/pwa, and update configuration files (.env, webpack)

  1. the first issue is deployment procedure in deploy/start.sh. Function contains code that redeploys base theme from scratch every time, it fails if files are present and don't delete them, but it still contains hard coded values and is executed on every start up.

  2. the second issue is that theme path is hard coded in multiple places and is not prone to be changed easily.
    deploy/local/env
    deploy/start.sh
    docker-compose.frontend.yml

  3. after adjusting config and docker files to work with project specific theme, webpack scss compilation fails, src/app/design/frontend/PROJECT/pwa/src/config/webpack.development.config.js projectRoot has to changed with fallbackRoot.

  4. after importing sample data, migrations fail:

app_1            | Module 'ScandiPWA_Installer':
app_1            | Module 'Scandiweb_Core':
app_1            | Module 'ScandiPWA_Migrations':
app_1            | Caught exception: The stock item was unable to be saved. Please try again.
app_1            | Rolled back transaction has not been completed correctly.

Expected behavior
docker containers should be able to handle project specific theme development.

@Danpiel
Copy link
Contributor

Danpiel commented Apr 16, 2019

Most of the settings/variables are intended to be changed depending on your setup, but templating for settings can be added along with docs.

@eli-l might have additional thoughts

@kandrejevs
Copy link
Author

@Danpiel there is lack of settings and variables, currently many values are just hard-coded and repetitive, in this current example: the base path for theme- hence the referenced files in ticket. Changing settings and variables does not work fully, you still have to edit and tinker with other files which use the same values, but they are not using settings or variables, and on top of that you have to disable demo project deployment specific routines, which in my opinion shouldn't even be in core since they are demo not core specific. Such modifications can make updates from scandipwa-base harder, since there will be conflicts.

@alfredsgenkins
Copy link
Contributor

So, conclusion:

  • We make build/frontend/start.sh and deploy/start.sh respect new ENV variable i.e. SCANDIPWA_THEME, it value could be Scandiweb/pwa, we define it in .env
  • We edit THEMEPATH and STATIC_ASSET_PATH to respect new variable
  • We make webpack.development.config.js use fs to get it's theme name

@yeegor please update the ticket status upon completion, reference changes, if possible :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants