Skip to content

Sample Azure Pipeline to deploy a Shopify App (including caching and Rust based functions)

License

Notifications You must be signed in to change notification settings

limoniapps/azure-pipeline-shopify-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Azure DevOps Pipeline for Shopify Apps

Purpose

This repository provides a sample Azure DevOps pipeline (azure-pipelines.yml) that can be used as a starting point to deploy a Shopify App.

Assumptions

  • The pipeline assumes you're using npm as the package manager.
  • The pipeline assumes you've selected Rust to code your functions (if any).
  • The pipeline assumes you have a package-lock.json file. It uses the hash of this file as part of the cache key. If you've selected to .gitignore this file, change the variable npmModulesCacheKey to package.json instead.

Steps

  • Add the azure-pipelines.yml file included in this repository to yours.
  • Add a secret variable named cliPartnerToken to your Azure DevOps pipeline as documented here.
  • Edit the azure-pipelines.yml file to set a value for the variables appClientId and functionFolders
  • Verify that your files are structured as explained in the folder structure below. If not, make the necessary adjustments in the azure-pipelines.yml file.

Expected folder structure

The pipeline assumes a folder structure similar to this:

├── azure-pipelines.yml
└── src
    ├── package.json
    ├── package-lock.json
    ├── .env
    ├── shopify.app.toml
    └── extensions
        ├── sample-function
        |   ├── src
        |   |   ├── .rs
        |   |   └── ...
        |   ├── Cargo.toml (note uppercase C)
        |   ├── cargo.lock (note lowercase c)
        |   └── shopify.function.extension.toml
        ├── extensions
        |   ├── assets
        |   ├── blocks
        |   ├── locales
        |   ├── snippets
        |   └── shopify.function.extension.toml
        └── ...

Cache

  • The pipeline caches the node_modules folder. The cache is automatically broken when the package-lock.json file is changed (cf. variable npmModulesCacheKey). To manually break the cache increment the variable npmModulesCacheVersion
  • The pipeline caches the output generated by cargo wasi. The cache is automatically broken when the cargo.toml file is changed (e.g. the package version parameter) or the cargo.lock file is changed (e.g. when a resolved dependency is changed). To manually break the cache increment the variable wasmCacheVersion

About

Sample Azure Pipeline to deploy a Shopify App (including caching and Rust based functions)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published