forked from magento/pwa-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Documentation] Move venia sample data installation topic (magento#474)
* magento#436 Create topic for installing Venia sample data * magento#436 update setup topic to remove venia sample data install section
- Loading branch information
Showing
6 changed files
with
194 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
...ia-pwa-concept/install-sample-data/_includes/deploy-venia-sample-data-script.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<details markdown="1"> | ||
<summary>Show content for <code>deployVeniaSampleData.sh</code></summary> | ||
|
||
``` sh | ||
#!/usr/bin/env bash | ||
add_composer_repository () { | ||
name=$1 | ||
type=$2 | ||
url=$3 | ||
echo "adding composer repository ${url}" | ||
${composer} config ${composerParams} repositories.${name} ${type} ${url} | ||
} | ||
|
||
add_venia_sample_data_repository () { | ||
name=$1 | ||
add_composer_repository ${name} github "${githubBaseUrl}/${name}.git" | ||
} | ||
|
||
execute_install () { | ||
composer='/usr/bin/env composer' | ||
composerParams='--no-interaction --ansi' | ||
moduleVendor='magento' | ||
moduleList=( | ||
module-catalog-sample-data-venia | ||
module-configurable-sample-data-venia | ||
module-customer-sample-data-venia | ||
module-sales-sample-data-venia | ||
module-tax-sample-data-venia | ||
sample-data-media-venia | ||
) | ||
githubBaseUrl='git@github.com:PMET-public' | ||
|
||
cd $install_path | ||
|
||
for moduleName in "${moduleList[@]}" | ||
do | ||
add_venia_sample_data_repository ${moduleName} | ||
done | ||
|
||
${composer} require ${composerParams} $(printf "${moduleVendor}/%s:dev-master@dev " "${moduleList[@]}") | ||
} | ||
|
||
|
||
skip_interactive=0 | ||
install_path=./ | ||
|
||
while test $# -gt 0; do | ||
case "$1" in | ||
--help) | ||
echo "Magento 2 Venia Sample data script install." | ||
echo "if no options are passed, it will start interactive mode and ask for your Magento absolute path" | ||
echo "" | ||
echo "Usage:" | ||
echo " deployVeniaSampleData.sh [options]" | ||
echo "Options:" | ||
echo " --help Displays this!" | ||
echo " --yes Skip interactive mode and installs data" | ||
echo " --path your Magento 2 absolute path, otherwise will install in current directory." | ||
echo "" | ||
|
||
exit 0 | ||
;; | ||
--yes) skip_interactive=1 | ||
shift | ||
;; | ||
--path*) if test $# -gt 0; then | ||
install_path=`echo $1 | sed -e 's/^[^=]*=//g'` | ||
fi | ||
shift | ||
;; | ||
*) break | ||
;; | ||
esac | ||
|
||
done | ||
|
||
|
||
if [ "$skip_interactive" == 1 ]; then | ||
echo "Skipping interactive mode.." | ||
echo "Install path ${install_path}" | ||
execute_install | ||
else | ||
echo "Please specify absolute path to your Magento 2 instance" | ||
read -p 'Magento root folder: ' install_path | ||
|
||
echo "Sample data will be installed there." | ||
echo "" | ||
read -p "Are you sure you want to continue? [y/n]" yn | ||
|
||
case $yn in | ||
y ) | ||
execute_install | ||
;; | ||
n ) | ||
echo "Sample Data instalation failed." | ||
exit 0 | ||
;; | ||
* ) | ||
echo "Exiting..." | ||
exit 1 | ||
;; | ||
esac | ||
|
||
fi | ||
``` | ||
|
||
</details> |
Binary file added
BIN
+140 KB
...cs/src/venia-pwa-concept/install-sample-data/images/accessories-sample-data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+210 KB
...docs/src/venia-pwa-concept/install-sample-data/images/sample-data-installed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions
56
pwa-devdocs/src/venia-pwa-concept/install-sample-data/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: Install Venia sample data | ||
--- | ||
|
||
 | ||
|
||
The Venia storefront looks best when running against a Magento 2 backend with the Venia sample data installed. | ||
|
||
{: .bs-callout .bs-callout-info} | ||
The sample `.env.dist` file in the Venia project already contains the URL for a Magento 2 cloud instance that has the Venia sample data installed, so | ||
setting up a Magento 2 instance and installing sample data into it is now an optional step. | ||
|
||
Follow the instructions on this page to install the Venia sample data into your Magento 2 development instance. | ||
|
||
## Prerequisites | ||
|
||
* PHP 7.1 (currently one of the sample data modules is incompatible with PHP 7.2) | ||
* System access to a Magento 2 instance | ||
|
||
{: .bs-callout .bs-callout-warning} | ||
If you have the previous `magento2-sample-data` module installed, you need to [remove the sample data modules][] and re-install Magento with a clean database. | ||
|
||
## Step 1. Copy or create the deploy script | ||
|
||
If you have cloned the [PWA Studio][] repository into the same machine as your Magento instance, copy over the following PWA Studio file into the root directory of your Magento instance: | ||
|
||
`packages/venia-concept/deployVeniaSampleData.sh` | ||
|
||
If you do not have access to the PWA Studio repository, copy the following content into a file in the root directory of your Magento instance: | ||
|
||
{% include_relative _includes/deploy-venia-sample-data-script.md %} | ||
|
||
## Step 2. Execute the deploy script | ||
|
||
Execute the script in the root directory of your Magento instance to add the Venia sample data modules to Magento: | ||
|
||
```sh | ||
bash deployVeniaSampleData.sh | ||
``` | ||
|
||
## Step 3. Install the sample data modules | ||
|
||
Run the following command in the Magento root directory to install the Venia data from the modules: | ||
|
||
```sh | ||
bin/magento setup:upgrade | ||
``` | ||
|
||
## Step 4. Verify installation | ||
|
||
Log into the Admin section or visit the store of your Magento instance to verify the sample data installation. | ||
|
||
 | ||
|
||
[remove the sample data modules]: https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-sample-data-other.html#inst-sample-remove | ||
[PWA Studio]: https://github.com/magento-research/pwa-studio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters