-
Notifications
You must be signed in to change notification settings - Fork 2
Contributors
The code is maintained by Accenture with support from Copado. If you want to contribute, simply clone the repo and create pull requests back to our repo's main branch. We will review your suggestion and once everything is OK, merge it into the main code base.
- To check if it is already installed, at the OS command prompt, type:
node --version- 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.
- If you get a “command not found” error message, continue to step 2.
- In a web browser, go to nodejs.org
- Download and run the latest LTS installer for your operating system.
- 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.
- To check if git is already installed, at the OS command prompt, type:
git version- 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.
- If you get a “command not found” error message, continue to step 2.
- Go to git-scm.com/downloads.
- Under Downloads, click the icon for your operating system.
- Run the installer.
- 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.
- clone the repo
- set up the connection to your SFDC test environment
- set up an installed package in Marketing Cloud (see mcdev wiki)
- Ensure to set up your environment files in
copado-function/app/environment - Ensure you installed copado-mock and copado-git-get-mock
- create the empty folder
/copado-function/tmp
The bridge between Accenture SFMC DevTools and Copado DevOps Platform is written in Node.js.
Its source code is located in /copado-function/app. The main function files end on .fn.js. Shared classes are in the subfolder common/ and type definitions are in the subfolder types/.
Developer-Documentation on each of the functions (generated from JSDoc) is saved in /copado-function/docs/documentation.md.
The /copado-function/config holds definitions on how Copado functions and also System Properties of various Salesforce objects should be set up in Copado to work properly.
The files that shall be used on your server are auto-generated into /copado-function/dist. Do not edit files in here. Instead, run npm run build for a 1-time build or npm run build:watch to have a continuously running script in the background that updates the dist folder whenever you make changes to one of the source files in the app directory.
Make sure you set up the environment files according to the samples provided in /copado-function/app/environment/. Please save a copy of the samples with file extension .env and add your test values.
Next, you can use VSCode's Run and Debug tab to start any of our functions and get the full debug output into your terminal. This relies on 2 mocks: copado-git-get-mock and copado. Both need to be installed globally:
npm install -g copado-mock copado-git-get-mockRunning the function will create a local folder in /copado-function/tmp/ into which the git repo of your project is cloned into.
WARNING: Please be aware that running Init, Commit and Deploy WILL make changes to your Git repo. Therefore, make sure you are using a test repo for it. Also be aware, that Deploy WILL make changes to your target business unit.
Copado uses Docker images to bundle necessary components like mcdev and make them available to our copado-functions. The image we use is defined in /copado-function/app/images/Dockerfile
The repo is set up as a normal Salesforce project, with the addition of the /copado-functions folder. You will find all deployable components in the standard folder /force-app/main/default.
Please ensure that any added components start with the prefix mcdo_ to make them easily identifiable. It's an abbreviation for "Marketing Cloud DevOps".
When debugging in Salesforce, we advise using the packaged Salesforce App "Copado MCDev Contributor" for easy access to all relevant objects. Make sure that your user has the System Administrator profile to avoid issues during development and that you have assigned our Permission Set "Copado Marketing Cloud" to your user.
Depending on the release, you need to run one of these commands:
npm run version:patchnpm run version:minornpm run version:major
followed by a manual execution of git push (that's done manually to give you a chance to opt-out of the release again in case it was run accidentally). Afterwards, please create a new GitHub release, choosing the version-tag that the above created.
Copyright (c) 2022-2023 Accenture. MIT licensed. Main contributors: Jörn Berkefeld