-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
salesforce delta deployment CICD using azure devops yaml #573
Comments
Hi, I'm not very skilled at azure devops pipeline, but I'll ask experts around me and try to come with more precise advice. The guidelines when using SGD is to git fetch locally in the CI the references you are going to compare so SGD can access those. So the checkout step should set And then you can use SGD: - bash:
mkdir output
sfdx sgd:source:delta --to "HEAD" --from "<target-branch>" --output output -d Then you can use the generated package.xml in Hope it helps |
Hi, The best way to build YAML pipelines is by trying, failing, and trying again :)
Here is a sample YAML - please test and validate in a testing environment before using in Prod. `
|
I am getting error destructive changes should i create a directory in salesforce code repository? |
The sample uses a jobs:
- deployment: DeployPackage
environment: ${{ parameters.environment }}
container: salesforce/salesforcedx:latest-full
strategy:
runOnce:
deploy:
steps:
- checkout: self
fetchDepth: 0
- task: DownloadPipelineArtifact@2
inputs:
artifact: drop
path: '$(Pipeline.Workspace)'
- task: DownloadSecureFile@1
name: jwtkeyfile
displayName: 'Download JWT key file'
inputs:
secureFile: 'JWT-${{ parameters.library }}'
- script: |
echo y | sfdx plugins:install sfdx-git-delta
sfdx plugins
displayName: 'Installing SGD'
- script: |
sfdx force:auth:jwt:grant --clientid $(consumerkey) \
--jwtkeyfile $(jwtkeyfile.secureFilePath) --username $(username) \
--setalias ${{ parameters.library }} -r ${{ parameters.instanceurl }}
sfdx force:auth:list
displayName: 'Authenticate'
-script: |
mkdir output
sfdx sgd:source:delta --to "HEAD" --from "<target-branch>" --output output -d
displayName: 'Generate incremental package'
- script: |
sfdx force:source:deploy -p output/force-app -w 60 --targetusername $(username) --noprompt
displayName: 'Deploy package'
# Following Script will remove Salesforce components specified in the destructive/destructiveChangesPost.xml file in target Orgs.
- script: |
sfdx force:mdapi:deploy -d output/destructiveChanges -w -1 --targetusername $(username) --ignorewarnings
displayName: 'Destructive Changes'` You need to replace |
@bharuk If that's ok with you I'm going to close this issue as the error does not seem related to the plugin itself, and @laithal and @scolladon have provided sample working Azure pipeline. |
Hi I am using above code I am getting unknown error `trigger: none resources:
variables:
branch :origin/develop Error: Generating script. ' |
Hi @bharuk ! It seems the Could you try using the |
It is working fine
we created already output directory why it is not found Error:
|
` please explain i am totally confusing. |
What I understand from the issue is that the So, after having executed |
Any alternative method for delta deployment. still I am facing the issues. any python scripts for this delta deployment. why because we are planning multiple stages in azure devops yaml dev sit at uat preprod and prod. still i am getting intial build i am unable to deploy the package. when i am trying grep is no luck. trigger: none
resources:
webhooks:
- webhook: gspdeltawebhook ### Webhook alias
connection: gspdeltawebhook
filters:
- path: pull_request.merged
value: true
- path: pull_request.base.ref
value: "develop" ##branch
repositories:
- repository: b2b-gsp-slfdelta
type: githubenterprise
name: VFGroup-TaaS-Tenants/b2b-gsp-slfdelta
ref: develop
endpoint: Vodafone_GSP_Delta
variables:
- name: devops_dir
value: "/home/vsts/work/1/b2b-gsp-deltadevops"
- name: global_dir
value: "/home/vsts/work/1/s/b2b-gsp-slfdelta"
- group: vargroup-sfdx
stages:
- stage: Creation
jobs:
- job: Build
timeoutInMinutes: 360
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
path: b2b-gsp-deltadevops
- checkout: b2b-gsp-slfdelta
fetchDepth: 0
- task: DownloadSecureFile@1
name: DevserverkeyFile
displayName: download rsa key
inputs:
secureFile: 'Devserver.key'
- script: |
echo installing the $(DevserverkeyFile.secureFilePath) to the trusted directory
- bash:
npm install -g npm
displayName: Install Latest version of npm
- bash:
npm install sfdx-cli --global
displayName: Install SFDX
- script: |
echo y | sfdx plugins:install sfdx-git-delta
sfdx plugins
displayName: 'Installing SGD'
#INSTALL VLOCITY BUILD TOOL
- bash:
npm install --global vlocity
displayName: Install Vlocity
- bash: |
cd $(devops_dir)
sfdx force:auth:jwt:grant --clientid $(DevhubclientId) --jwtkeyfile $(DevserverkeyFile.secureFilePath) --username $(DevhubUserName) --instanceurl $(DevhubInstanceURL)
displayName: 'Authenticate'
- script: |
cd $(global_dir)
#mkdir output
sfdx sgd:source:delta --to "HEAD" --from "origin/develop" --output
displayName: 'Generate incremental package'
- script: |
cd $(global_dir)
#grep -q output/package/package.xml && sfdx force:source:deploy -x output/package/package.xml
sfdx force:source:deploy -x package/package.xml
#sfdx force:source:deploy -p output/force-app -w 60 --targetusername $(DevhubUserName)
displayName: 'Deploy package' |
Hi! I see multiple potential root cause here:
mkdir output
sfdx sgd:source:delta --to "HEAD" --from "origin/develop" --output output
sfdx force:source:deploy -x output/package/package.xml I hope it helps |
2023-05-11T12:57:17.8740582Z ##[debug]/usr/bin/bash arg: /home/vsts/work/_temp/ebb9c158-9009-4f48-a258-00afe10ca9a9.sh above error i am getting no authorization information found |
Hi @bharuk I would say the authentication step failed here, no ? What I can see in there is it seems to authenticate to a devhub but it does not create a scratch org I hope it helps |
Is your proposal related to a problem?
Hi we are planning to salesforce delta using azure devops CICD i want help from yaml script to build salesforce delta deployment
Describe a solution you propose
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: