ScandiPWA
Create Magento AppCreate ScandiPWA AppUser ManualGitHub
  • Why Scandi
  • πŸš€Quick-start Guide
  • πŸ—ΊοΈRoadmap
  • Introduction to the Stack
    • CMA, CSA, and ScandiPWA
    • Challenges
  • Setting up Scandi
    • Storefront Mode Setup
      • Proxying requests to server
    • Magento Mode Setup
    • Existing Magento 2 setup
    • Magento Commerce Cloud setup
    • Updating to new releases
      • Storefront mode upgrade
      • Magento mode upgrade
      • CMA upgrade
      • CSA upgrade
      • Custom ScandiPWA composer dependency update
      • Local ScandiPWA Composer Package Setup
    • Docker Setup [deprecated]
      • Legacy Docker setup
      • Migrating to CMA & CSA
  • Developing with Scandi
    • Override Mechanism
      • Overriding JavaScript
        • Overriding classes
        • Overriding non-classes
      • Overriding Styles
      • Overriding the HTML / PHP
      • Parent Themes
    • Extensions
      • Creating an extension
      • Installing an extension
      • Migrating from 3.x to 4.x
      • Publishing an extension
      • Extension Terminology
    • Working With Magento
      • Magento troubleshooting
      • Working with Magento modules
      • Working with GraphQL
      • GraphQL Security
      • Working with "granular cache"
    • Developer Tools
      • Debugging in VSCode
      • ScandiPWA CLI
      • Configuring ESLint
      • CSA Commands
    • Deploying Your App
      • Build & Deploy Android app
      • Build & Deploy iOS app
  • Structure
    • Directory Structure
    • Building Blocks
      • Components
        • Styling Components
      • Routes
      • Redux Stores
      • GraphQL Queries
      • Global Styles
      • The Util Directory
      • Type Checking
    • Application assets
    • Code Style
      • JavaScript Code Style
      • SCSS Code Style
  • Tutorials
    • Customizing Your Theme
      • Styling
        • Customizing the Global Styles
        • Adding a New Font
        • Overriding a Components Styles
        • Extending a Component's Styles
      • Customizing JavaScript
        • Customizing the Footer Copyright
        • Adding a New Page
        • Adding a Section in My Account
        • Adding a Tab on the Product Page
        • Creating a New Redux Store
    • Payment Method Integration
      • Setting Up for Development
      • Redirecting to the Payment Provider
      • Handling the Customer's Return
    • Creating a Custom Widget
      • Scandi CMS System Overview
      • Creating a Magento Widget
      • Implementing the Rendering
    • Video Tutorials
      • #1 Setting up and talking theory
      • #2 Templating in React
      • #3 Overriding a file
      • #4 Styling the application
      • #5 Patterns of ScandiPWA
    • Dark Mode Extension
    • Deploying Native Apps
    • Product 3D Model Extension
      • Part 1: Magento 3D Model Uploads
      • Part 2: GraphQL API
      • Part 3: Scandi Frontend
    • Social Share, Full Extension Development
      • STEP-1 and 2 Creating Magento 2 Module
      • STEP-3 Backend Configurations Settings
      • STEP-4 Simple GraphQl and Resolver
      • STEP-5 Creating Extension, Base Redux Store
      • STEP-6 Extension plugins
      • STEP-7 GraphQL types, Helpers
      • STEP-8 Query Field and FieldList
      • STEP-9 render Plugins and MSTP Plugin, Component creation
      • STEP-10 SocialShare Component Development
      • STEP-11 SocialShare for CategoryPage
      • TASK-1 Changing LinkedIn to Twitter
      • STEP-12 Comments for Admin Users
      • STEP-13 Final, bugfixes
    • Accessing Magento 2 Controllers
      • STEP-1 Creating Magento 2 Module
      • STEP-2 - Create Magento 2 Frontend Route and Basic Controller
      • STEP-3 Accessing Magento 2 Controller, Bypassing ScandiPWA frontend
      • STEP-4 Creating ScandiPWA Extension with additional dependencies
      • STEP-5 Creating Plugin and Axios request
  • About
    • Support
    • Release notes
    • Technical Information
    • Data Analytics
    • Contributing
      • Installation from Fork
      • Repository structure
      • Code contribution process
      • Submitting an Issue
      • Publishing ScandiPWA
Powered by GitBook
On this page
  • bitbucket-pipelines.yaml
  • magento.app.yaml

Was this helpful?

  1. Setting up Scandi

Magento Commerce Cloud setup

PreviousExisting Magento 2 setupNextUpdating to new releases

Last updated 4 years ago

Was this helpful?

Alternatively to Magento Commerce Cloud consider using . ReadyMage is ScandiPWA optimized cloud hosting and supports Magento Commerce projects.

ScandiPWA setup on Magento Commerce Cloud requires adjusting 2 files in the project root folder that are used for deployment flow.

bitbucket-pipelines.yaml

Requires adjustments to allow pushing code from BitBucket of the git repository to Magento Cloud project repository. CI/CD is used for this purpose. Git authentication is made using public keys. Generate the key in the BitBucket repository and add it to the Magento Cloud in the admin panel.

Here is an example of how the bitbucket-pipelines.yaml file should be configured. It contains configuration for 2 environments:

  • production (using master branch);

  • stage (using stage branch).

Replace example credentials and git links with your project actual links.

pipelines:
  branches:
    master:
      - step:
          image: luzhzh/git-client
          script:
            - set -e
            - set -o pipefail
            - git clone --branch master git@bitbucket.org:exampleorganization/exampleproject.git exampleproject
            - cd exampleproject/
            - git config --global user.email "exampleemail@example.com"
            - git config --global user.name "Deploy Script"
            - git remote add mc example@git.eu-5.magento.cloud:example.git
            - git pull --no-edit mc master
            - git push mc master
            - cd ../
            - rm -rf exampleproject.git/
    stage:
      - step:
          image: luzhzh/git-client
          script:
            - set -e
            - set -o pipefail
            - git clone --branch stage git@bitbucket.org:exampleorganization/exampleproject.git exampleproject
            - cd exampleproject/
            - git config --global user.email "exampleemail@example.com"
            - git config --global user.name "Deploy Script"
            - git remote add mc example@git.eu-5.magento.cloud:example.git
            - git pull --no-edit mc stage
            - git push mc stage
            - cd ../
            - rm -rf exampleproject.git/
definitions:
  caches:
    node-custom: app/design/frontend/ExampleProject/pwa/node_modules

magento.app.yaml

ScandiPWA compilation is done in magento.app.yaml file. Within it options and commands are configured to be run during deployment.

Here is part of the file that is responsible for ScandiPWA compilation which has to be added to the existing magento.app.yaml file content.

hooks:
    # We run build hooks before your application has been packaged.
    build: |
        set -e

        git apply m2-patches/*.patch

        unset NPM_CONFIG_PREFIX
        curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | dash
        export NVM_DIR="$HOME/.nvm"
        [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
        nvm current
        nvm install 12.16.1

        (cd ./app/design/frontend/ExampleProject/pwa/ && rm -rf node_modules && npm ci)
        (cd ./app/design/frontend/ExampleProject/pwa/ && npm run build)

        php ./vendor/bin/ece-tools run scenario/build/generate.xml
        php ./vendor/bin/ece-tools run scenario/build/transfer.xml
    # We run deploy hook after your application has been deployed and started.
    deploy: |
        php ./vendor/bin/ece-tools run scenario/deploy.xml
    # We run post deploy hook to clean and warm the cache. Available with ECE-Tools 2002.0.10.
    post_deploy: |
        php ./vendor/bin/ece-tools run scenario/post-deploy.xml
ReadyMage