mcdev 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -1
- package/.github/ISSUE_TEMPLATE/bug.yml +72 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/ISSUE_TEMPLATE/task.md +10 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +11 -0
- package/.github/workflows/npm-publish.yml +33 -0
- package/.issuetracker +11 -3
- package/.vscode/extensions.json +1 -2
- package/.vscode/settings.json +19 -4
- package/CHANGELOG.md +98 -0
- package/README.md +247 -142
- package/boilerplate/config.json +3 -2
- package/docs/dist/considerations.md +66 -0
- package/docs/dist/documentation.md +5794 -0
- package/lib/Deployer.js +4 -1
- package/lib/MetadataTypeDefinitions.js +1 -0
- package/lib/MetadataTypeInfo.js +1 -0
- package/lib/Retriever.js +32 -17
- package/lib/cli.js +295 -0
- package/lib/index.js +774 -1019
- package/lib/metadataTypes/AccountUser.js +389 -0
- package/lib/metadataTypes/Asset.js +140 -116
- package/lib/metadataTypes/Automation.js +119 -54
- package/lib/metadataTypes/DataExtension.js +172 -131
- package/lib/metadataTypes/DataExtensionField.js +134 -4
- package/lib/metadataTypes/Folder.js +66 -69
- package/lib/metadataTypes/ImportFile.js +4 -6
- package/lib/metadataTypes/MetadataType.js +168 -80
- package/lib/metadataTypes/Query.js +54 -25
- package/lib/metadataTypes/Role.js +13 -8
- package/lib/metadataTypes/Script.js +43 -24
- package/lib/metadataTypes/definitions/AccountUser.definition.js +227 -0
- package/lib/metadataTypes/definitions/Asset.definition.js +1 -0
- package/lib/metadataTypes/definitions/Campaign.definition.js +1 -1
- package/lib/metadataTypes/definitions/DataExtension.definition.js +1 -1
- package/lib/metadataTypes/definitions/DataExtensionField.definition.js +1 -1
- package/lib/metadataTypes/definitions/Folder.definition.js +1 -1
- package/lib/metadataTypes/definitions/ImportFile.definition.js +2 -1
- package/lib/metadataTypes/definitions/Script.definition.js +5 -5
- package/lib/retrieveChangelog.js +96 -0
- package/lib/util/cli.js +4 -6
- package/lib/util/init.config.js +3 -0
- package/lib/util/init.git.js +2 -1
- package/lib/util/util.js +35 -18
- package/package.json +20 -24
- package/test/util/file.js +51 -0
- package/img/README.md/troubleshoot-nodejs-postinstall.jpg +0 -0
- package/postinstall.js +0 -41
- package/test/deployer.js +0 -16
- package/test/util.js +0 -26
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
# Accenture SFMC DevTools
|
|
1
2
|
|
|
2
3
|
<a id="markdown-accenture-sfmc-devtools" name="accenture-sfmc-devtools"></a>
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/mcdev)
|
|
5
6
|
|
|
6
7
|
Accenture Salesforce Marketing Cloud DevTools (mcdev) is a rapid deployment/rollout, backup and development tool for Salesforce Marketing Cloud. It allows you to retrieve and deploy configuration and code across Business Units and instances.
|
|
7
8
|
|
|
@@ -16,6 +17,7 @@ Accenture Salesforce Marketing Cloud DevTools (mcdev) is a rapid deployment/roll
|
|
|
16
17
|
- [2.3. Initial project setup](#23-initial-project-setup)
|
|
17
18
|
- [2.4. Joining a project that was set up before](#24-joining-a-project-that-was-set-up-before)
|
|
18
19
|
- [2.5. Recommended additional installs](#25-recommended-additional-installs)
|
|
20
|
+
- [2.6 Using mcdev in other node packages](#26-using-mcdev-in-other-node-packages)
|
|
19
21
|
- [3. Updating Accenture SFMC DevTools](#3-updating-accenture-sfmc-devtools)
|
|
20
22
|
- [4. Troubleshoot Install/Update](#4-troubleshoot-installupdate)
|
|
21
23
|
- [4.1. Installing specific version](#41-installing-specific-version)
|
|
@@ -43,14 +45,16 @@ Accenture Salesforce Marketing Cloud DevTools (mcdev) is a rapid deployment/roll
|
|
|
43
45
|
- [6.2.7. createDeltaPkg](#627-createdeltapkg)
|
|
44
46
|
- [7. Advanced Configuration](#7-advanced-configuration)
|
|
45
47
|
- [7.1. Config Options](#71-config-options)
|
|
46
|
-
- [7.2. Metadata specific settings](#72-metadata-specific-settings)
|
|
48
|
+
- [7.2. Metadata specific settings & options](#72-metadata-specific-settings--options)
|
|
47
49
|
- [7.2.1. Retention Policy fields in Data Extensions](#721-retention-policy-fields-in-data-extensions)
|
|
50
|
+
- [7.2.2. Adding/Updating Fields on existing Data Extensions](#722-addingupdating-fields-on-existing-data-extensions)
|
|
51
|
+
- [7.2.3. Renaming fields of a Data Extensions](#723-renaming-fields-of-a-data-extensions)
|
|
52
|
+
- [7.3. Market Configuration](#73-market-configuration)
|
|
53
|
+
- [7.4. Market List Configuration](#74-market-list-configuration)
|
|
48
54
|
- [8. Examples](#8-examples)
|
|
49
55
|
- [8.1. Retrieve and deploy Data Extension](#81-retrieve-and-deploy-data-extension)
|
|
50
56
|
- [8.2. Metadata Retrieving/Backup](#82-metadata-retrievingbackup)
|
|
51
57
|
- [8.3. Automation Deployment](#83-automation-deployment)
|
|
52
|
-
- [8.4. Market Configuration](#84-market-configuration)
|
|
53
|
-
- [8.5. Market List Configuration](#85-market-list-configuration)
|
|
54
58
|
- [9. Contribute](#9-contribute)
|
|
55
59
|
- [9.1. Install Guide for Developers](#91-install-guide-for-developers)
|
|
56
60
|
- [9.2. Local install](#92-local-install)
|
|
@@ -59,28 +63,28 @@ Accenture Salesforce Marketing Cloud DevTools (mcdev) is a rapid deployment/roll
|
|
|
59
63
|
|
|
60
64
|
<!-- /TOC -->
|
|
61
65
|
|
|
62
|
-
<a id="markdown-1-changelog" name="1-changelog"></a>
|
|
63
|
-
|
|
64
66
|
## 1. Changelog
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
<a id="markdown-changelog" name="changelog"></a>
|
|
67
69
|
|
|
68
|
-
|
|
70
|
+
Find info on the latest changes in our [Changelog](CHANGELOG.md).
|
|
69
71
|
|
|
70
72
|
## 2. Getting Started
|
|
71
73
|
|
|
74
|
+
<a id="markdown-getting-started" name="getting-started"></a>
|
|
75
|
+
|
|
72
76
|
Accenture SFMC DevTools can be installed as Node.JS package. The following guide will demonstrate how you can get started within 10 minutes or less.
|
|
73
77
|
|
|
74
78
|
<a name="pre-requisites"></a>
|
|
75
79
|
|
|
76
|
-
<a id="markdown-21-pre-requisites" name="21-pre-requisites"></a>
|
|
77
|
-
|
|
78
80
|
### 2.1. Pre-requisites
|
|
79
81
|
|
|
80
|
-
<a id="markdown-
|
|
82
|
+
<a id="markdown-pre-requisites" name="pre-requisites"></a>
|
|
81
83
|
|
|
82
84
|
#### 2.1.1. Install Node.js with npm
|
|
83
85
|
|
|
86
|
+
<a id="markdown-install-node.js-with-npm" name="install-node.js-with-npm"></a>
|
|
87
|
+
|
|
84
88
|
1. To check if it is already installed, at the OS command prompt, type: `node --version`
|
|
85
89
|
- If this command reports Node version 14.16.x or later, you’re done—proceed to the next installation. If the reported version is earlier than 14.16.x, continue to step 2.
|
|
86
90
|
- If you get a “command not found” error message, continue to step 2.
|
|
@@ -88,10 +92,10 @@ Accenture SFMC DevTools can be installed as Node.JS package. The following guide
|
|
|
88
92
|
3. Download and run the latest **LTS** installer for your operating system.
|
|
89
93
|
4. When the installer finishes, try step 1 again. If it fails, please restart your terminal. If it still does not work, reboot your computer and try the version check then.
|
|
90
94
|
|
|
91
|
-
<a id="markdown-212-install-the-git-command-line" name="212-install-the-git-command-line"></a>
|
|
92
|
-
|
|
93
95
|
#### 2.1.2. Install the Git Command Line
|
|
94
96
|
|
|
97
|
+
<a id="markdown-install-the-git-command-line" name="install-the-git-command-line"></a>
|
|
98
|
+
|
|
95
99
|
1. To check if git is already installed, at the OS command prompt, type: `git version`
|
|
96
100
|
- If this command reports a git version such as “git version 2.31.0” (or "git version 2.31.0.windows.1" on Windows), you’re done. Proceed to native Android or iOS environment setup.
|
|
97
101
|
- If you get a “command not found” error message, continue to step 2.
|
|
@@ -102,10 +106,10 @@ Accenture SFMC DevTools can be installed as Node.JS package. The following guide
|
|
|
102
106
|
|
|
103
107
|
<a name="install-mcdev"></a>
|
|
104
108
|
|
|
105
|
-
<a id="markdown-22-install-accenture-sfmc-devtools" name="22-install-accenture-sfmc-devtools"></a>
|
|
106
|
-
|
|
107
109
|
### 2.2. Install Accenture SFMC DevTools
|
|
108
110
|
|
|
111
|
+
<a id="markdown-install-accenture-sfmc-devtools" name="install-accenture-sfmc-devtools"></a>
|
|
112
|
+
|
|
109
113
|
If you experience issues installing Accenture SFMC DevTools, please check out the [Troubleshoot Install/Update](#troubleshoot-installupdate) section in this manual.
|
|
110
114
|
|
|
111
115
|
**How to:**
|
|
@@ -121,12 +125,10 @@ When completed you will see `+ mcdev@3.0.0` printed to your screen (or the curre
|
|
|
121
125
|
>
|
|
122
126
|
> You may choose to install mcdev globally or locally. Global install runs faster and allows you to initialize new projects by running `mcdev init` in any directory. If your project does require a local installation, please refer to the [Local Install Guide](#local-install).
|
|
123
127
|
|
|
124
|
-
<a name="initial-project-setup"></a>
|
|
125
|
-
|
|
126
|
-
<a id="markdown-23-initial-project-setup" name="23-initial-project-setup"></a>
|
|
127
|
-
|
|
128
128
|
### 2.3. Initial project setup
|
|
129
129
|
|
|
130
|
+
<a id="markdown-initial-project-setup" name="initial-project-setup"></a>
|
|
131
|
+
|
|
130
132
|
After the successful installation, you will now need to setup the connection to your Marketing Cloud instance.
|
|
131
133
|
|
|
132
134
|
1. In your Marketing Cloud instance
|
|
@@ -151,16 +153,16 @@ After the successful installation, you will now need to setup the connection to
|
|
|
151
153
|
3. If this is the first time you set up Accenture SFMC DevTools or you recently upgraded Accenture SFMC DevTools, please restart VS Code now! A pop-up will likely appear in the lower right corner prompting you to install recommended extensions.
|
|
152
154
|
4. Done.
|
|
153
155
|
3. Sharing the project with your team
|
|
154
|
-
1. Make sure you have a Git repo (Bitbucket, GitHub, GitLab) set up somewhere.
|
|
156
|
+
1. Make sure you have a Git repo (Bitbucket, GitHub, GitLab) set up somewhere. If you are an SI partner, usually, your client will have to do this for you.
|
|
155
157
|
> While running `mcdev init`, the tool already made sure to set up a local Git repo for you. Now, you need to upload ("push") it to the online repo:
|
|
156
158
|
2. Open the URL of your online repo and find the "CLONE" button. This will likely show you a normal URL, ending on ".git"
|
|
157
159
|
3. Add this as your repository remote named "origin". If you use a GUI based tool, that should be fairly simple, otherwise execute `git remote add origin YOUR-URL` in your project folder.
|
|
158
160
|
4. Now run `git push -u origin master` to actually start the upload.
|
|
159
161
|
|
|
160
|
-
<a id="markdown-24-joining-a-project-that-was-set-up-before" name="24-joining-a-project-that-was-set-up-before"></a>
|
|
161
|
-
|
|
162
162
|
### 2.4. Joining a project that was set up before
|
|
163
163
|
|
|
164
|
+
<a id="markdown-joining-a-project-that-was-set-up-before" name="joining-a-project-that-was-set-up-before"></a>
|
|
165
|
+
|
|
164
166
|
If Accenture SFMC DevTools was already used to set up the project by somebody in your team, including all of the steps in the above chapter [Initial project configuration](#initial-project-setup), then basically you are in luck. Things are much faster from here on:
|
|
165
167
|
|
|
166
168
|
1. Make sure you went through the chapters [Pre-requisites](#pre-requisites) and [Install Accenture SFMC DevTools](#install-mcdev). Do skip [Initial project configuration](#initial-project-setup)!
|
|
@@ -173,10 +175,10 @@ If Accenture SFMC DevTools was already used to set up the project by somebody in
|
|
|
173
175
|
7. At this point the system will recognize the previously set up project and ask you for `Client ID`, `Client Secret` and the `Authentication Base URI`.
|
|
174
176
|
8. Done.
|
|
175
177
|
|
|
176
|
-
<a id="markdown-25-recommended-additional-installs" name="25-recommended-additional-installs"></a>
|
|
177
|
-
|
|
178
178
|
### 2.5. Recommended additional installs
|
|
179
179
|
|
|
180
|
+
<a id="markdown-recommended-additional-installs" name="recommended-additional-installs"></a>
|
|
181
|
+
|
|
180
182
|
The following seeks to enhance your daily process. Our guide assumes that you are using [Visual Studio Code](https://code.visualstudio.com/download) to develop, backup and deploy your project. For smooth operations we highly recommend the following Marketing Cloud specific plugins for it.
|
|
181
183
|
|
|
182
184
|
Nevertheless, Accenture SFMC DevTools will run without them and is not associated with the development of these publicly available apps & plugins.
|
|
@@ -212,12 +214,34 @@ Please note that Visual Studio Code might warn you about using the local install
|
|
|
212
214
|
|
|
213
215
|

|
|
214
216
|
|
|
215
|
-
|
|
217
|
+
### 2.6 Using mcdev in other node packages
|
|
218
|
+
|
|
219
|
+
Install it locally first via the following (or with a [specific version](#41-installing-specific-version)):
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
npm install --save mcdev
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
And then require it in your code:
|
|
216
226
|
|
|
217
|
-
|
|
227
|
+
```javascript
|
|
228
|
+
const mcdev = require('mcdev');
|
|
229
|
+
|
|
230
|
+
// download all metadata from your instance's Parent BU
|
|
231
|
+
mcdev.retrieve('MyCredential/_ParentBU_');
|
|
232
|
+
|
|
233
|
+
// or download all metadata from your instance's Parent BU
|
|
234
|
+
mcdev.retrieve('MyCredential/_ParentBU_', 'dataExtension');
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
For more details on the available methods look out for what Intellisense will return or refer to the [developer documentation](docs/dist/documentation.md).
|
|
238
|
+
|
|
239
|
+
<a name="updating-mcdev"></a>
|
|
218
240
|
|
|
219
241
|
## 3. Updating Accenture SFMC DevTools
|
|
220
242
|
|
|
243
|
+
<a id="markdown-updating-accenture-sfmc-devtools" name="updating-accenture-sfmc-devtools"></a>
|
|
244
|
+
|
|
221
245
|
If you have mcdev already installed you can update your installation in a simplified way:
|
|
222
246
|
|
|
223
247
|
```bash
|
|
@@ -226,44 +250,46 @@ npm update -g mcdev
|
|
|
226
250
|
|
|
227
251
|
<a name="troubleshoot-installupdate"></a>
|
|
228
252
|
|
|
229
|
-
<a id="markdown-4-troubleshoot-installupdate" name="4-troubleshoot-installupdate"></a>
|
|
230
|
-
|
|
231
253
|
## 4. Troubleshoot Install/Update
|
|
232
254
|
|
|
233
|
-
<a id="markdown-
|
|
255
|
+
<a id="markdown-troubleshoot-install%2Fupdate" name="troubleshoot-install%2Fupdate"></a>
|
|
234
256
|
|
|
235
257
|
### 4.1. Installing specific version
|
|
236
258
|
|
|
259
|
+
<a id="installing-specific-version" name="installing-specific-version"></a>
|
|
260
|
+
|
|
237
261
|
To work with our **developer-version** or to install a **specific older version** you can select any branch or tag from our git repository during install to do so:
|
|
238
262
|
|
|
239
|
-
|
|
240
|
-
// most recent developer version (using the branch name)
|
|
241
|
-
npm install -g mcdev@develop
|
|
263
|
+
**Most recent developer version (using the GitHub repo & branch name):**
|
|
242
264
|
|
|
243
|
-
|
|
244
|
-
npm install -g
|
|
265
|
+
```bash
|
|
266
|
+
npm install -g accenture/sfmc-devtools#develop
|
|
245
267
|
```
|
|
246
268
|
|
|
247
|
-
**
|
|
269
|
+
**Install specific version (using a version tag on npm):**
|
|
248
270
|
|
|
249
|
-
|
|
271
|
+
```bash
|
|
272
|
+
npm install -g mcdev@3.1.0
|
|
273
|
+
```
|
|
250
274
|
|
|
251
|
-
|
|
275
|
+
**Warning**: When you used the above method to install Accenture SFMC DevTools for a specific version or tag, trying to [update Accenture SFMC DevTools](#updating-mcdev) might not download the most recently published official version but instead stay on the version or branch you previously selected (in the above examples: develop, 3.1.0)!
|
|
252
276
|
|
|
253
|
-
|
|
277
|
+
> **Note**: The version is currently _not_ updated on the developer branch until a new release is published. Hence, you will not see a change if you run `mcdev --version`.
|
|
254
278
|
|
|
255
279
|
### 4.2. Using custom CLIs
|
|
256
280
|
|
|
281
|
+
<a id="markdown-using-custom-clis" name="using-custom-clis"></a>
|
|
282
|
+
|
|
257
283
|
Some users of Accenture SFMC DevTools prefer to use git bash or other CLIs instead of the operating system's default. Please note that some of the functionality of Accenture SFMC DevTools but also of other tools like the Node package manager (npm) do not necessarily function properly in these.
|
|
258
284
|
|
|
259
285
|
If you encounter problems, we strongly recommend to first try it in the default CLI.
|
|
260
286
|
|
|
261
287
|
<a name="missing-write-access-toon-macos"></a>
|
|
262
288
|
|
|
263
|
-
<a id="markdown-43-missing-write-access-toon-macos" name="43-missing-write-access-toon-macos"></a>
|
|
264
|
-
|
|
265
289
|
### 4.3. Missing write access to...on MacOS
|
|
266
290
|
|
|
291
|
+
<a id="markdown-missing-write-access-to...on-macos" name="missing-write-access-to...on-macos"></a>
|
|
292
|
+
|
|
267
293
|
Depending on your setup, the default global installs & updates might error out with "Missing write access to /usr/local/lib/node_modules". In this case prefix your command with `sudo`:
|
|
268
294
|
|
|
269
295
|
```bash
|
|
@@ -276,10 +302,10 @@ sudo npm update -g mcdev
|
|
|
276
302
|
|
|
277
303
|

|
|
278
304
|
|
|
279
|
-
<a id="markdown-44-running-scripts-is-disabled-on-this-system" name="44-running-scripts-is-disabled-on-this-system"></a>
|
|
280
|
-
|
|
281
305
|
### 4.4. ...running scripts is disabled on this system
|
|
282
306
|
|
|
307
|
+
<a id="markdown-...running-scripts-is-disabled-on-this-system" name="...running-scripts-is-disabled-on-this-system"></a>
|
|
308
|
+
|
|
283
309
|
If you see the below error then your system's security settings are rather strict.
|
|
284
310
|
|
|
285
311
|

|
|
@@ -294,21 +320,17 @@ Steps to solve this:
|
|
|
294
320
|
|
|
295
321
|
Please note that this change is global and not just for your current folder.
|
|
296
322
|
|
|
297
|
-
<a id="markdown-45-operation-not-permitted-or-no-such-file-or-directory" name="45-operation-not-permitted-or-no-such-file-or-directory"></a>
|
|
298
|
-
|
|
299
323
|
### 4.5. Operation not permitted OR No such file or directory
|
|
300
324
|
|
|
325
|
+
<a id="markdown-operation-not-permitted-or-no-such-file-or-directory" name="operation-not-permitted-or-no-such-file-or-directory"></a>
|
|
326
|
+
|
|
301
327
|
If you encounter out of the 3 following errors you will have to completely remove Node.JS and install it again afterwards.
|
|
302
328
|
|
|
303
329
|
**Error 1:** Cannot find module index.js
|
|
304
330
|
|
|
305
331
|

|
|
306
332
|
|
|
307
|
-
**Error 2:**
|
|
308
|
-
|
|
309
|
-

|
|
310
|
-
|
|
311
|
-
**Error 3:** Operation not permitted
|
|
333
|
+
**Error 2:** Operation not permitted
|
|
312
334
|
|
|
313
335
|

|
|
314
336
|
|
|
@@ -344,10 +366,10 @@ Now, please follow the guides above in the [Pre-requisites](#pre-requisites) sec
|
|
|
344
366
|
|
|
345
367
|
<a name="metadata-type-support"></a>
|
|
346
368
|
|
|
347
|
-
<a id="markdown-5-metadata-type-support" name="5-metadata-type-support"></a>
|
|
348
|
-
|
|
349
369
|
## 5. Metadata Type Support
|
|
350
370
|
|
|
371
|
+
<a id="markdown-metadata-type-support" name="metadata-type-support"></a>
|
|
372
|
+
|
|
351
373
|
The following metadata types are currently supported:
|
|
352
374
|
|
|
353
375
|
| MetadataType | CLI Argument | Retrieve | Deploy | Template | Retrieved by Default | Description |
|
|
@@ -377,11 +399,12 @@ The following metadata types are currently supported:
|
|
|
377
399
|
| List | `list` | Yes | in backlog | - | Yes | Old way of storing data. Still used for central Email Subscriber DB. |
|
|
378
400
|
| Role | `role` | Yes | Yes | - | Yes | User Roles define groups that are used to grant users access to SFMC systems. |
|
|
379
401
|
| Triggered Send | `triggeredSendDefinition` | Yes | Yes | - | Yes | **DEPRECATED**: Sends emails via API or DataExtension Event. |
|
|
380
|
-
|
|
381
|
-
<a id="markdown-6-command-overview" name="6-command-overview"></a>
|
|
402
|
+
| User | `accountUser` | Yes | in backlog | - | - | Users and Installed Packages including their assigned Roles, BUs and personal permissions |
|
|
382
403
|
|
|
383
404
|
## 6. Command Overview
|
|
384
405
|
|
|
406
|
+
<a id="markdown-command-overview" name="command-overview"></a>
|
|
407
|
+
|
|
385
408
|
If you installed mcdev globally as described above you can run mcdev in any directory. See our [install Accenture SFMC DevTools](#install-mcdev) chapter for more details.
|
|
386
409
|
|
|
387
410
|
_Example (global install):_
|
|
@@ -404,16 +427,14 @@ _Note:_ Parameters listed below in between square brackets = `[...]` are optiona
|
|
|
404
427
|
|
|
405
428
|
_Note:_ Credentials and Business Unit names can always be selected interactively. Try inputing a questionmark = `?` in their place if more parameters follow, or omit them completely if no other parameters are required for a command.
|
|
406
429
|
|
|
407
|
-
<a id="markdown-61-maintenance-and-setup-commands" name="61-maintenance-and-setup-commands"></a>
|
|
408
|
-
|
|
409
430
|
### 6.1. Maintenance and setup commands
|
|
410
431
|
|
|
411
|
-
<a name="
|
|
412
|
-
|
|
413
|
-
<a id="markdown-611-init" name="611-init"></a>
|
|
432
|
+
<a id="markdown-maintenance-and-setup-commands" name="maintenance-and-setup-commands"></a>
|
|
414
433
|
|
|
415
434
|
#### 6.1.1. init
|
|
416
435
|
|
|
436
|
+
<a id="markdown-init" name="init"></a>
|
|
437
|
+
|
|
417
438
|
_Command:_ `mcdev init`
|
|
418
439
|
|
|
419
440
|
_Alias:_ -
|
|
@@ -450,10 +471,10 @@ Example url: `https://mcg123abcysykllg-0321cbs8bbt64.auth.marketingcloudapis.com
|
|
|
450
471
|
>
|
|
451
472
|
> To get the tenant subdomain, please take the Authentication Base Uri and extract the part after `https://` and before `.auth.marketingcloudapis.com`. In the above example this would therefore be `mcg123abcysykllg-0321cbs8bbt64`.
|
|
452
473
|
|
|
453
|
-
<a id="markdown-612-upgrade" name="612-upgrade"></a>
|
|
454
|
-
|
|
455
474
|
#### 6.1.2. upgrade
|
|
456
475
|
|
|
476
|
+
<a id="markdown-upgrade" name="upgrade"></a>
|
|
477
|
+
|
|
457
478
|
_Command:_ `mcdev upgrade`
|
|
458
479
|
|
|
459
480
|
_Alias:_ `mcdev up`
|
|
@@ -466,10 +487,10 @@ _Example:_
|
|
|
466
487
|
mcdev upgrade
|
|
467
488
|
```
|
|
468
489
|
|
|
469
|
-
<a id="markdown-613-reloadbus" name="613-reloadbus"></a>
|
|
470
|
-
|
|
471
490
|
#### 6.1.3. reloadBUs
|
|
472
491
|
|
|
492
|
+
<a id="markdown-reloadbus" name="reloadbus"></a>
|
|
493
|
+
|
|
473
494
|
_Command:_ `mcdev reloadBUs [credential]`
|
|
474
495
|
|
|
475
496
|
_Alias:_ `mcdev rb`
|
|
@@ -482,10 +503,10 @@ _Example:_
|
|
|
482
503
|
mcdev reloadBUs MyProject
|
|
483
504
|
```
|
|
484
505
|
|
|
485
|
-
<a id="markdown-614-badkeys" name="614-badkeys"></a>
|
|
486
|
-
|
|
487
506
|
#### 6.1.4. badKeys
|
|
488
507
|
|
|
508
|
+
<a id="markdown-badkeys" name="badkeys"></a>
|
|
509
|
+
|
|
489
510
|
_Command:_ `mcdev badKeys [business unit]`
|
|
490
511
|
|
|
491
512
|
_Alias:_ -
|
|
@@ -498,10 +519,10 @@ _Example:_
|
|
|
498
519
|
mcdev badKeys MyProject/DEV
|
|
499
520
|
```
|
|
500
521
|
|
|
501
|
-
<a id="markdown-615-document" name="615-document"></a>
|
|
502
|
-
|
|
503
522
|
#### 6.1.5. document
|
|
504
523
|
|
|
524
|
+
<a id="markdown-document" name="document"></a>
|
|
525
|
+
|
|
505
526
|
_Command:_ `mcdev document <TYPE> <business unit>`
|
|
506
527
|
|
|
507
528
|
_Alias:_ `mcdev doc`
|
|
@@ -516,6 +537,7 @@ Currently supported types:
|
|
|
516
537
|
| -------------- | --------------- |
|
|
517
538
|
| Data Extension | `dataExtension` |
|
|
518
539
|
| Role | `role` |
|
|
540
|
+
| User | `accountUser` |
|
|
519
541
|
|
|
520
542
|
_Example:_
|
|
521
543
|
|
|
@@ -523,10 +545,10 @@ _Example:_
|
|
|
523
545
|
mcdev document role myServer
|
|
524
546
|
```
|
|
525
547
|
|
|
526
|
-
<a id="markdown-616-selecttypes" name="616-selecttypes"></a>
|
|
527
|
-
|
|
528
548
|
#### 6.1.6. selectTypes
|
|
529
549
|
|
|
550
|
+
<a id="markdown-selecttypes" name="selecttypes"></a>
|
|
551
|
+
|
|
530
552
|
_Command:_ `mcdev selectTypes`
|
|
531
553
|
|
|
532
554
|
_Alias:_ `mcdev st`
|
|
@@ -541,10 +563,10 @@ mcdev selectTypes
|
|
|
541
563
|
|
|
542
564
|
_Note:_ You may select non-standard types if you run `mcdev selectTypes --debug`. This may be needed in edge cases but is not recommended in most situations.
|
|
543
565
|
|
|
544
|
-
<a id="markdown-617-explaintypes" name="617-explaintypes"></a>
|
|
545
|
-
|
|
546
566
|
#### 6.1.7. explainTypes
|
|
547
567
|
|
|
568
|
+
<a id="markdown-explaintypes" name="explaintypes"></a>
|
|
569
|
+
|
|
548
570
|
_Command:_ `mcdev explainTypes`
|
|
549
571
|
|
|
550
572
|
_Alias:_ `mcdev et`
|
|
@@ -559,14 +581,14 @@ _Example:_
|
|
|
559
581
|
mcdev explainTypes
|
|
560
582
|
```
|
|
561
583
|
|
|
562
|
-
<a id="markdown-62-operational-commands" name="62-operational-commands"></a>
|
|
563
|
-
|
|
564
584
|
### 6.2. Operational commands
|
|
565
585
|
|
|
566
|
-
<a id="markdown-
|
|
586
|
+
<a id="markdown-operational-commands" name="operational-commands"></a>
|
|
567
587
|
|
|
568
588
|
#### 6.2.1. retrieve
|
|
569
589
|
|
|
590
|
+
<a id="markdown-retrieve" name="retrieve"></a>
|
|
591
|
+
|
|
570
592
|
_Command:_ `mcdev retrieve [business unit] [metadata type]`
|
|
571
593
|
|
|
572
594
|
_Alias:_ `mcdev r`
|
|
@@ -621,10 +643,10 @@ mcdev retrieve "*"
|
|
|
621
643
|
|
|
622
644
|
> Note: retrieve-all will fail in some CLIs if you do not wrap the asterix (\*) in quotes. This is due to the special meaning of \* as a parameter in these CLIs.
|
|
623
645
|
|
|
624
|
-
<a id="markdown-622-deploy" name="622-deploy"></a>
|
|
625
|
-
|
|
626
646
|
#### 6.2.2. deploy
|
|
627
647
|
|
|
648
|
+
<a id="markdown-deploy" name="deploy"></a>
|
|
649
|
+
|
|
628
650
|
_Command:_ `mcdev deploy [business unit] [metadata type]`
|
|
629
651
|
|
|
630
652
|
_Alias:_ `mcdev d`
|
|
@@ -667,10 +689,10 @@ mcdev deploy "*"
|
|
|
667
689
|
|
|
668
690
|
> Note: deploy-all will fail in some CLIs if you do not wrap the asterix (\*) in quotes. This is due to the special meaning of \* as a parameter in these CLIs.
|
|
669
691
|
|
|
670
|
-
<a id="markdown-623-delete" name="623-delete"></a>
|
|
671
|
-
|
|
672
692
|
#### 6.2.3. delete
|
|
673
693
|
|
|
694
|
+
<a id="markdown-delete" name="delete"></a>
|
|
695
|
+
|
|
674
696
|
_Command:_ `mcdev delete <business unit> <type> <external key>`
|
|
675
697
|
|
|
676
698
|
_Alias:_ `mcdev del`
|
|
@@ -689,10 +711,10 @@ _Example:_
|
|
|
689
711
|
mcdev delete MyProject/_ParentBU_ dataExtension MyUserTable
|
|
690
712
|
```
|
|
691
713
|
|
|
692
|
-
<a id="markdown-624-retrieveastemplate" name="624-retrieveastemplate"></a>
|
|
693
|
-
|
|
694
714
|
#### 6.2.4. retrieveAsTemplate
|
|
695
715
|
|
|
716
|
+
<a id="markdown-retrieveastemplate" name="retrieveastemplate"></a>
|
|
717
|
+
|
|
696
718
|
_Command:_ `mcdev retrieveAsTemplate <business unit> <type> <name> <market>`
|
|
697
719
|
|
|
698
720
|
_Alias:_ `mcdev rt`
|
|
@@ -727,10 +749,10 @@ This will result in the following files being created in your `template/` direct
|
|
|
727
749
|
- `table2.dataExtension-meta.json`
|
|
728
750
|
- `table3.dataExtension-meta.json`
|
|
729
751
|
|
|
730
|
-
<a id="markdown-625-builddefinition" name="625-builddefinition"></a>
|
|
731
|
-
|
|
732
752
|
#### 6.2.5. buildDefinition
|
|
733
753
|
|
|
754
|
+
<a id="markdown-builddefinition" name="builddefinition"></a>
|
|
755
|
+
|
|
734
756
|
_Command:_ `mcdev buildDefinition <business unit> <type> <name> <market>`
|
|
735
757
|
|
|
736
758
|
_Alias:_ `mcdev bd`
|
|
@@ -768,10 +790,10 @@ This will result in the following files being created in your `retrieve/MyProjec
|
|
|
768
790
|
- `table2.dataExtension-meta.json`
|
|
769
791
|
- `table3.dataExtension-meta.json`
|
|
770
792
|
|
|
771
|
-
<a id="markdown-626-builddefinitionbulk" name="626-builddefinitionbulk"></a>
|
|
772
|
-
|
|
773
793
|
#### 6.2.6. buildDefinitionBulk
|
|
774
794
|
|
|
795
|
+
<a id="markdown-builddefinitionbulk" name="builddefinitionbulk"></a>
|
|
796
|
+
|
|
775
797
|
_Command:_ `mcdev buildDefinitionBulk <list name> <type> <name>`
|
|
776
798
|
|
|
777
799
|
_Alias:_ `mcdev bdb`
|
|
@@ -788,10 +810,10 @@ _Example:_
|
|
|
788
810
|
mcdev bdb pilotMarketsQA dataExtension MyUserTable
|
|
789
811
|
```
|
|
790
812
|
|
|
791
|
-
<a id="markdown-627-createdeltapkg" name="627-createdeltapkg"></a>
|
|
792
|
-
|
|
793
813
|
#### 6.2.7. createDeltaPkg
|
|
794
814
|
|
|
815
|
+
<a id="markdown-createdeltapkg" name="createdeltapkg"></a>
|
|
816
|
+
|
|
795
817
|
_Command:_ `mcdev createDeltaPkg [range] [filter]`
|
|
796
818
|
|
|
797
819
|
_Alias:_ `mcdev cdp`
|
|
@@ -919,10 +941,10 @@ mcdev createDeltaPkg d21b4221..HEAD 'MyProject/BU1,MyProject/BU3'
|
|
|
919
941
|
> mcdev createDeltaPkg <range> [filter] --y
|
|
920
942
|
> ```
|
|
921
943
|
|
|
922
|
-
<a id="markdown-7-advanced-configuration" name="7-advanced-configuration"></a>
|
|
923
|
-
|
|
924
944
|
## 7. Advanced Configuration
|
|
925
945
|
|
|
946
|
+
<a id="markdown-advanced-configuration" name="advanced-configuration"></a>
|
|
947
|
+
|
|
926
948
|
The tools confiuration can be changed in the file `.mcdevrc.json` located in the root of your project folder.
|
|
927
949
|
|
|
928
950
|
It contains [Market Configuration](#market-configuration) (`markets: { ... }`), [Market List Configuration](#market-list-configuration) (`marketList: { ... }`) the list of usable Business Units per credentials, `directories`, as well as other `options`.
|
|
@@ -931,10 +953,10 @@ You will also find the configuration for what metadata shall be retrieved here i
|
|
|
931
953
|
|
|
932
954
|
You will also find a secondary file named `.mcdev-auth.json` containing your credentials. **Do not commit this to your repository!** You should only commit `.mcdevrc.json` as this file contains project wide settings that do not compromise security.
|
|
933
955
|
|
|
934
|
-
<a id="markdown-71-config-options" name="71-config-options"></a>
|
|
935
|
-
|
|
936
956
|
### 7.1. Config Options
|
|
937
957
|
|
|
958
|
+
<a id="markdown-config-options" name="config-options"></a>
|
|
959
|
+
|
|
938
960
|
The central config in `.mcdevrc.json` holds multiple adjustable settings:
|
|
939
961
|
|
|
940
962
|
```json
|
|
@@ -997,22 +1019,23 @@ The central config in `.mcdevrc.json` holds multiple adjustable settings:
|
|
|
997
1019
|
| directories.deploy | 'deploy/' | Where `deploy` searches for files to deploy |
|
|
998
1020
|
| directories.retrieve | 'retrieve/' | Where `retrieve` stores downloaded files |
|
|
999
1021
|
| directories.roles | 'docs/roles/' | Directory for `document role` output |
|
|
1022
|
+
| directories.users | 'docs/users/' | Directory for `document accountUser` output |
|
|
1000
1023
|
| directories.template | 'template/' | Where `rt` stores downloaded templates & `bd` retrieves them from |
|
|
1001
1024
|
| directories.templateBuilds | ['retrieve/','deploy/'] | Where `bd` saves final deployment versions in. This can hold multiple directories, e.g. ['retrieve/','deploy/'] |
|
|
1002
1025
|
| metaDataTypes.documentOnRetrieve | ['role','dataExtension'] | automatically executes `document` for selected types |
|
|
1003
1026
|
| metaDataTypes.retrieve | _changes with each release_ | check [Metadata Type Support](#metadata-type-support) for current list |
|
|
1004
1027
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
### 7.2. Metadata specific settings
|
|
1028
|
+
### 7.2. Metadata specific settings & options
|
|
1008
1029
|
|
|
1009
|
-
<a id="markdown-
|
|
1030
|
+
<a id="markdown-metadata-specific-settings" name="metadata-specific-settings"></a>
|
|
1010
1031
|
|
|
1011
1032
|
#### 7.2.1. Retention Policy fields in Data Extensions
|
|
1012
1033
|
|
|
1034
|
+
<a id="markdown-retention-policy-fields-in-data-extensions" name="retention-policy-fields-in-data-extensions"></a>
|
|
1035
|
+
|
|
1013
1036
|
The way retention policy is saved is a bit misleading and hence we wanted to provide a bit of guidance if you ever need to do a deep dive here.
|
|
1014
1037
|
|
|
1015
|
-
| Field
|
|
1038
|
+
| Field | Description | Values |
|
|
1016
1039
|
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
1017
1040
|
| **DataRetentionPeriod** | this field should print the value of the unit of measure but it unfortunately is off by one (e.g. showing "weeks" instead of "months"). Also, it seems to have no impact on what's stored.<br> We therefore excluded it from retrieve/deploy | - |
|
|
1018
1041
|
| **DataRetentionPeriodUnitOfMeasure** | represents drop down for "period after" selection | 6: years<br>5: months<br>4: weeks<br>2: days |
|
|
@@ -1028,51 +1051,93 @@ To enable "delete All records and data extensions" you have to set RowBasedReten
|
|
|
1028
1051
|
|
|
1029
1052
|
It seems the 2 other modes were added on top later and hence "all records and data extension" is the default retention mode.
|
|
1030
1053
|
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
## 8. Examples
|
|
1034
|
-
|
|
1035
|
-
<a id="markdown-81-retrieve-and-deploy-data-extension" name="81-retrieve-and-deploy-data-extension"></a>
|
|
1036
|
-
|
|
1037
|
-
### 8.1. Retrieve and deploy Data Extension
|
|
1038
|
-
|
|
1039
|
-
1. Retrieve metadata by running `mcdev retrieve <BU>` (where the BU corresponds to a credential-Business Unit combo in the **.mcdevrc.json**)
|
|
1040
|
-
2. Create a directory called `deploy/` in the root directory
|
|
1041
|
-
3. Create a directory called `dataExtension/` in the `deploy/` directory
|
|
1042
|
-
4. Copy a single dataExtension directory from the `retrieve/<credential>/<BU-Name>/dataExtension/` directory into `deploy/<credential>/<BU-Name>/dataExtension/`
|
|
1043
|
-
5. Run `mcdev deploy <BU>` to deploy everything in the **deploy** folder to the specified Business Unit
|
|
1044
|
-
|
|
1045
|
-
<a id="markdown-82-metadata-retrievingbackup" name="82-metadata-retrievingbackup"></a>
|
|
1046
|
-
|
|
1047
|
-
### 8.2. Metadata Retrieving/Backup
|
|
1048
|
-
|
|
1049
|
-
Metadata of a Business Unit can be retrieved by running the following command:
|
|
1050
|
-
|
|
1051
|
-
`mcdev retrieve <BU>`
|
|
1052
|
-
|
|
1053
|
-
where `<BU>` needs to be replaced with `credentialName/businessUnit-Name` that is defined in **.mcdevrc.json**.
|
|
1054
|
+
#### 7.2.2. Adding/Updating Fields on existing Data Extensions
|
|
1054
1055
|
|
|
1055
|
-
|
|
1056
|
+
<a id="markdown-8-examples" name="8-examples"></a>
|
|
1056
1057
|
|
|
1057
|
-
|
|
1058
|
+
There are a few rules to keep in mind when playing with Data Extensions fields:
|
|
1058
1059
|
|
|
1059
|
-
|
|
1060
|
+
- The `FieldType` cannot be changed on existing fields; the API returns in error is the attribute is even provided unchanged during an update
|
|
1061
|
+
- `MaxLength` can be increased or kept on the same value but never decreased during an update
|
|
1062
|
+
- A Non-Required/Nullable field cannot be set to be required during an UPDATE
|
|
1063
|
+
- When new fields are added, they can be required, but then also have to have a `DefaultValue` set
|
|
1064
|
+
- The value for `IsRequired` should be 'true' or 'false'
|
|
1065
|
+
- The value for `IsPrimary` should be 'true' or 'false'
|
|
1060
1066
|
|
|
1061
|
-
|
|
1067
|
+
#### 7.2.3. Renaming fields of a Data Extensions
|
|
1062
1068
|
|
|
1063
|
-
|
|
1069
|
+
With a small addition to the Data Extension's JSON it is possible to rename fields via MC DevTools. Imagine the following Data Extension:
|
|
1064
1070
|
|
|
1065
|
-
|
|
1071
|
+
```json
|
|
1072
|
+
{
|
|
1073
|
+
"CustomerKey": "Account",
|
|
1074
|
+
"Name": "Account",
|
|
1075
|
+
"Description": "",
|
|
1076
|
+
"IsSendable": "false",
|
|
1077
|
+
"IsTestable": "false",
|
|
1078
|
+
"Fields": [
|
|
1079
|
+
{
|
|
1080
|
+
"Name": "BillingCity",
|
|
1081
|
+
"Scale": "0",
|
|
1082
|
+
"DefaultValue": "",
|
|
1083
|
+
"MaxLength": "40",
|
|
1084
|
+
"IsRequired": "false",
|
|
1085
|
+
"IsPrimaryKey": "true",
|
|
1086
|
+
"FieldType": "Text"
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"Name": "BillingCountry",
|
|
1090
|
+
"Scale": "0",
|
|
1091
|
+
"DefaultValue": "",
|
|
1092
|
+
"MaxLength": "80",
|
|
1093
|
+
"IsRequired": "false",
|
|
1094
|
+
"IsPrimaryKey": "false",
|
|
1095
|
+
"FieldType": "Text"
|
|
1096
|
+
}
|
|
1097
|
+
],
|
|
1098
|
+
"r__folder_Path": "Data Extensions"
|
|
1099
|
+
}
|
|
1100
|
+
```
|
|
1066
1101
|
|
|
1067
|
-
|
|
1102
|
+
Imagine you wanted to rename `BillingCountry` to `BillingZip` for some reason. Previously, you could either go into the GUI or delete & recreate the field. Now, MC DevTools allows you to specify `Name_new` on the field and the tool will take care of the rest during **deployment**:
|
|
1068
1103
|
|
|
1069
|
-
|
|
1104
|
+
```json
|
|
1105
|
+
{
|
|
1106
|
+
"CustomerKey": "Account",
|
|
1107
|
+
"Name": "Account",
|
|
1108
|
+
"Description": "",
|
|
1109
|
+
"IsSendable": "false",
|
|
1110
|
+
"IsTestable": "false",
|
|
1111
|
+
"Fields": [
|
|
1112
|
+
{
|
|
1113
|
+
"Name": "BillingCity",
|
|
1114
|
+
"Scale": "0",
|
|
1115
|
+
"DefaultValue": "",
|
|
1116
|
+
"MaxLength": "40",
|
|
1117
|
+
"IsRequired": "false",
|
|
1118
|
+
"IsPrimaryKey": "true",
|
|
1119
|
+
"FieldType": "Text"
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
"Name": "BillingCountry" /* old name, keep here for reference during the update! */,
|
|
1123
|
+
"Name_new": "BillingZip" /* new name */,
|
|
1124
|
+
"Scale": "0",
|
|
1125
|
+
"DefaultValue": "",
|
|
1126
|
+
"MaxLength": "80",
|
|
1127
|
+
"IsRequired": "false",
|
|
1128
|
+
"IsPrimaryKey": "false",
|
|
1129
|
+
"FieldType": "Text"
|
|
1130
|
+
}
|
|
1131
|
+
],
|
|
1132
|
+
"r__folder_Path": "Data Extensions"
|
|
1133
|
+
}
|
|
1134
|
+
```
|
|
1070
1135
|
|
|
1071
|
-
|
|
1136
|
+
All you have to do is deploy the data extension again with Name_new specified for each field that needs to be renamed.
|
|
1072
1137
|
|
|
1073
|
-
|
|
1138
|
+
### 7.3. Market Configuration
|
|
1074
1139
|
|
|
1075
|
-
|
|
1140
|
+
<a id="markdown-market-configuration" name="market-configuration"></a>
|
|
1076
1141
|
|
|
1077
1142
|
You will want to setup configs for variable parts that change inbetween Business Units. We advise starting this _after_ you've first run the `retrieveAsTemplate` command. This might sound counterintuitive but when you review what was copied into your template folder you will likely spot these variable parts the fastest and can then start setting up your market config. Please consider this an iterative process as you will likely run `rt` followed by another update of your config multiple times until you got it right.
|
|
1078
1143
|
|
|
@@ -1194,9 +1259,9 @@ Way more complex example with dedicated "Parent" BUs per enviroment (DEV, QA, PR
|
|
|
1194
1259
|
|
|
1195
1260
|
<a name="market-list-configuration"></a>
|
|
1196
1261
|
|
|
1197
|
-
|
|
1262
|
+
### 7.4. Market List Configuration
|
|
1198
1263
|
|
|
1199
|
-
|
|
1264
|
+
<a id="markdown-market-list-configuration" name="market-list-configuration"></a>
|
|
1200
1265
|
|
|
1201
1266
|
Market Lists are very powerful and you will quickly notice how much time they can safe you during your deployment preparation.
|
|
1202
1267
|
Let's first look at an example list config:
|
|
@@ -1277,24 +1342,64 @@ Apart from that we can see 4 types of lists here:
|
|
|
1277
1342
|
3. `Parent-medium-multi`/`Parent-large-multi` (medium:_instance parent_; large:_environment parent_): Any scripts, queries, automations that are executed on the parent but require one per child (e.g. query to fill country-specific Shared Data Extensions)
|
|
1278
1343
|
4. `Children` (_child BUs_): everything that is needed on the market specific Business Units.
|
|
1279
1344
|
|
|
1280
|
-
|
|
1345
|
+
## 8. Examples
|
|
1346
|
+
|
|
1347
|
+
<a id="markdown-examples" name="examples"></a>
|
|
1348
|
+
|
|
1349
|
+
### 8.1. Retrieve and deploy Data Extension
|
|
1350
|
+
|
|
1351
|
+
<a id="markdown-retrieve-and-deploy-data-extension" name="retrieve-and-deploy-data-extension"></a>
|
|
1352
|
+
|
|
1353
|
+
1. Retrieve metadata by running `mcdev retrieve <BU>` (where the BU corresponds to a credential-Business Unit combo in the **.mcdevrc.json**)
|
|
1354
|
+
2. Create a directory called `deploy/` in the root directory
|
|
1355
|
+
3. Create a directory called `dataExtension/` in the `deploy/` directory
|
|
1356
|
+
4. Copy a single dataExtension directory from the `retrieve/<credential>/<BU-Name>/dataExtension/` directory into `deploy/<credential>/<BU-Name>/dataExtension/`
|
|
1357
|
+
5. Run `mcdev deploy <BU>` to deploy everything in the **deploy** folder to the specified Business Unit
|
|
1358
|
+
|
|
1359
|
+
### 8.2. Metadata Retrieving/Backup
|
|
1360
|
+
|
|
1361
|
+
<a id="markdown-metadata-retrieving%2Fbackup" name="metadata-retrieving%2Fbackup"></a>
|
|
1362
|
+
|
|
1363
|
+
Metadata of a Business Unit can be retrieved by running the following command:
|
|
1364
|
+
|
|
1365
|
+
`mcdev retrieve <BU>`
|
|
1366
|
+
|
|
1367
|
+
where `<BU>` needs to be replaced with `credentialName/businessUnit-Name` that is defined in **.mcdevrc.json**.
|
|
1368
|
+
|
|
1369
|
+
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**.
|
|
1370
|
+
|
|
1371
|
+
This folder structure can be commited into a git repository and used as backup.
|
|
1372
|
+
|
|
1373
|
+
### 8.3. Automation Deployment
|
|
1374
|
+
|
|
1375
|
+
<a id="markdown-automation-deployment" name="automation-deployment"></a>
|
|
1376
|
+
|
|
1377
|
+
Now we want to deploy an Automation with it's related metadata. Select a retrieved Automation and copy it into the deploy folder. (`deploy/<credential>/<BU-Name>/automation/myAutomation.meta-automation.json`)
|
|
1378
|
+
|
|
1379
|
+
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`)
|
|
1380
|
+
|
|
1381
|
+
To start the deployment run the following command:
|
|
1382
|
+
|
|
1383
|
+
`mcdev deploy <BU>`
|
|
1281
1384
|
|
|
1282
1385
|
## 9. Contribute
|
|
1283
1386
|
|
|
1284
|
-
|
|
1387
|
+
<a id="markdown-contribute" name="contribute"></a>
|
|
1285
1388
|
|
|
1286
|
-
|
|
1389
|
+
If you want to enhance Accenture SFMC DevTools you are welcome to fork the repo and create a pull request. Please understand that we will have to conduct a code review before accepting your changes.
|
|
1287
1390
|
|
|
1288
1391
|
### 9.1. Install Guide for Developers
|
|
1289
1392
|
|
|
1393
|
+
<a id="markdown-install-guide-for-developers" name="install-guide-for-developers"></a>
|
|
1394
|
+
|
|
1290
1395
|
Instead of installing Accenture SFMC DevTools as a npm dependency from our git repo, we recommend cloning our repo and then linking it locally:
|
|
1291
1396
|
|
|
1292
|
-
Assuming you cloned Accenture SFMC DevTools into `C:\repos\
|
|
1397
|
+
Assuming you cloned Accenture SFMC DevTools into `C:\repos\sfmc-devtools\` (or `~/repos/sfmc-devtools/` on Mac) you can then go into your project directory, open a terminal there and run:
|
|
1293
1398
|
|
|
1294
1399
|
_Local install:_
|
|
1295
1400
|
|
|
1296
1401
|
```bash
|
|
1297
|
-
npm install --save-dev "C:\repos\
|
|
1402
|
+
npm install --save-dev "C:\repos\sfmc-devtools"
|
|
1298
1403
|
```
|
|
1299
1404
|
|
|
1300
1405
|
or
|
|
@@ -1302,7 +1407,7 @@ or
|
|
|
1302
1407
|
_Global install **(recommended)**:_
|
|
1303
1408
|
|
|
1304
1409
|
```bash
|
|
1305
|
-
npm install -g "C:\repos\
|
|
1410
|
+
npm install -g "C:\repos\sfmc-devtools"
|
|
1306
1411
|
```
|
|
1307
1412
|
|
|
1308
1413
|
This should tell npm to create a symlink to your cloned local directoty, allowing you to see updates you make in your mcdev repo instantly.
|
|
@@ -1319,10 +1424,10 @@ To test your new **global** developer setup, run `mcdev --version` in CLI which
|
|
|
1319
1424
|
|
|
1320
1425
|
<a name="local-install"></a>
|
|
1321
1426
|
|
|
1322
|
-
<a id="markdown-92-local-install" name="92-local-install"></a>
|
|
1323
|
-
|
|
1324
1427
|
### 9.2. Local install
|
|
1325
1428
|
|
|
1429
|
+
<a id="markdown-local-install" name="local-install"></a>
|
|
1430
|
+
|
|
1326
1431
|
> **Warning:** local installation (leading to the use of [npx](https://github.com/npm/npx#readme)) causes issues when spaces are used in keys/names and is therefore not recommended.
|
|
1327
1432
|
> You will also make setting up projects much harder if you choose the local installation as you cannot use `mcdev init` to automatically setup your entire project.
|
|
1328
1433
|
|
|
@@ -1344,10 +1449,10 @@ The following explains how you _could_ install it locally for certain edge cases
|
|
|
1344
1449
|
|
|
1345
1450
|
When completed you will see `+ mcdev@3.0.0` printed to your screen (or the current version of it respectively).
|
|
1346
1451
|
|
|
1347
|
-
<a id="markdown-93-npm-scripts" name="93-npm-scripts"></a>
|
|
1348
|
-
|
|
1349
1452
|
### 9.3. NPM Scripts
|
|
1350
1453
|
|
|
1454
|
+
<a id="markdown-npm-scripts" name="npm-scripts"></a>
|
|
1455
|
+
|
|
1351
1456
|
- `start`: Main entry point
|
|
1352
1457
|
- `mcdev`: alias for `start`
|
|
1353
1458
|
- `build`: Runs documentation and linting scripts
|
|
@@ -1357,9 +1462,9 @@ When completed you will see `+ mcdev@3.0.0` printed to your screen (or the curre
|
|
|
1357
1462
|
- `test`: Runs mocha tests - outdated
|
|
1358
1463
|
- `upgrade`: run npm-check to test for updated depdencies
|
|
1359
1464
|
|
|
1360
|
-
<a id="markdown-94-developer-documentation" name="94-developer-documentation"></a>
|
|
1361
|
-
|
|
1362
1465
|
### 9.4. Developer Documentation
|
|
1363
1466
|
|
|
1467
|
+
<a id="markdown-developer-documentation" name="developer-documentation"></a>
|
|
1468
|
+
|
|
1364
1469
|
- [Link to API Documentation](docs/dist/documentation.md)
|
|
1365
1470
|
- [Link to Considerations & Findings Documentation](docs/dist/considerations.md)
|