In this article we will describe how you can add Mockstar to you CI/CD and automatically generate data in a new sandbox or scratch org.
Master Org #
1. Create your recipe.
2. In the recipe builder set Auto Load to true, so that loading will start immediately when a bread reaches Ready To Load.
3. Download the recipe as an Apex script
New Org #
1. Make sure that the Mockstar managed package is installed in the new org and that permission set `Mockstar User` has been assigned. Both can be implemented in your CI/CD scripts using the Salesforce CLI.:
sf package install --package "Mockstar@1.5.0-1" -w 120 -u MyOrg
sf org assign permset --name Mockstar_User --target-org my-scratch --on-behalf-of user1@my.org
2. Use the Salesforce CLI to run the downloaded script in your new org. This will import and activate the recipe.
sf apex run --file "my_amazing_recipe.apex" --target-org my-scratch
3. Use the Salesforce CLI to create a Bread rcord. This will run the recipe. In the script below change the recipe name and the number of slices.
sf data create record --sobject mockstar__Bread__c --values "mockstar__Recipe_Name__c='My_Amazing_Recipe' mockstar__Number_Of_Slices__c=100 mockstar__Status__c='Start Slicing'" --target-org my-scratch