mcdev 4.1.6 → 4.1.8
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/.github/ISSUE_TEMPLATE/bug.yml +2 -0
- package/README.md +70 -69
- package/docs/dist/documentation.md +34 -34
- package/lib/Deployer.js +27 -19
- package/lib/index.js +1 -1
- package/lib/metadataTypes/Asset.js +8 -8
- package/lib/metadataTypes/DataExtension.js +2 -2
- package/lib/metadataTypes/DataExtensionField.js +1 -1
- package/lib/metadataTypes/Folder.js +29 -15
- package/lib/metadataTypes/MetadataType.js +4 -4
- package/lib/metadataTypes/Query.js +4 -4
- package/lib/metadataTypes/Script.js +4 -4
- package/lib/metadataTypes/definitions/Folder.definition.js +6 -0
- package/lib/util/cli.js +2 -2
- package/lib/util/file.js +1 -1
- package/lib/util/init.config.js +1 -1
- package/lib/util/init.js +1 -1
- package/lib/util/util.js +1 -1
- package/package.json +1 -1
- package/test/mockRoot/.mcdevrc.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Accenture Salesforce Marketing Cloud DevTools (mcdev) is a rapid deployment/roll
|
|
|
25
25
|
- [2.6 Using mcdev in other node packages](#26-using-mcdev-in-other-node-packages)
|
|
26
26
|
- [3. Updating Accenture SFMC DevTools](#3-updating-accenture-sfmc-devtools)
|
|
27
27
|
- [4. Troubleshoot Install/Update](#4-troubleshoot-installupdate)
|
|
28
|
-
- [4.1. Installing specific version](#41-installing-specific-version)
|
|
28
|
+
- [4.1. Installing a specific version](#41-installing-a-specific-version)
|
|
29
29
|
- [4.2. Using custom CLIs](#42-using-custom-clis)
|
|
30
30
|
- [4.3. Missing write access to...on MacOS](#43-missing-write-access-toon-macos)
|
|
31
31
|
- [4.4. ...running scripts is disabled on this system](#44-running-scripts-is-disabled-on-this-system)
|
|
@@ -123,7 +123,7 @@ If you experience issues installing Accenture SFMC DevTools, please check out th
|
|
|
123
123
|
1. Install Accenture SFMC DevTools by running `npm install -g mcdev` (prefix with `sudo` on MacOS)
|
|
124
124
|
- If you get an error, please see the below troubleshooting section.
|
|
125
125
|
|
|
126
|
-
When completed run `mcdev --version` and it will show you which version you installed (e.g. `4.1.
|
|
126
|
+
When completed run `mcdev --version` and it will show you which version you installed (e.g. `4.1.8`).
|
|
127
127
|
|
|
128
128
|
> **_Side note for proud nerds_:**
|
|
129
129
|
>
|
|
@@ -135,12 +135,12 @@ When completed run `mcdev --version` and it will show you which version you inst
|
|
|
135
135
|
|
|
136
136
|
<a id="markdown-initial-project-setup" name="initial-project-setup"></a>
|
|
137
137
|
|
|
138
|
-
After the successful installation, you will now need to
|
|
138
|
+
After the successful installation, you will now need to set up the connection to your Marketing Cloud instance.
|
|
139
139
|
|
|
140
140
|
1. In your Marketing Cloud instance
|
|
141
141
|
1. Ensure that you **selected** your **Parent/Global Business Unit**.
|
|
142
142
|
2. Go to `Setup -> Apps -> Installed Packages`.
|
|
143
|
-
3. Create a new installed package and name it "Accenture SFMC DevTools Deployment Tool"
|
|
143
|
+
3. Create a new "installed package" and name it "Accenture SFMC DevTools Deployment Tool"
|
|
144
144
|
> Note: On some older SFMC instances it will ask you if you want the enhanced version. Please enable this option.
|
|
145
145
|
4. Click on the _Add Component_ button and select `API Integration` with `Server-To-Server` mode.
|
|
146
146
|
5. Make sure you grant all available rights.
|
|
@@ -155,15 +155,15 @@ After the successful installation, you will now need to setup the connection to
|
|
|
155
155
|
> Being specific here reduces the chance of deploying to the wrong server (instance) in stressful situations. We suggest you use something like `ClientName`, or `ClientName-ProjectName` if you have multiple projects with the same client. In case your project uses multiples instances you might like to use something like `Client-ProjectName-Sandbox` and `Client-ProjectName-PROD`.
|
|
156
156
|
3. It will then continue to ask for the EID (Parent MID), client ID, client secret and Authentication Base URI.
|
|
157
157
|
4. The credentials will be automatically tested & your list of BUs downloaded until finally the central configuration file `.mcdevrc.json` gets created in your project folder.
|
|
158
|
-
5.
|
|
158
|
+
5. The last step is to download an initial backup and commit it into git. No worries - the wizard does that for you!
|
|
159
159
|
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.
|
|
160
160
|
4. Done.
|
|
161
161
|
3. Sharing the project with your team
|
|
162
162
|
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.
|
|
163
163
|
> 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:
|
|
164
164
|
2. Open the URL of your online repo and find the "CLONE" button. This will likely show you a normal URL, ending on ".git"
|
|
165
|
-
3. Add this as your repository remote named "origin". If you use a GUI
|
|
166
|
-
4. Now run `git push -u origin master` to
|
|
165
|
+
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.
|
|
166
|
+
4. Now run `git push -u origin master` to start the upload.
|
|
167
167
|
|
|
168
168
|
### 2.4. Joining a project that was set up before
|
|
169
169
|
|
|
@@ -178,14 +178,14 @@ If Accenture SFMC DevTools was already used to set up the project by somebody in
|
|
|
178
178
|
4. now execute `git clone YOUR-REPO-URL`. This will create a sub-folder with the name of the repo and download everything for you into it (e.g. `C:\repos\YOUR-REPO\`)
|
|
179
179
|
5. Still in the command prompt, execute `cd YOUR-REPO`. This will switch your current folder (visible before the command prompt) to the new repo folder (`C:\repos\YOUR-REPO\`).
|
|
180
180
|
6. Assuming you installed Accenture SFMC DevTools globally (recommended!), now execute `mcdev init`.
|
|
181
|
-
7. At this point the system will recognize the previously set up project and ask you for `EID (Parent MID)`, `Client ID`, `Client Secret` and the `Authentication Base URI`.
|
|
181
|
+
7. At this point, the system will recognize the previously set up project and ask you for `EID (Parent MID)`, `Client ID`, `Client Secret` and the `Authentication Base URI`.
|
|
182
182
|
8. Done.
|
|
183
183
|
|
|
184
184
|
### 2.5. Recommended additional installs
|
|
185
185
|
|
|
186
186
|
<a id="markdown-recommended-additional-installs" name="recommended-additional-installs"></a>
|
|
187
187
|
|
|
188
|
-
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.
|
|
188
|
+
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.
|
|
189
189
|
|
|
190
190
|
Nevertheless, Accenture SFMC DevTools will run without them and is not associated with the development of these publicly available apps & plugins.
|
|
191
191
|
|
|
@@ -208,15 +208,15 @@ The "Workspace Recommendations" were defined by Accenture SFMC DevTools. Clickin
|
|
|
208
208
|
**Node modules:**
|
|
209
209
|
|
|
210
210
|
- [eslint](https://npmjs.com/package/eslint): code linting
|
|
211
|
-
- [eslint-config-prettier](http://npmjs.com/package/eslint-config-prettier): ensures that prettier and eslint
|
|
211
|
+
- [eslint-config-prettier](http://npmjs.com/package/eslint-config-prettier): ensures that prettier and eslint do not have conflicting rules
|
|
212
212
|
- [eslint-config-ssjs](http://npmjs.com/package/eslint-config-ssjs): allows you to have accurate code linting in \*.SSJS files
|
|
213
213
|
- [eslint-plugin-jsdoc](http://npmjs.com/package/eslint-plugin-jsdoc): will help you write proper jsdoc comments in your SSJS code
|
|
214
|
-
- [eslint-plugin-prettier](http://npmjs.com/package/eslint-plugin-prettier): runs prettier and
|
|
214
|
+
- [eslint-plugin-prettier](http://npmjs.com/package/eslint-plugin-prettier): runs prettier and ESlint together
|
|
215
215
|
- [prettier](https://prettier.io): opinionated code formatter
|
|
216
216
|
- [npm-check](http://npmjs.com/package/npm-check): makes it easier to keep your node modules up-to-date
|
|
217
217
|
- [sfmc-boilerplate](http://npmjs.com/package/sfmc-boilerplate): build tool for your more complex email, cloudpage and automation code.
|
|
218
218
|
|
|
219
|
-
Please note that Visual Studio Code might warn you about using the local installation of ESLint with a pop
|
|
219
|
+
Please note that Visual Studio Code might warn you about using the local installation of ESLint with a pop-up like the following. Please confirm this with `Allow` or, if you are certain about what you are doing, with `Allow Everywhere`. Inside of Accenture SFMC DevTools project folders this warning is normal because we ask to install the VSCode extension and the node module for ESLint.
|
|
220
220
|
|
|
221
221
|

|
|
222
222
|
|
|
@@ -260,7 +260,7 @@ npm update -g mcdev
|
|
|
260
260
|
|
|
261
261
|
<a id="markdown-troubleshoot-install%2Fupdate" name="troubleshoot-install%2Fupdate"></a>
|
|
262
262
|
|
|
263
|
-
### 4.1. Installing specific version
|
|
263
|
+
### 4.1. Installing a specific version
|
|
264
264
|
|
|
265
265
|
<a id="installing-specific-version" name="installing-specific-version"></a>
|
|
266
266
|
|
|
@@ -277,10 +277,10 @@ _Note: Regardless of which tag or branch you install_
|
|
|
277
277
|
**Install specific version (using a version tag on npm):**
|
|
278
278
|
|
|
279
279
|
```bash
|
|
280
|
-
npm install -g mcdev@4.1.
|
|
280
|
+
npm install -g mcdev@4.1.8
|
|
281
281
|
```
|
|
282
282
|
|
|
283
|
-
**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, 4.1.
|
|
283
|
+
**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, 4.1.8)!
|
|
284
284
|
|
|
285
285
|
> **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`.
|
|
286
286
|
|
|
@@ -290,7 +290,7 @@ npm install -g mcdev@4.1.6
|
|
|
290
290
|
|
|
291
291
|
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.
|
|
292
292
|
|
|
293
|
-
If you encounter problems, we strongly recommend
|
|
293
|
+
If you encounter problems, we strongly recommend first trying it in the default CLI.
|
|
294
294
|
|
|
295
295
|
<a name="missing-write-access-toon-macos"></a>
|
|
296
296
|
|
|
@@ -298,7 +298,7 @@ If you encounter problems, we strongly recommend to first try it in the default
|
|
|
298
298
|
|
|
299
299
|
<a id="markdown-missing-write-access-to...on-macos" name="missing-write-access-to...on-macos"></a>
|
|
300
300
|
|
|
301
|
-
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`:
|
|
301
|
+
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`:
|
|
302
302
|
|
|
303
303
|
```bash
|
|
304
304
|
sudo npm install -g mcdev
|
|
@@ -322,7 +322,7 @@ Steps to solve this:
|
|
|
322
322
|
|
|
323
323
|
1. Start Windows PowerShell with the "Run as Administrator" option.
|
|
324
324
|
2. Input the following and then hit ENTER: `set-executionpolicy remotesigned`
|
|
325
|
-
3. This will likely show a
|
|
325
|
+
3. This will likely show a lengthy message with a question to confirm the change (screenshot below). Please type `y` (="yes") and confirm with `Enter`.
|
|
326
326
|
|
|
327
327
|

|
|
328
328
|
|
|
@@ -435,7 +435,7 @@ The following description will assume a global installation for simplicity reaso
|
|
|
435
435
|
|
|
436
436
|
_Note:_ Parameters listed below in between square brackets = `[...]` are optional parameters. Required parameters are listed in between less-than / greater-than signs = `<...>`.
|
|
437
437
|
|
|
438
|
-
_Note:_ Credentials and Business Unit names can always be selected interactively. Try
|
|
438
|
+
_Note:_ Credentials and Business Unit names can always be selected interactively. Try inputting a question mark = `?` in their place if more parameters follow, or omit them completely if no other parameters are required for a command.
|
|
439
439
|
|
|
440
440
|
### 6.1. Maintenance and setup commands
|
|
441
441
|
|
|
@@ -449,11 +449,11 @@ _Command:_ `mcdev init`
|
|
|
449
449
|
|
|
450
450
|
_Alias:_ -
|
|
451
451
|
|
|
452
|
-
Creates the basic configuration file `.mcdevrc.json` and `.mcdev-auth.json` in your project directory. You may add more credentials by re-running the same command again, e.g. to add
|
|
452
|
+
Creates the basic configuration file `.mcdevrc.json` and `.mcdev-auth.json` in your project directory. You may add more credentials by re-running the same command again, e.g. to add production and sandbox credentials next to each other.
|
|
453
453
|
|
|
454
|
-
In addition, it initializes an npm package for
|
|
454
|
+
In addition, it initializes an npm package for you, installs recommended npm dependencies and places our default IDE configuration files for ESLint, Prettier, Git and VSCode into your project directory.
|
|
455
455
|
|
|
456
|
-
The initialization ends with the creation of your Git repository and
|
|
456
|
+
The initialization ends with the creation of your Git repository and the first backup of your SFMC instance.
|
|
457
457
|
|
|
458
458
|
_Example - initialize project / add additional credentials:_
|
|
459
459
|
|
|
@@ -469,7 +469,7 @@ mcdev init yourCredentialName
|
|
|
469
469
|
|
|
470
470
|
The interactive setup will ask you for an `EID (Parent MID)`, `Client ID` and `Client Secret` of an installed package. It also asks for the `Authentication Base Uri`. Each installed package on a given SFMC instance shares the same tenant sub-domain and always shows you 3 domains (Auth, REST and SOAP).
|
|
471
471
|
|
|
472
|
-
Example
|
|
472
|
+
Example URL: `https://mcg123abcysykllg-0321cbs8bbt64.auth.marketingcloudapis.com`
|
|
473
473
|
|
|
474
474
|
> **Note to CLI experts:**
|
|
475
475
|
>
|
|
@@ -487,7 +487,7 @@ _Command:_ `mcdev upgrade`
|
|
|
487
487
|
|
|
488
488
|
_Alias:_ `mcdev up`
|
|
489
489
|
|
|
490
|
-
This upgrades older Accenture SFMC DevTools projects to the newest standard: Outdated Accenture SFMC DevTools configuration files are upgraded and the right npm dependencies are installed. It also copies
|
|
490
|
+
This upgrades older Accenture SFMC DevTools projects to the newest standard: Outdated Accenture SFMC DevTools configuration files are upgraded and the right npm dependencies are installed. It also copies the right IDE configuration files into your project folder. See [init](#init) for more details.
|
|
491
491
|
|
|
492
492
|
_Example:_
|
|
493
493
|
|
|
@@ -519,7 +519,7 @@ _Command:_ `mcdev badKeys [business unit]`
|
|
|
519
519
|
|
|
520
520
|
_Alias:_ -
|
|
521
521
|
|
|
522
|
-
Lists all metadata for which the External key is not in
|
|
522
|
+
Lists all metadata for which the External key is not in sync with the name to enable you to update them quickly.
|
|
523
523
|
|
|
524
524
|
_Example:_
|
|
525
525
|
|
|
@@ -535,7 +535,7 @@ _Command:_ `mcdev document <business unit> <TYPE>`
|
|
|
535
535
|
|
|
536
536
|
_Alias:_ `mcdev doc`
|
|
537
537
|
|
|
538
|
-
Creates human
|
|
538
|
+
Creates human-readable documentation for your metadata. This command is executed by default for supported types unless you changed your config manually (`metaDataTypes.documentOnRetrieve`). Therefore, running it manually is typically not required. You can choose to generate **HTML** (`html`) or **Markdown** (`md`) docs via `options.documentType`.
|
|
539
539
|
|
|
540
540
|
The default format is set to `md` as Markdown renders nicely in Git as well as in VSCode's Markdown preview and can be copied from there into Confluence and other applications without losing the formatting.
|
|
541
541
|
|
|
@@ -564,7 +564,7 @@ _Command:_ `mcdev selectTypes`
|
|
|
564
564
|
|
|
565
565
|
_Alias:_ `mcdev st`
|
|
566
566
|
|
|
567
|
-
Allows you to
|
|
567
|
+
Allows you to interactively select which metadata is retrieved when you run the `retrieve` command. Try out `explainTypes` first to understand what each type means.
|
|
568
568
|
|
|
569
569
|
_Example:_
|
|
570
570
|
|
|
@@ -582,7 +582,7 @@ _Command:_ `mcdev explainTypes`
|
|
|
582
582
|
|
|
583
583
|
_Alias:_ `mcdev et`
|
|
584
584
|
|
|
585
|
-
A helper command for `selectTypes
|
|
585
|
+
A helper command for `selectTypes`. It prints out a table that defines what the various types are.
|
|
586
586
|
|
|
587
587
|
Types marked as not-default should be ignored. These are either under development or merely meant to support contributing to Accenture SFMC DevTools.
|
|
588
588
|
|
|
@@ -612,7 +612,7 @@ _Example:_
|
|
|
612
612
|
mcdev retrieve MyProject/DEV
|
|
613
613
|
```
|
|
614
614
|
|
|
615
|
-
You can
|
|
615
|
+
You can omit the Business Unit which will trigger an interactive mode based on your config:
|
|
616
616
|
|
|
617
617
|
_Example:_
|
|
618
618
|
|
|
@@ -629,7 +629,9 @@ mcdev retrieve MyProject
|
|
|
629
629
|
|
|
630
630
|
**retrieve specific type:**
|
|
631
631
|
|
|
632
|
-
If you want to retrieve only a certain metadata type, let's say `script`, then pass this type in as a second parameter. The other types will remain untouched and in place, if you've previously retrieved them
|
|
632
|
+
If you want to retrieve only a certain metadata type, let's say `script`, then pass this type in as a second parameter. The other types will remain untouched and in place, if you've previously retrieved them.
|
|
633
|
+
|
|
634
|
+
Similarly, you can pass in multiple comma-separated types but make sure to put them in double quotes to work on all systems.
|
|
633
635
|
|
|
634
636
|
_Example:_
|
|
635
637
|
|
|
@@ -638,9 +640,9 @@ mcdev retrieve MyProject/DEV script
|
|
|
638
640
|
mcdev retrieve MyProject/DEV "script,query,automation"
|
|
639
641
|
```
|
|
640
642
|
|
|
641
|
-
**retrieve
|
|
643
|
+
**retrieve specific type and key:**
|
|
642
644
|
|
|
643
|
-
If you wish you may also specify exact keys that need to be retrieved, filtering down on
|
|
645
|
+
If you wish you may also specify the exact keys that need to be retrieved, filtering down on what's in your retrieve folder even further. Specified keys apply as a filter for all types you specify. If your naming convention does not allow for such an aggregation then please run separate commands for each type.
|
|
644
646
|
|
|
645
647
|
_Example:_
|
|
646
648
|
|
|
@@ -684,13 +686,15 @@ _Example:_
|
|
|
684
686
|
mcdev deploy MyProject/DEV
|
|
685
687
|
```
|
|
686
688
|
|
|
687
|
-
Only metadata that you copied into the **deploy** directory will be deployed. Please
|
|
689
|
+
Only metadata that you copied into the **deploy** directory will be deployed. Please keep in mind that the folder structure needs to be similar to what the retrieve command creates in the retrieve folder, including the credentials and Business Unit name.
|
|
688
690
|
|
|
689
691
|
Similarly to `mcdev retrieve` you can also use the interactive mode to select credential and/or Business Unit.
|
|
690
692
|
|
|
691
693
|
**deploy sepcific type:**
|
|
692
694
|
|
|
693
|
-
If you want to deploy only a certain metadata type, let's say `dataExtension`, then pass this type in as a second parameter. If there are other types in the current BU's deploy folder, these will be ignored and hence _not_ uploaded
|
|
695
|
+
If you want to deploy only a certain metadata type, let's say `dataExtension`, then pass this type in as a second parameter. If there are other types in the current BU's deploy folder, these will be ignored and hence _not_ uploaded.
|
|
696
|
+
|
|
697
|
+
Similarly, you can pass in multiple comma-separated types but make sure to put them in double quotes to work on all systems.
|
|
694
698
|
|
|
695
699
|
_Example:_
|
|
696
700
|
|
|
@@ -699,9 +703,9 @@ mcdev deploy MyProject/DEV dataExtension
|
|
|
699
703
|
mcdev deploy MyProject/DEV "script,dataExtension,importFile"
|
|
700
704
|
```
|
|
701
705
|
|
|
702
|
-
**deploy
|
|
706
|
+
**deploy specific type and key:**
|
|
703
707
|
|
|
704
|
-
If you wish you may also specify exact keys that need to be deployed, filtering down on
|
|
708
|
+
If you wish you may also specify the exact keys that need to be deployed, filtering down on what's in your deploy folder even further. Specified keys apply as a filter for all types you specify. If your naming convention does not allow for such an aggregation then please run separate commands for each type.
|
|
705
709
|
|
|
706
710
|
_Example:_
|
|
707
711
|
|
|
@@ -713,7 +717,7 @@ mcdev deploy MyProject/DEV "script,dataExtension,importFile" "key1,key2"
|
|
|
713
717
|
|
|
714
718
|
**deploy from retrieve folder:**
|
|
715
719
|
|
|
716
|
-
Sometimes it's convenient to deploy right from the retrieve folder when you are using mcdev as a developer tool rather than only for deployments to other BUs. For this scenario we added the 4th parameter. In that case it does not look into `deploy/` but into `retrieve/`
|
|
720
|
+
Sometimes it's convenient to deploy right from the retrieve folder when you are using mcdev as a developer tool rather than only for deployments to other BUs. For this scenario we added the 4th parameter. In that case, it does not look into `deploy/` but into `retrieve/` finding what it needs to deploy.
|
|
717
721
|
|
|
718
722
|
_Example:_
|
|
719
723
|
|
|
@@ -725,7 +729,7 @@ mcdev deploy MyProject/DEV "script,dataExtension,importFile" "key1,key2" true
|
|
|
725
729
|
|
|
726
730
|
**deploy all BUs:**
|
|
727
731
|
|
|
728
|
-
A special variant of this command allows you to
|
|
732
|
+
A special variant of this command allows you to deploy all Business Units of a given credential at once.
|
|
729
733
|
_Example:_
|
|
730
734
|
|
|
731
735
|
```bash
|
|
@@ -778,7 +782,7 @@ _Alias:_ `mcdev rt`
|
|
|
778
782
|
|
|
779
783
|
The `rt` command retrieves metadata from the server and uses your `market` configuration in `.mcdevrc.json` to replace strings with variables. The result is then stored in your `template/` folder. Please note that files stored here will keep their original name, despite this possibly containing market-specific suffixes or similar. Also note, that contrary to the deploy & retrieve folders, you will not see credential- or Business Unit-sub-folders here.
|
|
780
784
|
|
|
781
|
-
This command is a prerequisite for the `buildDefintion` command. Alternatively
|
|
785
|
+
This command is a prerequisite for the `buildDefintion` command. Alternatively, you can copy-paste retrieved metadata from your `retrieve/` folder to your `template/` folder and update it manually - or even create it from scratch.
|
|
782
786
|
|
|
783
787
|
> **Note**: Before using this command, you need to configure your markets first! Check out our guide on [Market Configuration](#market-configuration) to understand how to use templating and prepare your market config.
|
|
784
788
|
|
|
@@ -814,9 +818,9 @@ _Command:_ `mcdev buildTemplate <business unit> <type> <name> <market>`
|
|
|
814
818
|
|
|
815
819
|
_Alias:_ `mcdev bt`
|
|
816
820
|
|
|
817
|
-
The `bt` command uses previously retrieved metadata on
|
|
821
|
+
The `bt` command uses previously retrieved metadata on your local computer and uses your `market` configuration in `.mcdevrc.json` to replace strings with variables. The result is then stored in your `template/` folder. Please note that files stored here will keep their original name, despite this possibly containing market-specific suffixes or similar. Also note, that contrary to the deploy & retrieve folders, you will not see credential- or Business Unit-sub-folders here.
|
|
818
822
|
|
|
819
|
-
This command is a prerequisite for the `buildDefintion` command. Alternatively
|
|
823
|
+
This command is a prerequisite for the `buildDefintion` command. Alternatively, you can copy-paste retrieved metadata from your `retrieve/` folder to your `template/` folder and update it manually - or even create it from scratch.
|
|
820
824
|
|
|
821
825
|
> **Note**: Before using this command, you need to configure your markets first! Check out our guide on [Market Configuration](#market-configuration) to understand how to use templating and prepare your market config.
|
|
822
826
|
|
|
@@ -852,10 +856,10 @@ _Command:_ `mcdev buildDefinition <business unit> <type> <name> <market>`
|
|
|
852
856
|
|
|
853
857
|
_Alias:_ `mcdev bd`
|
|
854
858
|
|
|
855
|
-
The `buildDefinition` command allows to prepare deployments to one or multiple targets based on templates and [Market Configuration](#market-configuration).
|
|
859
|
+
The `buildDefinition` command allows to prepare the deployments to one or multiple targets based on templates and [Market Configuration](#market-configuration).
|
|
856
860
|
After you have created your templates via `retrieveAsTemplate` (or manually) in your `template/dataExtension/` folder run this command to create the final deployable files in your respective `retrieve/<business unit>/` folder.
|
|
857
861
|
|
|
858
|
-
This allows you to double-check if you actually changed something by comparing the before and after using your favorite Git client. You then have to manually copy files you want to deploy into the respective `deploy/` folder.
|
|
862
|
+
This allows you to double-check if you actually changed something by comparing the before and after using your favorite Git client. You then have to manually copy the files you want to deploy into the respective `deploy/` folder.
|
|
859
863
|
|
|
860
864
|
> **Note**: Before using this command, you need to configure your markets first! Check out our guide on [Market Configuration](#market-configuration) to understand how to use templating and prepare your market config.
|
|
861
865
|
|
|
@@ -873,7 +877,7 @@ This will result in the following files being created in your `retrieve/MyProjec
|
|
|
873
877
|
|
|
874
878
|
**buildDefinition for multiple sources:**
|
|
875
879
|
|
|
876
|
-
You can also create
|
|
880
|
+
You can also create definitions based on multiple templates at once. Simply specify them in a comma-separated list and put that list in quotes:
|
|
877
881
|
|
|
878
882
|
```bash
|
|
879
883
|
mcdev bd MyProject/QA dataExtension "table1,table2,table3" pilotMarketDEV1
|
|
@@ -913,7 +917,7 @@ _Command:_ `mcdev createDeltaPkg [range] [filter]`
|
|
|
913
917
|
|
|
914
918
|
_Alias:_ `mcdev cdp`
|
|
915
919
|
|
|
916
|
-
This command is rather
|
|
920
|
+
This command is rather versatile and hence can be used in multiple ways. The most powerful option presents itself when you configure `options.deployment.sourceTargetMapping` to point to a source `marketList` (usually for DEV-BU with a DEV market) and a target `marketList` (e.g. to a QA BU-market combo and a Production BU-market combo). Given this is configured, it can create all deployable files using Accenture SFMC DevTools's templating engine on the fly for you.
|
|
917
921
|
|
|
918
922
|
The **minimum configuration** you need to have in your config could look something like the following:
|
|
919
923
|
|
|
@@ -972,7 +976,7 @@ The **minimum configuration** you need to have in your config could look somethi
|
|
|
972
976
|
|
|
973
977
|
**Interactive commit selection:**
|
|
974
978
|
|
|
975
|
-
This allows you to compare your latest commit (**not** what's still only unstaged/staged) with previous commits. This approach is especially useful if you are
|
|
979
|
+
This allows you to compare your latest commit (**not** what's still only unstaged/staged) with previous commits. This approach is especially useful if you are in charge of the deployment and simply want to compare the latest commits to your master / release branch with the commit that was last deployed.
|
|
976
980
|
|
|
977
981
|
> **Important**: Make sure you are on the branch corresponding to the environment you want to deploy to, e.g. the master branch.
|
|
978
982
|
|
|
@@ -1040,13 +1044,13 @@ mcdev createDeltaPkg d21b4221..HEAD 'MyProject/BU1,MyProject/BU3'
|
|
|
1040
1044
|
|
|
1041
1045
|
<a id="markdown-advanced-configuration" name="advanced-configuration"></a>
|
|
1042
1046
|
|
|
1043
|
-
The
|
|
1047
|
+
The tool's configuration can be changed in the file `.mcdevrc.json` located in the root of your project folder.
|
|
1044
1048
|
|
|
1045
1049
|
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`.
|
|
1046
1050
|
|
|
1047
1051
|
You will also find the configuration for what metadata shall be retrieved here in `metaDataTypes.retrieve: [ ... ]`.
|
|
1048
1052
|
|
|
1049
|
-
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
|
|
1053
|
+
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.
|
|
1050
1054
|
|
|
1051
1055
|
### 7.1. Config Options
|
|
1052
1056
|
|
|
@@ -1121,9 +1125,7 @@ The central config in `.mcdevrc.json` holds multiple adjustable settings:
|
|
|
1121
1125
|
|
|
1122
1126
|
#### 7.2.1. Retention Policy fields in Data Extensions
|
|
1123
1127
|
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
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.
|
|
1128
|
+
The way the 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.
|
|
1127
1129
|
|
|
1128
1130
|
| Field | Description | Values |
|
|
1129
1131
|
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------ |
|
|
@@ -1229,13 +1231,13 @@ All you have to do is deploy the data extension again with Name_new specified fo
|
|
|
1229
1231
|
|
|
1230
1232
|
<a id="markdown-market-configuration" name="market-configuration"></a>
|
|
1231
1233
|
|
|
1232
|
-
You will want to
|
|
1234
|
+
You will want to set up configs for variable parts that change in between 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.
|
|
1233
1235
|
|
|
1234
|
-
We advise clustering your logical approach into variable things on the **instance parent** (=`_ParentBU_` in Accenture SFMC DevTools), the **environment parent** (under which you cluster your child Business Units for DEV, QA and PROD respectively), and **child Business Units**. Ideally, the instance parent is only used to deploy _Shared Data Extensions_, the
|
|
1236
|
+
We advise clustering your logical approach into variable things on the **instance parent** (=`_ParentBU_` in Accenture SFMC DevTools), the **environment parent** (under which you cluster your child Business Units for DEV, QA and PROD respectively), and **child Business Units**. Ideally, the instance parent is only used to deploy _Shared Data Extensions_, the environment parent is used for integrations with external services and to separate incoming data via Automations into the respective _Shared Data Extensions_. The child Business Units are then reserved for everything that is run on a market-by-market basis.
|
|
1235
1237
|
|
|
1236
|
-
_Note:_ We do see it often that instance parent and environment parent are
|
|
1238
|
+
_Note:_ We do see it often that instance parent and environment parent are the same. This is depending on your client's setup since Business Units are not for free and clients sometimes decide to save the extra money. Sometimes, you even end up with only one BU for DEV activities, no QA environment - and share the instance parent between DEV and production... This is not the recommended approach for multiple reasons, including security, but it is the reality in some of our projects.
|
|
1237
1239
|
|
|
1238
|
-
Here a simple example with one DEV BU, 1 QA BU and 2 PROD BUs:
|
|
1240
|
+
Here is a simple example with one DEV BU, 1 QA BU and 2 PROD BUs:
|
|
1239
1241
|
|
|
1240
1242
|
```json
|
|
1241
1243
|
// example market config in your .mcdevrc.json
|
|
@@ -1271,7 +1273,7 @@ Here a simple example with one DEV BU, 1 QA BU and 2 PROD BUs:
|
|
|
1271
1273
|
}
|
|
1272
1274
|
```
|
|
1273
1275
|
|
|
1274
|
-
Way more complex example with dedicated "Parent" BUs per
|
|
1276
|
+
Way more complex example with dedicated "Parent" BUs per environment (DEV, QA, PROD) and multiple country-specific BUs for QA and for PROD:
|
|
1275
1277
|
|
|
1276
1278
|
```json
|
|
1277
1279
|
// example market config in your .mcdevrc.json
|
|
@@ -1353,7 +1355,7 @@ Way more complex example with dedicated "Parent" BUs per enviroment (DEV, QA, PR
|
|
|
1353
1355
|
|
|
1354
1356
|
<a id="markdown-market-list-configuration" name="market-list-configuration"></a>
|
|
1355
1357
|
|
|
1356
|
-
Market Lists are very powerful and you will quickly notice how much time they can
|
|
1358
|
+
Market Lists are very powerful and you will quickly notice how much time they can save you during your deployment preparation.
|
|
1357
1359
|
Let's first look at an example list config:
|
|
1358
1360
|
|
|
1359
1361
|
```json
|
|
@@ -1424,13 +1426,12 @@ Way more complex example:
|
|
|
1424
1426
|
```
|
|
1425
1427
|
|
|
1426
1428
|
First off, we don't see DEV in here. If you have more than one market in DEV then this might deviate but in general, you don't want to bulk-deploy to DEV as this is your single source of truth.
|
|
1427
|
-
|
|
1428
|
-
Apart from that we can see 4 types of lists here:
|
|
1429
|
+
Apart from that, we can see 4 types of lists here:
|
|
1429
1430
|
|
|
1430
1431
|
1. `Parent-shared` (_instance parent_): This would be used to deploy the Shared Data Extensions to the instance parent. The child-configs are listed in an array to ensure we end up with one file per child in our parent BU folder.
|
|
1431
1432
|
2. `Parent-medium`/`Parent-large` (medium:_instance parent_; large:_environment parent_): A 1:1 config that handles automations and the part of your solution that only runs on the parent.
|
|
1432
1433
|
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)
|
|
1433
|
-
4. `Children` (_child BUs_): everything that is needed on the market
|
|
1434
|
+
4. `Children` (_child BUs_): everything that is needed on the market-specific Business Units.
|
|
1434
1435
|
|
|
1435
1436
|
## 8. Examples
|
|
1436
1437
|
|
|
@@ -1458,13 +1459,13 @@ where `<BU>` needs to be replaced with `credentialName/businessUnit-Name` that i
|
|
|
1458
1459
|
|
|
1459
1460
|
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**.
|
|
1460
1461
|
|
|
1461
|
-
This folder structure can be
|
|
1462
|
+
This folder structure can be committed into a git repository and used as a backup.
|
|
1462
1463
|
|
|
1463
1464
|
### 8.3. Automation Deployment
|
|
1464
1465
|
|
|
1465
1466
|
<a id="markdown-automation-deployment" name="automation-deployment"></a>
|
|
1466
1467
|
|
|
1467
|
-
Now we want to deploy an Automation with
|
|
1468
|
+
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`)
|
|
1468
1469
|
|
|
1469
1470
|
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`)
|
|
1470
1471
|
|
|
@@ -1482,7 +1483,7 @@ If you want to enhance Accenture SFMC DevTools you are welcome to fork the repo
|
|
|
1482
1483
|
|
|
1483
1484
|
<a id="markdown-install-guide-for-developers" name="install-guide-for-developers"></a>
|
|
1484
1485
|
|
|
1485
|
-
Instead of installing Accenture SFMC DevTools as
|
|
1486
|
+
Instead of installing Accenture SFMC DevTools as an npm dependency from our git repo, we recommend cloning our repo and then linking it locally:
|
|
1486
1487
|
|
|
1487
1488
|
Assuming you cloned Accenture SFMC DevTools into `C:\repos\sfmc-devtools\` (or `~/repos/sfmc-devtools/` on Mac):
|
|
1488
1489
|
|
|
@@ -1491,9 +1492,9 @@ Assuming you cloned Accenture SFMC DevTools into `C:\repos\sfmc-devtools\` (or `
|
|
|
1491
1492
|
3. Execute `npx husky install` to enable our git hooks.
|
|
1492
1493
|
4. Execute `npm install -g "C:\repos\sfmc-devtools"` (this installs mcdev globally on your computer based on your cloned repo folder. Any changes you make in there will take immediate effect without the need for publishing or re-installing it).
|
|
1493
1494
|
|
|
1494
|
-
This should tell npm to create a symlink to your cloned local
|
|
1495
|
+
This should tell npm to create a symlink to your cloned local directory, allowing you to see updates you make in your mcdev repo instantly.
|
|
1495
1496
|
|
|
1496
|
-
To test your new **global** developer setup, run `mcdev --version` in CLI which should return the current version (e.g. `4.1.
|
|
1497
|
+
To test your new **global** developer setup, run `mcdev --version` in CLI which should return the current version (e.g. `4.1.8`). Then, go into your mcdev repo and update the version with the suffix `-dev`, e.g. to `4.1.8-dev` and then run `mcdev --version` again to verify that your change propagates instantly.
|
|
1497
1498
|
|
|
1498
1499
|
> **Not recommended:** Alternatively, you can install it locally only by opening a terminal in your project directory and executing `npm install --save-dev "C:\repos\sfmc-devtools"`
|
|
1499
1500
|
> To run the local version you need to prepend "npx" before your commands, e.g. `npx mcdev --version`
|
|
@@ -1502,9 +1503,9 @@ To test your new **global** developer setup, run `mcdev --version` in CLI which
|
|
|
1502
1503
|
|
|
1503
1504
|
**Local vs. Global developer installation:**
|
|
1504
1505
|
|
|
1505
|
-
If you use Accenture SFMC DevTools in your team it is recommended to install your developer version **globally**, while the project's package.json should point to our Git repo in its devDependency section. Otherwise other team members would have trouble due to potentially different paths.
|
|
1506
|
+
If you use Accenture SFMC DevTools in your team it is recommended to install your developer version **globally**, while the project's package.json should point to our Git repo in its devDependency section. Otherwise, other team members would have trouble due to potentially different paths.
|
|
1506
1507
|
|
|
1507
|
-
If you do need to install it locally, make sure you don't commit your project's package.json with this change or you might break mcdev for other developers in your team
|
|
1508
|
+
If you do need to install it locally, make sure you don't commit your project's package.json with this change or you might break mcdev for other developers in your team who either didn't clone the Accenture SFMC DevTools repo or stored it in a different directory.
|
|
1508
1509
|
|
|
1509
1510
|
<a name="local-install"></a>
|
|
1510
1511
|
|
|
@@ -1520,7 +1521,7 @@ The following explains how you _could_ install it locally for certain edge cases
|
|
|
1520
1521
|
1. Create a new folder for your upcoming SFMC project. Let's assume you named it `MyProject/`
|
|
1521
1522
|
> _Note:_ It is best practice to create a separate project folder for each of your client projects to avoid accidentally overwriting the wrong BU.
|
|
1522
1523
|
2. Now, open a command line interface (CLI) for that folder.
|
|
1523
|
-
- In Windows, you can easily do that by pressing SHIFT + Right
|
|
1524
|
+
- In Windows, you can easily do that by pressing SHIFT + Right-click into that folder and then selecting the option "Open PowerShell window here".
|
|
1524
1525
|
- Alternatively, you could use any other CLI. We recommend opting for [Visual Studio Code](https://code.visualstudio.com/download)'s "Terminal" as you can benefit from this later.
|
|
1525
1526
|
- Your CLI prompt should look something like `PS C:\repos\MyProject>` on Windows or `~/repos/MyProject/` on Mac.
|
|
1526
1527
|
3. Initialize your new SFMC project by running `npm init`.
|
|
@@ -1531,7 +1532,7 @@ The following explains how you _could_ install it locally for certain edge cases
|
|
|
1531
1532
|
4. Afterwards, install Accenture SFMC DevTools by running `npm install --save-dev mcdev`
|
|
1532
1533
|
- If you get an error, please see the below troubleshooting section.
|
|
1533
1534
|
|
|
1534
|
-
When completed run `mcdev --version` and it will show you which version you installed (e.g. `4.1.
|
|
1535
|
+
When completed run `mcdev --version` and it will show you which version you installed (e.g. `4.1.8`).
|
|
1535
1536
|
|
|
1536
1537
|
### 9.3. NPM Scripts
|
|
1537
1538
|
|