Skip to main content

Posts

Reducing Manual Tasks in Salesforce DevOps

  🚩Focus: Automating the Deletion of Old Flow Versions ❓One of the most frequently asked questions I get as a DevOps Consultant is: “How can we reduce manual tasks during deployments?” A common manual task is deleting outdated Flow versions in Salesforce. Here’s why automating this step is valuable: 🚨 Why Automate This? Deleting old Flow versions is a best practice that helps in several ways: Improves overall performance Reduces clutter in the environment Makes the system easier to manage, especially during continuous development and iteration How to Automate Flow Deletion Deleting old Flow versions is fairly simple in itself, but doing it manually across multiple orgs during forward or backward promotions can become a tedious and error-prone process. 🚩Here are a few ways to automate it: 1. Using Salesforce Inspector Reloaded or Other Tools Supporting Tooling API You can run a query to fetch obsolete Flow versions and delete them using tools that support the Tooling API. 2. Usin...

SonarQube Installation locally on Windows

Download the SonarQube community edition from https://www.sonarsource.com/products/sonarqube/downloads/ update the path in  sonarqube-8.9.10.61524\conf\wrapper.conf edit below path wrapper.java.command= C:\Program Files\Java\jdk-11\bin\java Goto the below path \sonarqube-8.9.10.61524\bin\windows-x86-64\ and run startsonar.bat there are four steps: 1 create a project and generate the user token and generate login token and copy it 2 donwload the sonarscanner and set the path 3 go to the project path and run the below command sonar-scanner.bat -D"sonar.projectKey=DEMO" -D"sonar.sources=." -D"sonar.host.url=http://localhost:9000" -D"sonar.login=XXXXX" 4 go the sonarqube dashboard and refresh it the dashboard Any 3rd party tool is required for generating the code coverage and inject that along with sonarqube,  sonarqube should be feed with code coverage tool in order to see the code coverage results in sonarqube dashboard. 

Sending mail using powerscript

$EmailFrom = "XXXXXX@gmail.com" $EmailTo = "XXXXX@outlook.com" $Subject = "Subject" $Body = "Body" $SMTPServer = "smtp.gmail.com" $SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587) $SMTPClient.EnableSsl = $true $SMTPClient.Credentials = New-Object System.Net.NetworkCredential("XXXXX@gmail.com", "XXXXXXX"); $SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)

jenkins master ip address changed and slaves node disconnected

Please refer to the below: In your jenkins Dashboard go to Manage Jenkins > Configure System Under Jenkins Location set the Jenkins URL to the new IP address of your server computer Save changes On jenkins dashboard under Build Executor Status click on your slave node Click launch button to download new slave agent with updated IP and save it in desired location. web start slave launch. On the picture, below the sentence "Run from slave command line" you should see a command that includes the new IP address Launch the slave agent and it should now connect to the new IP address successfully! Hope this helps anyone else!  use the below command to connect to master and run it on agent: java -jar agent.jar -jnlpUrl http://65.0.89.147:8080/computer/new%20node/jenkins-agent.jnlp -secret ec3d573f1cc65cc77c00474aedb3891a5ba8b9d3e235c32acdfaf4cb6a518a84 -workDir "" the above command runs in the foreground and when ctrl+c, connection will be lost between slave and master. ...

Salesforce Deployment Software installation

sudo su - yum install git  you can skip the below because node is installed in sfdx package curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash . ~/.nvm/nvm.sh nvm install node node -e "console.log('Running Node.js ' + process.version)" Please don't run npm install --global sfdx-cli in AWS Ec2 machine, when you run this command, the ec2-machines hangs and won't respond. reboot the ec2 instance and run the below commands to install sfdx manually. wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz mkdir /opt/sfdx tar xJf sfdx-linux-x64.tar.xz -C /opt/sfdx --strip-components 1 export PATH=/opt/sfdx/bin:$PATH if you have to edit the PATH, then use set PATH="path" Go jenkins plugins and install custom tool plugin Go to global tool configuration  Under Custom tool Name: toolbelt exported path: /usr/bin/sfdx/bin Installation directory /usr/bin/sfdx/bin/sfdx The right way of insta...

Jenkins for salesforce on RHEL OS or CentOS and configuring jenkins slave

To find the version  cat /etc/os-release sudo su - yum install jyava-11-openjdk-devel curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | sudo tee /etc/yum.repos.d/jenkins.repo sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key sudo yum install jenkins -y sudo systemctl enable jenkins sudo systemctl start jenkins systemctl status jenkins sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp sudo firewall-cmd --reload =================================================== Create a another instance for slave connect the vm using pem file and  cd ~/.ssh ssh-keygen -t rsa -C "The access key for Jenkins slaves" cat id_rsa.pub > ~/.ssh/authorized_keys cat id_rsa Add the SSH Private Key to Jenkins Credentials Go to jenkins dashboard –> credentials –> Global credentials –> add credentials Create a Slave in jenkins CONFIGURE AGENT -> LAUNCH METHOD -> Manually trusted key verification strategy - > SAVE. If Manua...

Jenkins install for salesforce

First create a ec2-user with latest ami(amazon linux machine) connect to ec2-user and type the below commands sudo su -  amazon-linux-extras install java-openjdk11 -y wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key yum install -y jenkins chkconfig jenkins on systemctl enable jenkins.service systemctl restart jenkins systemctl status jenkins cat /var/lib/jenkins/secrets/initialAdminPassword #Perform a quick update on your instance: sudo yum update -y #Install git in your EC2 instance sudo yum install git -y #Check git version git version Find the path where java is installed using the below command which java copy the bin directory and update the java path in global tool configuration  which git copy the bin directory and update the git path in global tool configuration 

Salesforce ant deployment

Installing java latest version  https://techviewleo.com/install-java-openjdk-on-amazon-linux-system/ wget https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_linux-x64_bin.tar.gz tar xvf openjdk-17_linux-x64_bin.tar.gz sudo mv jdk-17 /opt/ sudo tee /etc/profile.d/jdk.sh <<EOF      export JAVA_HOME=/opt/jdk-17 export PATH=$PATH:$JAVA_HOME/bin EOF source /etc/profile.d/jdk.sh echo $JAVA_HOME java -version wget http : / / www - us .apache .org / dist / / ant / binaries / apache - ant - 1.9.7 - bin .zip unzip apache - ant - 1.9.7 - bin .zip mv apache - ant - 1.9.7 - bin .zip / opt / ant export ANT_HOME=/opt/ant export PATH=$PATH:$ANT_HOME/bin/ ant --version download the jdk and ant for the first time in pipeline and use export options. When running the ci pipeline for the second time use  If you get permission denied error, choose any location where you have rights and use export path for using the commands in jenkins p...

cicd process

https://www.youtube.com/watch?v=9jRu-sFC8Xw  

devops

 Importance of build stage, Basically converting the source code files  The software build is a general term in the software development world. The software build is an activity to translate the human-readable source code into an efficient executable program. It is the process of creating the application binaries for a software release, by taking all the relevant source code files and compile them and then creating a build artifact (such as binaries and executable program, etc.) Build Process is the combination of several activities that varies for each programming language and operating systems but the basic concept will be the same. What is the Procedure to build? Fetching the code from the source control repository like Github, bitbucket, etc. Compile the code and check the dependencies. Run the automated unit tests. Link the library, files, code, etc accordingly. When everything is successfully passed, it’s built an artifact and store. Achieve the build logs. Send the noti...

Devops terms

 Non-functional Facets Canary Release Derived from the phrase “canary in a coal mine”, the canary release functions in a similar manner. It is used to gradually introduce a software release to a small subgroup of users, making sure that it is safe and functional before being rolled out to the general populace. Configuration Drift Configuration drift occurs when servers in an organization’s infrastructure become more and more different over time, drifting away from their original intended state. Typically it is caused by changes to software or hardware that are not recorded or tracked consistently. Continuous Integration (CI) Continuous integration is a software development practice where developers are required to integrate code into a shared repository multiple times per day for the purpose of getting rapid feedback. Together with continuous delivery, it forms the modern CI/CD delivery pipeline. DevSecOps  DevSecOps involves incorporating security into all stages of the softw...