Skip to content

Commit 5f70b82

Browse files
authored
chore: merge v2-develop into v2
update docs
2 parents 5b82b3e + 6eeda6b commit 5f70b82

18 files changed

+72
-32
lines changed

.github/workflows/deploy-docs-vue-storefront-cloud.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
ARTIFACT_TYPE: 'sfui2-docs'
2222
DOCKERFILE_PATH: './.vuestorefrontcloud/docs/Dockerfile'
2323
ENVIRONMENT: ${{ needs.configure-enviroment.outputs.environment }}
24+
TARGET_DOMAIN: ${{ needs.configure-enviroment.outputs.target-domain }}
2425

2526
sync-assets:
2627
needs: [build, configure-enviroment]

.github/workflows/deploy-router-vue-storefront-cloud.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
ARTIFACT_TYPE: "vue-storefront"
2222
DOCKERFILE_PATH: ".vuestorefrontcloud/router/docker/Dockerfile"
2323
ENVIRONMENT: ${{ needs.configure-enviroment.outputs.environment }}
24+
TARGET_DOMAIN: ${{ needs.configure-enviroment.outputs.target-domain }}
2425

2526
deploy:
2627
runs-on: ubuntu-latest

.github/workflows/deploy-test-next-storefront-cloud.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
ARTIFACT_TYPE: "sfui2-docs-react"
2222
DOCKERFILE_PATH: ".vuestorefrontcloud/test-next/docker/Dockerfile"
2323
ENVIRONMENT: ${{ needs.configure-enviroment.outputs.environment }}
24+
TARGET_DOMAIN: ${{ needs.configure-enviroment.outputs.target-domain }}
2425

2526
deploy:
2627
needs: [ build, configure-enviroment ]

.github/workflows/deploy-test-nuxt-storefront-cloud.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
ARTIFACT_TYPE: "sfui2-docs-vue"
2121
DOCKERFILE_PATH: ".vuestorefrontcloud/test-nuxt/docker/Dockerfile"
2222
ENVIRONMENT: ${{ needs.configure-enviroment.outputs.environment }}
23+
TARGET_DOMAIN: ${{ needs.configure-enviroment.outputs.target-domain }}
2324

2425
deploy:
2526
needs: [ build, configure-enviroment ]

.github/workflows/image-build-vue-storefront-cloud.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
ENVIRONMENT:
1515
required: true
1616
type: string
17+
TARGET_DOMAIN:
18+
required: true
19+
type: string
1720

1821
jobs:
1922
build:
@@ -29,11 +32,12 @@ jobs:
2932
uses: elgohr/Publish-Docker-Github-Action@v5
3033
env:
3134
ENVIRONMENT: ${{ inputs.ENVIRONMENT }}
35+
TARGET_DOMAIN: ${{ inputs.TARGET_DOMAIN }}
3236
with:
3337
name: ${{ inputs.DOCKER_NAMESPACE }}/${{ inputs.ARTIFACT_TYPE }}:${{ github.sha }}
3438
registry: registry.storefrontcloud.io
3539
username: ${{ secrets.CLOUD_USERNAME }}
3640
password: ${{ secrets.CLOUD_PASSWORD }}
3741
dockerfile: ${{ inputs.DOCKERFILE_PATH }}
3842
buildoptions: '--compress'
39-
buildargs: VITE_DOCS_BASEPATH,VITE_DOCS_EXAMPLES_REACT_PATH,VITE_DOCS_EXAMPLES_VUE_PATH,ENVIRONMENT
43+
buildargs: VITE_DOCS_BASEPATH,VITE_DOCS_EXAMPLES_REACT_PATH,VITE_DOCS_EXAMPLES_VUE_PATH,ENVIRONMENT,TARGET_DOMAIN

.vuestorefrontcloud/docs/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@ FROM node:20-alpine AS build
22

33
WORKDIR /var/www
44

5+
COPY . .
6+
57
ARG VITE_DOCS_BASEPATH
68
ARG VITE_DOCS_EXAMPLES_REACT_PATH
79
ARG VITE_DOCS_EXAMPLES_VUE_PATH
810
ARG ENVIRONMENT
911

10-
ENV VITE_DOCS_BASEPATH=$VITE_DOCS_BASEPATH
11-
ENV VITE_DOCS_EXAMPLES_REACT_PATH=$VITE_DOCS_EXAMPLES_REACT_PATH
12-
ENV VITE_DOCS_EXAMPLES_VUE_PATH=$VITE_DOCS_EXAMPLES_VUE_PATH
12+
ENV NUXT_DOCS_BASEPATH=$VITE_DOCS_BASEPATH
13+
ENV NUXT_APP_BASE_URL=$VITE_DOCS_BASEPATH
14+
ENV NUXT_DOCS_EXAMPLES_REACT_PATH=$VITE_DOCS_EXAMPLES_REACT_PATH
15+
ENV NUXT_DOCS_EXAMPLES_VUE_PATH=$VITE_DOCS_EXAMPLES_VUE_PATH
1316
ENV ENVIRONMENT=$ENVIRONMENT
1417

15-
COPY . .
1618
RUN yarn
1719
RUN ENV_NAME=$ENVIRONMENT yarn build:replace-assets-url-with
1820
RUN yarn build:vue

.vuestorefrontcloud/docs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
You can debug dockerized docs image by following steps below:
66

7-
- build image using `DOCKER_BUILDKIT=1 docker build -t docs --build-arg VITE_DOCS_EXAMPLES_VUE_PATH=http://localhost:3001 --build-arg VITE_DOCS_EXAMPLES_REACT_PATH=http://localhost:3002 --build-arg VITE_DOCS_BASEPATH=/v2/ -f .vuestorefrontcloud/docs/Dockerfile .`,
8-
- run image using `docker run -t -i -p 3000:80 docs`, (flags `i` and `t` allows to run command and then kill it with `ctrl+c` https://github.com/moby/moby/issues/2838#issuecomment-29205965)
7+
- build image using `DOCKER_BUILDKIT=1 docker build -t docs --build-arg VITE_DOCS_EXAMPLES_VUE_PATH=http://localhost:3001/v2-vue --build-arg VITE_DOCS_EXAMPLES_REACT_PATH=http://localhost:3002/v2-react --build-arg VITE_DOCS_BASEPATH=/v2/ -f .vuestorefrontcloud/docs/Dockerfile .`,
8+
- run image using `docker run -t -i -p 3004:80 docs`, (flags `i` and `t` allows to run command and then kill it with `ctrl+c` https://github.com/moby/moby/issues/2838#issuecomment-29205965)
99
- open browser and go to the address `http://localhost:3000/v2/` to see the docs page running.
1010

11-
NOTE: docs will work but without `vue` and `react` showcases. For full docs experience you have to run `test-next` and `test-nuxt` docker as well.
11+
NOTE: docs will work but without `vue` and `react` showcases. For full docs experience you have to run `test-next` and `test-nuxt` docker as well. And to test root redirect to `/v2/` you need to run `router` docker image too.

.vuestorefrontcloud/router/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,13 @@ An alternative to robots.txt in this case could be using the built-in Farmer fea
2727
However, I went with creating the "nginx + robots.txt file" container here anyways. I'm forced to create a container for nginx so might as well put the robots.txt file here.
2828

2929
That's a lot of work to do such a simple thing, but the situation is what it is.
30+
31+
## Debugging
32+
33+
You can debug dockerized docs image by following steps below:
34+
35+
- run `docs` docker image,
36+
- run terminal in `root` directory,
37+
- build image using `DOCKER_BUILDKIT=1 docker build -t docs-router --build-arg TARGET_DOMAIN=http://localhost:3004 -f .vuestorefrontcloud/router/docker/Dockerfile .`,
38+
- run image using `docker run -t -i -p 3000:3000 docs-router nginx-debug -g 'daemon off;'`, (flags `i` and `t` allows to run command and then kill it with `ctrl+c` https://github.com/moby/moby/issues/2838#issuecomment-29205965)
39+
- open browser and go to the address `http://localhost:3004` to see the app page running.
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
FROM nginx
2-
COPY .vuestorefrontcloud/router/docker/default.conf /etc/nginx/conf.d/default.conf
2+
3+
ARG TARGET_DOMAIN
4+
5+
ENV TARGET_DOMAIN=$TARGET_DOMAIN
6+
7+
COPY .vuestorefrontcloud/router/docker/default.conf.template /etc/nginx/conf.d/default.conf.template
8+
9+
RUN envsubst '$TARGET_DOMAIN' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf

.vuestorefrontcloud/router/docker/default.conf renamed to .vuestorefrontcloud/router/docker/default.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ server {
88

99
# https://www.oliverdavies.uk/blog/nginx-redirects-query-string-arguments
1010
location / {
11-
return 301 https://docs.storefrontui.io/v2$uri$is_args$args;
11+
return 301 ${TARGET_DOMAIN}/v2$uri$is_args$args;
1212
}
1313
}

0 commit comments

Comments
 (0)