Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 2b8b0e1

Browse files
authored
Merge branch 'master' into hotfix/v1.11.3
2 parents 7464a10 + 6967e0a commit 2b8b0e1

File tree

7 files changed

+152
-28
lines changed

7 files changed

+152
-28
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Deploy to Storefrontcloud
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- develop
7+
- hotfix/v*
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v1
14+
- name: Setup node
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: "10.x"
18+
- name: Build and publish docker image
19+
uses: elgohr/Publish-Docker-Github-Action@master
20+
with:
21+
name: demo-storefrontcloud-io/vue-storefront:${{ github.sha }}
22+
registry: registry.storefrontcloud.io
23+
username: ${{ secrets.CLOUD_USERNAME }}
24+
password: ${{ secrets.CLOUD_PASSWORD }}
25+
dockerfile: dev/docker/Dockerfile
26+
buildoptions: "--compress"
27+
deploy:
28+
runs-on: ubuntu-latest
29+
needs: build
30+
steps:
31+
- uses: chrnorm/deployment-action@releases/v1
32+
name: Create GitHub deployment
33+
id: deployment
34+
with:
35+
token: "${{ github.token }}"
36+
target_url: https://demo.storefrontcloud.io
37+
environment: production
38+
initial_status: in_progress
39+
- name: Deploy on demo.storefrontcloud.io
40+
if: github.ref == 'refs/heads/master'
41+
run: |
42+
if curl -s -u ${{ secrets.CLOUD_USERNAME }}:${{ secrets.CLOUD_PASSWORD }} -H 'Content-Type: application/json' -X POST -d '{"code":"demo","frontContainerVersion":"${{ github.sha }}"}' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then
43+
echo "Instance updated"
44+
else
45+
echo "Something went wrong during the update process..."
46+
exit 1
47+
fi
48+
- name: Deploy on next.storefrontcloud.io
49+
if: contains(github.ref, 'hotfix/v')
50+
run: |
51+
if curl -s -u ${{ secrets.CLOUD_USERNAME }}:${{ secrets.CLOUD_PASSWORD }} -H 'Content-Type: application/json' -X POST -d '{"code":"next","frontContainerVersion":"${{ github.sha }}"}' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then
52+
echo "Instance updated"
53+
else
54+
echo "Something went wrong during the update process..."
55+
exit 1
56+
fi
57+
- name: Deploy on test.storefrontcloud.io
58+
if: github.ref == 'refs/heads/develop'
59+
run: |
60+
if curl -s -u ${{ secrets.CLOUD_USERNAME }}:${{ secrets.CLOUD_PASSWORD }} -H 'Content-Type: application/json' -X POST -d '{"code":"test","frontContainerVersion":"${{ github.sha }}"}' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then
61+
echo "Instance updated"
62+
else
63+
echo "Something went wrong during the update process..."
64+
exit 1
65+
fi
66+
- name: Update deployment status (success)
67+
if: success()
68+
uses: chrnorm/deployment-status@releases/v1
69+
with:
70+
token: "${{ github.token }}"
71+
target_url: https://demo.storefrontcloud.io
72+
state: "success"
73+
description: Congratulations! The deploy is done.
74+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
75+
- name: Update deployment status (failure)
76+
if: failure()
77+
uses: chrnorm/deployment-status@releases/v1
78+
with:
79+
token: "${{ github.token }}"
80+
target_url: https://demo.storefrontcloud.io
81+
description: Unfortunately, the instance hasn't been updated.
82+
state: "failure"
83+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ See the ideas behind Vue Storefront [here](https://www.slideshare.net/FilipRakow
3232
**Read [contribution rules](https://github.com/DivanteLtd/vue-storefront/blob/master/CONTRIBUTING.md) before making any pull request. Pull request that doesn't meet these requirements will not be merged**
3333

3434
PS: Check [StorefrontUI](https://github.com/DivanteLtd/storefront-ui/) - our UI library for eCommerce.
35+
## Vue Storefront Next
36+
37+
We're developing a next version of Vue Storefront on the [`next` branch](https://github.com/DivanteLtd/vue-storefront/tree/next).
38+
39+
We're building the following integrations within Next architecture:
40+
- Shopware 6 (developer preview)
41+
- Commercetools (developer preview)
42+
- AboutYou Cloud
43+
- Shopify
44+
- Salesforce Commerce Cloud
45+
46+
You can learn more about Vue Storefront Next from the README on the `next` branch and [this](https://www.youtube.com/watch?v=0e2wyhR0ZyQ&t=3s) video
3547

3648
## See it in action
3749

@@ -964,28 +976,28 @@ Vue Storefront is a Community effort brought to You by our great Core Team and s
964976
</tr>
965977
<tr>
966978
<td align="center" valign="middle">
967-
<a href="">
979+
<a href="https://www.2hatslogic.com/">
968980
<img
969-
src=""
970-
alt=""
981+
src="https://blog.vuestorefront.io/wp-content/uploads/2020/03/2hatslogic-logo.png"
982+
alt="2hatslogic"
971983
height="40"
972984
>
973985
</a>
974986
</td>
975987
<td align="center" valign="middle">
976-
<a href="">
988+
<a href="https://beecommerce.pl/en/">
977989
<img
978-
src=""
979-
alt=""
990+
src="https://blog.vuestorefront.io/wp-content/uploads/2020/04/beecommerce_color_horizontal.png"
991+
alt="BeeCommerce"
980992
height="40"
981993
>
982994
</a>
983995
</td>
984996
<td align="center" valign="middle">
985-
<a href="">
997+
<a href="https://www.gpmd.co.uk/">
986998
<img
987-
src=""
988-
alt=""
999+
src="https://blog.vuestorefront.io/wp-content/uploads/2020/04/[email protected]"
1000+
alt="GPMD"
9891001
height="40"
9901002
>
9911003
</a>

config/default.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"invalidateCacheKey": "aeSu7aip",
3131
"invalidateCacheForwarding": false,
3232
"invalidateCacheForwardUrl": "http://localhost:8080/invalidate?key=aeSu7aip&tag=",
33-
"dynamicConfigReload": false,
33+
"dynamicConfigReload": true,
3434
"dynamicConfigContinueOnError": false,
3535
"dynamicConfigExclude": [
3636
"entities",

dev/docker/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:10
2+
3+
ENV NODE_CONFIG_ENV=docker PM2_ARGS=--no-daemon BIND_HOST=0.0.0.0 VS_ENV=prod
4+
5+
WORKDIR /var/www
6+
7+
COPY . .
8+
9+
# Should be yarn install --production
10+
RUN apt update && apt install -y git \
11+
&& yarn install \
12+
&& yarn build
13+
14+
COPY dev/docker/vue-storefront.sh /usr/local/bin/
15+
RUN chmod a+x /usr/local/bin/vue-storefront.sh
16+
17+
ENTRYPOINT ["vue-storefront.sh"]

dev/docker/vue-storefront.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ "$VS_ENV" = 'dev' ]; then
5+
yarn dev
6+
else
7+
yarn start
8+
fi

docs/guide/cookbook/elastic.md

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,14 @@ module.exports = function (restClient) {
623623
}
624624
625625
````
626-
This library file only deals with _GET_ API to get a list of offline stores from Magento 2.
626+
This library file only deals with _GET_ API to get a list of offline stores from Magento 2.
627+
628+
:::tip NOTE
629+
```js
630+
var endpointUrl = util.format('/offline-stores');
631+
```
632+
This line is particularly important, since `'/offline-stores'` is where the API url endpoint is determined. It should match the API url endpoint of Magento 2 side.
633+
:::
627634
628635
5. Now we need to include this library in `index.js` :
629636
```bash
@@ -713,7 +720,7 @@ debug: Response received.
713720
2020-03-10T09:22:32.140Z - info: No tasks to process. All records processed!
714721
2020-03-10T09:22:32.140Z - info: Task done! Exiting in 30s...
715722
```
716-
:::tip NOTE
723+
:::warning NOTE
717724
You should tell the machine the environment variable like this before running the command :
718725
```bash
719726
export MAGENTO_URL=http://localhost/rest
@@ -855,16 +862,16 @@ Now you are all set to use custom entity you just created. The next step lets yo
855862
import { currentStoreView } from '@vue-storefront/core/lib/multistore'
856863
import { registerModule } from '@vue-storefront/core/lib/modules'
857864
import { OrderModule } from '@vue-storefront/core/modules/order'
858-
import { quickSearchByQuery } from '@vue-storefront/core/lib/search';
865+
import { quickSearchByQuery } from '@vue-storefront/core/lib/search'; // Import the method to fetch data from ES
859866
860867
const storeView = currentStoreView()
861868
862869
// ... abridged
863870
864871
methods: {
865-
async showPayment () {
866-
let offlineStores = await quickSearchByQuery({ entityType: 'offline_stores' });
867-
alert("Your item will be sent from the shop at " + offlineStores.items[0].address);
872+
async showPayment () { // the method should be done with async/await
873+
let offlineStores = await quickSearchByQuery({ entityType: 'offline_stores' });
874+
alert("Your item will be sent from the shop at " + offlineStores.items[0].address);
868875
const payment = new PaymentRequest(this.paymentMethods, this.paymentDetails , this.paymentOptions)
869876
870877
// abridged ...
@@ -875,18 +882,7 @@ Now go to your online shop, put an item to cart and open it, click __Instant Che
875882
![instant_checkout_store_borderline](../images/stores.png)
876883
877884
878-
### 2-1. Recipe B (with GraphQL)
879-
880-
1. First off, we need to create an `graphql` folder under `src/search/adapter/` as follows :
881-
```bash
882-
cd src/search/adapter
883-
mkdir graphql
884-
```
885885
886-
2. Copy `searchAdapter` file from `core` folder :
887-
```bash
888-
cp ../../../core/lib/search/adapter/graphql/searchAdapter.ts graphql/
889-
```
890886
891887
### 3. Peep into the kitchen (what happens internally)
892888
In this recipe, we iterated a whole journey of building custom entities on your online shop (it was Magento 2 for this time) for whatever reason to deal with various information for enhancing your customer experience.
@@ -898,7 +894,7 @@ Second, as an appetizer, we had to import data from shop using _mage2vuestorefro
898894
Third, main dish, we extended core adapters in `src` folder so we are safe for future updates :).
899895
It was actually very easy! you just need to `registerEntityType` for your custom entity! We also looked at how to implement it in real example though it was simplified version, you better follow `vuex` best practice.
900896
901-
We also have a variety of main dish, by giving you an option to go with _GraphQL_. This approach took us a little more to tweak with, but believe me, _GraphQL_ has pretty good advantage over its competitors.
897+
We also have a variety of main dish, by giving you an option to go with _GraphQL_. This approach took us a little more to tweak with, but believe me, _GraphQL_ has [pretty good advantage](https://www.altexsoft.com/blog/engineering/graphql-core-features-architecture-pros-and-cons/) over its competitors.
902898
903899
Now we can extend our shop as good as it gets to handle more versatile information on your shop. Congratulation!
904900

docs/guide/installation/production-setup.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,14 @@ yarn start
444444

445445
Both applications use [`PM2` process manager](https://pm2.keymetrics.io/docs/usage/process-management/) in production mode (`start` commands) to manage and respawn the node.js processes when needed.
446446

447+
## Cache Strategies
448+
449+
### Varnish cache for VSF
450+
_Vue Storefront_ has multiple layers of cache, and the forefront cache is _Varnish_ which serves a request just as fast as a static HTML page once it's hit. You can install it from [here](https://github.com/new-fantastic/vsf-cache-varnish).
451+
452+
### Vue Storefront Proxy
453+
_Vue Storefront_ can be set up with [OpenResty](http://openresty.org/en/) based reverse proxy serving cached pages from Redis without Vue StoreFront (VSF or VSF API) calls, using LUA. [Here](https://github.com/ClickAndMortar/docker/tree/master/vue-storefront/proxy) is the github repo.
454+
447455
## Production setup - using Docker / Kubernetes
448456

449457
To be prepared.

0 commit comments

Comments
 (0)