@marsson/ciutils v0.2.1
SF-CIUtils: Salesforce CI/CD Utilities ๐
๐ What is SF-CIUtils?
SF-CIUtils is a powerful toolkit for Salesforce developers who want to supercharge their CI/CD workflows! This plugin for the Salesforce CLI provides essential utilities that make continuous integration and deployment with Salesforce a breeze.
Think of it as your Swiss Army knife for Salesforce CI/CD operations - whether you're validating repository metadata, monitoring deployments, managing file uploads, or handling user permissions, SF-CIUtils has got you covered!
โจ Features
- Validate Repository Metadata: Compare your local metadata with what's in your org to catch metadata drift
- Report on Deployments: Get detailed, real-time information about your deployments
- Create Files: Upload files to Salesforce with ease
- Remove Assignments: Efficiently manage permission sets, permission set groups, and group assignments
๐ Installation
sf plugins install @marsson/ciutilsOr install a specific version:
sf plugins install @marsson/ciutils@x.y.z๐ง Commands
sf validate repository metadata
This command helps you validate your local metadata against what's in your Salesforce org. It's like having a detective that spots differences between your local files and what's actually deployed!
sf validate repository metadata --folder path/to/metadata --target-org your-orgExample: Check if your local Apex classes match what's in your production org:
sf validate repository metadata --folder force-app/main/default/classes --target-org productionsf reporton deployment
Keep an eye on your deployments with this command. It's like having a deployment dashboard right in your terminal!
sf reporton deployment --deploymentid 0AfXXXXXXXXXXXXXXX --target-org your-orgExample: Monitor a deployment and wait for it to complete:
sf reporton deployment --deploymentid 0AfXXXXXXXXXXXXXXX --target-org production --awaitcompletionsf create file
Upload files to your Salesforce org with this handy command. Perfect for adding documents, images, or any other files to your org!
sf create file --file path/to/file --target-org your-orgExample: Upload an image and attach it to a record:
sf create file --file assets/logo.png --title "Company Logo" --parent-id 001XXXXXXXXXXXXXXX --target-org productionsf remove assignments
Efficiently manage user permissions by removing assignments from users. Great for cleaning up access during user offboarding!
sf remove assignments --object PermissionSet --usernames user@example.com --target-org your-orgExample: Remove multiple permission sets from multiple users:
sf remove assignments --object PermissionSet --usernames user1@example.com user2@example.com --target-org production๐งช Development
To contribute to SF-CIUtils, follow these steps:
Clone the repository:
git clone https://github.com/marsson/sf-ciutils.gitInstall dependencies:
yarn installBuild the plugin:
yarn buildLink to your local Salesforce CLI:
sf plugins link .Run tests:
yarn test
๐ค Contributing
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.
๐ Acknowledgments
- Thanks to the Salesforce CLI team for their amazing work
- Shoutout to all the contributors who have helped make this project better
- Special thanks to the Salesforce developer community for their continuous support
Happy coding! May your deployments be swift and your validations pass on the first try! ๐