Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
767c1ce
Preview
mkoszutowski Mar 26, 2020
d252df7
Merge branch 'master' into feature/commit_preview_on_storefrontcloud
mkoszutowski Apr 7, 2020
cc13a78
WIP - github actions for deployment and preview
mkoszutowski Apr 7, 2020
5bd129b
WIP - github actions for deployment and preview
mkoszutowski Apr 7, 2020
99c5e89
WIP - github actions - removed workdir
mkoszutowski Apr 7, 2020
2453f2c
WIP - github actions - fixed Dockerfile path
mkoszutowski Apr 7, 2020
6e3ad84
WIP - github actions - universal checker
mkoszutowski Apr 7, 2020
dfd21b7
WIP - github actions - deploy only for master
mkoszutowski Apr 7, 2020
1009ba7
WIP - github actions - deploy only for master
mkoszutowski Apr 7, 2020
3b61900
WIP - github actions - deploy only for master
mkoszutowski Apr 7, 2020
af2b14b
WIP - github actions - deploy only for master
mkoszutowski Apr 7, 2020
7c300ff
WIP - github actions - deploy only for master
mkoszutowski Apr 7, 2020
cf9e16d
WIP - github actions - deploy only for master
mkoszutowski Apr 7, 2020
dd70c76
WIP - github actions - deploy only for master
mkoszutowski Apr 7, 2020
63ce13a
Use version 0.1.0 of preview-deploy
mkoszutowski Apr 7, 2020
8878b54
Merge branch 'master' into feature/commit_preview_on_storefrontcloud
andrzejewsky Apr 10, 2020
c7a7ba9
fix start
andrzejewsky Apr 10, 2020
852eef5
Merge branch 'feature/commit_preview_on_storefrontcloud' of github.co…
andrzejewsky Apr 10, 2020
24b24a5
Changed host and port for nuxt
mkoszutowski Apr 10, 2020
a466179
Changed host and port for nuxt
mkoszutowski Apr 10, 2020
2ecbe90
Added expose to dockerfile
mkoszutowski Apr 10, 2020
2e9de39
Added expose to dockerfile
mkoszutowski Apr 10, 2020
6a8528e
WIP - test if config file is used
mkoszutowski Apr 10, 2020
1dfe061
Back to previous configuration
mkoszutowski Apr 10, 2020
1d1f110
Maybe localhost will work
mkoszutowski Apr 10, 2020
ecbacc2
Probably 0.0.0.0 work
mkoszutowski Apr 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/deploy-preview-storefrontcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Deploy PR Preview on Storefrontcloud
on:
pull_request:
types: [opened, synchronize]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Build and publish docker image
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: vsf-next-demo-storefrontcloud-io/vue-storefront:${{ github.sha }}
registry: registry.storefrontcloud.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: dev/docker/Dockerfile
buildoptions: "--compress"
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
environment: preview
initial_status: in_progress
- name: Deploy on Storefrontcloud.io
id: deploy
uses: storefrontcloud/storefrontcloud-preview-deploy@0.1.0
with:
token: "${{ github.token }}"
namespace: "vsf-next-demo"
username: ${{ secrets.CLOUD_USERNAME }}
password: ${{ secrets.CLOUD_PASSWORD }}
- name: Comment PR
if: success()
uses: storefrontcloud/storefrontcloud-comment-pr-preview-deploy@master
with:
preview_url: '${{ steps.deploy.outputs.preview_url }}'
token: "${{ github.token }}"
namespace: 'vsf-next-demo'
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: ${{ steps.deploy.outputs.preview_url }}
state: "success"
description: Congratulations! The deploy is done.
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
description: Unfortunately, the instance hasn't been updated.
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
62 changes: 62 additions & 0 deletions .github/workflows/deploy-storefrontcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy to Storefrontcloud
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Build and publish docker image
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: vsf-next-demo-storefrontcloud-io/vue-storefront:${{ github.sha }}
registry: registry.storefrontcloud.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: dev/docker/Dockerfile
buildoptions: "--compress"
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
target_url: https://vsf-next-demo.storefrontcloud.io
environment: production
initial_status: in_progress
- name: Deploy on Storefrontcloud.io
run: |
if curl -s -u ${{ secrets.CLOUD_USERNAME }}:${{ secrets.CLOUD_PASSWORD }} -H 'Content-Type: application/json' -X POST -d '{"code":"vsf-next-demo","frontContainerVersion":"${{ github.sha }}"}' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then
echo "Instance updated"
else
echo "Something went wrong during the update process..."
exit 1
fi
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: https://vsf-next-demo.storefrontcloud.io
state: "success"
description: Congratulations! The deploy is done.
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: https://vsf-next-demo.storefrontcloud.io
description: Unfortunately, the instance hasn't been updated.
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
35 changes: 18 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,22 @@ jobs:
# - stage: lighthouse
# name: commercetools
# script: lhci autorun --rc-overrides.upload.target=temporary-public-storage --collect.startServerCommand="yarn start:ct" --collect.url=http://localhost:3000 --collect.startServerReadyPattern="Listening"

# - build_image:
# if: type = pull_request
# name: "Build docker image"
# stage: docker build
# script:
# - docker build --build-arg COMMIT -t registry.storefrontcloud.io/vsf-next-demo-storefrontcloud-io/vue-storefront:$COMMIT -f dev/docker/Dockerfile .
# - echo $DOCKER_PASSWORD | docker login -u="$DOCKER_USERNAME" --password-stdin registry.storefrontcloud.io
# - docker push registry.storefrontcloud.io/vsf-next-demo-storefrontcloud-io/vue-storefront:$COMMIT
# - curl $COMMIT.vsf-next-demo.preview.storefrontcloud.io
# - echo "This commit preview is available here $COMMIT.vsf-next-demo.preview.storefrontcloud.io"

# - deploy_to_storefrontcloud:
# if: branch = master AND type != pull_request
# name: "Deploy to StorefrontCloud"
# stage: deploy
# script:
# - "curl -u $CLOUD_USERNAME:$CLOUD_PASSWORD -H 'Content-Type: application/json' -X POST -d \"{\\\"code\\\":\\\"vsf-next-demo\\\", \\\"frontContainerVersion\\\":\\\"$COMMIT\\\"}\" https://farmer.storefrontcloud.io/instances"

- build_image:
if: branch = master AND type != pull_request
name: "Build docker image"
stage: docker build
script:
- docker build --build-arg COMMIT -t registry.storefrontcloud.io/vsf-next-demo-storefrontcloud-io/vue-storefront:$COMMIT -f dev/docker/Dockerfile .
- echo $DOCKER_PASSWORD | docker login -u="$DOCKER_USERNAME" --password-stdin registry.storefrontcloud.io
- docker push registry.storefrontcloud.io/vsf-next-demo-storefrontcloud-io/vue-storefront:$COMMIT
- curl $COMMIT.vsf-next-demo.preview.storefrontcloud.io
- echo "This commit preview is available here $COMMIT.vsf-next-demo.preview.storefrontcloud.io"

- deploy_to_storefrontcloud:
if: branch = master AND type != pull_request
name: "Deploy to StorefrontCloud"
stage: deploy
script:
- "curl -u $CLOUD_USERNAME:$CLOUD_PASSWORD -H 'Content-Type: application/json' -X POST -d \"{\\\"code\\\":\\\"vsf-next-demo\\\", \\\"frontContainerVersion\\\":\\\"$COMMIT\\\"}\" https://farmer.storefrontcloud.io/instances"
2 changes: 2 additions & 0 deletions dev/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ RUN yarn install \

COPY dev/docker/vue-storefront.sh /usr/local/bin/

EXPOSE 3000

ENTRYPOINT ["vue-storefront.sh"]