Skip to content

Commit 6e93776

Browse files
authored
Merge pull request #1045 from YevhenZvieriev/feature/setup-pwa-sampledata
2 parents 823c6e7 + 81386f3 commit 6e93776

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ It is recommended to keep your root docker config files in one repository, and y
312312
- `bin/setup-composer-auth`: Setup authentication credentials for Composer.
313313
- `bin/setup-domain`: Setup Magento domain name. Ex: `bin/setup-domain magento.test`
314314
- `bin/setup-grunt`: Install and configure Grunt JavaScript task runner to compile .less files
315-
- `bin/setup-pwa-studio`: (BETA) Install PWA Studio (requires NodeJS and Yarn to be installed on the host machine). Pass in your base site domain, otherwise the default `master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud` will be used. Ex: `bin/setup-pwa-studio magento.test`
315+
- `bin/setup-pwa-studio`: (BETA) Install PWA Studio (requires NodeJS and Yarn to be installed on the host machine). Pass in your base site domain, otherwise the default `master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud` will be used. Ex: `bin/setup-pwa-studio magento.test`.
316+
- `bin/setup-pwa-studio-sampledata`: This script makes it easier to install Venia sample data. Pass in your base site domain, otherwise the default `master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud` will be used. Ex: `bin/setup-pwa-studio-sampledata magento.test`.
316317
- `bin/setup-ssl`: Generate an SSL certificate for one or more domains. Ex. `bin/setup-ssl magento.test foo.test`
317318
- `bin/setup-ssl-ca`: Generate a certificate authority and copy it to the host.
318319
- `bin/start`: Start all containers, good practice to use this instead of `docker-compose up -d`, as it may contain additional helpers.
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
set +e
3+
4+
RED='\033[0;31m'
5+
GREEN='\033[0;32m'
6+
NC='\033[0m'
7+
8+
BASE_URL=${1:-master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud}
9+
10+
install_sampledata() {
11+
echo -e "${GREEN}Setting up composer repository for Venia sample data.${NC}"
12+
bin/composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com
13+
14+
echo -e "${GREEN}Requiring Venia sample data metapackage.${NC}"
15+
bin/composer require --no-interaction --ansi magento/venia-sample-data:*
16+
17+
echo -e "${GREEN}Installing Venia sample data modules.${NC}"
18+
bin/magento setup:upgrade
19+
20+
echo -e "${GREEN}Reindexing the data from the modules.${NC}"
21+
bin/magento indexer:reindex
22+
}
23+
24+
install_sampledata
25+
26+
ENV_DIST_FILE="packages/venia-concept/.env.dist"
27+
if [ -f "$ENV_DIST_FILE" ]; then
28+
cp "$ENV_DIST_FILE" packages/venia-concept/.env
29+
else
30+
echo -e "${RED}.env.dist file not found. Continuing without copying.${NC}"
31+
fi
32+
33+
echo -e "${GREEN}Script completed successfully.${NC}"
34+
echo "You may now access your Magento PWA Studio instance at https://${BASE_URL}/"

0 commit comments

Comments
 (0)