Magento Commerce Cloud setup
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).
pipelines:
branches:
master:
- step:
image: luzhzh/git-client
script:
- set -e
- set -o pipefail
- git clone --branch master [email protected]:exampleorganization/exampleproject.git exampleproject
- cd exampleproject/
- git config --global user.email "[email protected]"
- git config --global user.name "Deploy Script"
- git remote add mc [email protected]: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 [email protected]:exampleorganization/exampleproject.git exampleproject
- cd exampleproject/
- git config --global user.email "[email protected]"
- git config --global user.name "Deploy Script"
- git remote add mc [email protected]: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_modulesmagento.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.
Last updated
Was this helpful?