-
Notifications
You must be signed in to change notification settings - Fork 42
09. Examples
- Retrieve metadata by running
mcdev retrieve <BU>(where the BU corresponds to a credential-Business Unit combo in the .mcdevrc.json) - Create a directory called
deploy/in the root directory - Create a directory called
dataExtension/in thedeploy/directory - Copy a single dataExtension directory from the
retrieve/<credential>/<BU-Name>/dataExtension/directory intodeploy/<credential>/<BU-Name>/dataExtension/ - Run
mcdev deploy <BU>to deploy everything in the deploy folder to the specified Business Unit
Metadata of a Business Unit can be retrieved by running the following command:
mcdev retrieve <BU>
where <BU> needs to be replaced with credentialName/businessUnit-Name that is defined in .mcdevrc.json.
Run this command for each of your defined Business Units and this will result in a retrieve directory with a sub-directory for each Business Unit. Each sub-directory contains the metadata from this Business Unit that is currently supported to retrieve.
This folder structure can be committed into a git repository and used as a backup.
Now we want to deploy an Automation with its related metadata. Select a retrieved Automation and copy it into the deploy folder. (deploy/<credential>/<BU-Name>/automation/myAutomation.meta-automation.json)
Copy all related activity metadata of this automation into the deploy folder. (Example: deploy/<credential>/<BU-Name>/query/myquery.meta-query.json and deploy/<credential>/<BU-Name>/query/myquery.meta-query.sql)
To start the deployment run the following command:
mcdev deploy <BU>
The clone command provides a quick way to copy metadata from one BU to another:
# Clone a query from DEV to QA
mcdev clone --buFrom MyProject/DEV --buTo MyProject/QA -m query:myQuery
# Clone with all dependencies
mcdev clone --buFrom MyProject/DEV --buTo MyProject/QA -m automation:myAutomation --dependenciesManage journey lifecycle directly from the CLI:
# Retrieve only published journeys
mcdev retrieve MyProject/DEV journey --onlyPublished
# Pause a running journey
mcdev pause MyProject/DEV journey myJourneyKey
# Stop all versions of a journey
mcdev stop MyProject/DEV journey myJourneyKey/*
# Validate a draft journey
mcdev validate MyProject/DEV journey myJourneyKey
# Deploy and publish in one step
mcdev deploy MyProject/DEV journey --publishCopyright (c) 2020-2025 Accenture. MIT licensed. Main contributors: Jörn Berkefeld, Doug Midgley