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

Section demodata is hard-coded, impossible to use meaningful name instead #373

Closed
localheinz opened this issue Oct 7, 2022 · 4 comments
Closed
Labels

Comments

@localheinz
Copy link
Contributor

Which release, branch or hash of Docker SDK are you using?

364e266

Which operating system (platform/version/architecture) are you using?

MacOS

What is the issue that you're experiencing?

The concept of "demo data" is hard-coded into scripts, making it impossible to rename the corresponding demodata sections in installation recipes to something that makes more sense, for example, data.

What are the steps to reproduce the issue?

Here are examples from installation recipes for production environments for the https://github.com/spryker-shop/b2b-demo-shop:

❗ If you rename the sections demodata, because in a production environment I clearly do not want to import demo data, but actual data, data is not imported anymore, because the sections are hard-coded into scripts:

generator/src/templates/deploy.bash.twig

The template contains two references to scripts that are included.

import command/runtime/demo.sh

bin/command/runtime/demo.sh

https://github.com/spryker/docker-sdk/blob/364e266cbf90f53a2008cfa9cd7183cd63139a33/bin/command/runtime/demo.sh

data/demo.sh

The name of the script itself indicates that it is used for demo data only, but why would anyone want to import demo data in a production system? We want to import production data - or just data. Let me decide what kind of data I import, rather than pushing the concept of demo data on me.

https://github.com/spryker/docker-sdk/blob/364e266cbf90f53a2008cfa9cd7183cd63139a33/bin/sdk/data/demo.sh

local demoDataSection=${1:-demodata}
Compose::exec "vendor/bin/install${verboseOption} -r ${SPRYKER_PIPELINE} -s init-storages-per-region -s ${demoDataSection}"

@alexanderM91
Copy link
Collaborator

Hey @localheinz,
thanks a lot for your proposal.

Yes, I think it's possible to add some aliases for demodata, like data and mention it in the documentation.

@localheinz
Copy link
Contributor Author

@alexanderM91

That would be great, would also be great to provide some documentation generally for the installation recipes, or add a linkl to where that can be found.

We currently have a config/install/EU/production.yml with

sections:
  # snip

  data:
    # snip

and I have no idea whether the data section is run, and by what.

When I rename the demodata section in the other recipes, for example, to data, the section data is not executed.

It's rather difficult to understand what is going on!

@alexanderM91
Copy link
Collaborator

alexanderM91 commented Oct 14, 2022

Hey @localheinz,

sorry, I am trying to find the best solution for your request and figured out that me mixed some installation recipes and environment (local or stag etc.)

Local development:
You are absolutely right that we use demodata section for local environment and we run demodata section at the stage of data filling, which is okay from my perspective.

Stag\Prod environments:
We have a separate installation recipes which you mentioned:

Example of usage, hooks definition:

image:
    tag: spryker/php:8.1
    environment:
        SPRYKER_HOOK_BEFORE_DEPLOY: 'vendor/bin/install -r EU/pre-deploy -vvv'
        SPRYKER_HOOK_INSTALL: 'vendor/bin/install -r EU/production --no-ansi -vvv'
        SPRYKER_HOOK_DESTRUCTIVE_INSTALL: 'vendor/bin/install -r EU/destructive --no-ansi -vvv'

As far as I know you can easily rename demodata to data, prod-data or any other suitable name and your pipeline will behave properly without any consequences.

Note: Section description.
Yes, we are working on a separate document which will provide stages description.

@alexanderM91 alexanderM91 added request-clarification and removed documentation Improvements or additions to documentation labels Oct 14, 2022
@alexanderM91
Copy link
Collaborator

alexanderM91 commented Oct 14, 2022

Hey @localheinz, can we close this issue as nothing should be done and continue working with the documentation adjustments from the previous issue?

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

No branches or pull requests

3 participants