SlideShare a Scribd company logo
Salesforce developer journey in
sfdx release management world
( part II )
1 - Create AWS Instance
> 2 Install Jenkins and sfdx on AWS Instance
> 3 Setup Pipeline 1 : automate testing your code
4 - Setup Pipeline 2 : automate delivery in a sandbox
Badbaxx - Salesforce developer
@84D84XX
“Back to salesforce side”
1 - Overview Lifecycle
2 - Settings dev hub
3 - Install Essentials Tools on aws (sfdx + git)
4 - Create Github Account and project
5 - Setup Variables Jenkins
6 - Create the Job
An Overview of sfdx CI environment
SO
repo
repo
checkout
repo
dev. computer
sfdx push
sfdx pull
git push
git pull
● pipeline 1 : test code
● pipeline 2 : delivery
● pipeline n : ...
Trigger by webhook or CRON
pipeline 1 : basic test on code in our repo
repo
Run apex test
04
● Run apex test (local)
sfdx force:apex:test:run
Push to Scratch Org
03
➔ push data from the repo git
sfdx force:source:push
Create Scratch Org
02
➔ Connect to devhub and create SO
sfdx force:org:create
01
Checkout
repo
SO
SO
2 - Setup Salesforce side
We need now a developer org to continue. You can create one at :
https://developer.salesforce.com/signup
The first step is to activate dev hub option :
From Setup, enter Dev Hub in Quick Find box > select Dev Hub.
To enable Dev Hub, click Enable.
Create jwt token as explain in salesforce
documentation
https://developer.salesforce.com/docs/atlas.en-us.s
fdx_dev.meta/sfdx_dev/sfdx_dev_auth_key_and_c
ert.htm
Create jwt token
2 - Setup Salesforce side
Create a connected app as explained in the
documentation (step 1 to 15)
https://developer.salesforce.com/docs/atlas.en-us.
sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_connecte
d_app.html
Create connected App
2 - Setup Salesforce side
With enabling dev hub in our org, we can now execute sfdx command on it
The Connected app will permit Jenkins to authenticate with the dev hub org and
communicate
The jwt token is the way we will authenticate to the dev hub, via the connected app
2 - Setup Salesforce side
3 - Install git on your aws Instance
Back in puTTY (see part 1) we will install
git with the command :
sudo yum install git
You can verify that it was install with the
command
which git
path where git is install : /usr/bin/git
3 - Install sfdx CLI on your aws instance
You can Install the sfdx cli following salesforce documentation, with the
following command in puTTY :
wget
https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd
64.tar.xz
mkdir sfdx
tar xJf sfdx-linux-amd64.tar.xz -C sfdx --strip-components 1
./sfdx/install
You can get the installation repository with the command : which sfdx
https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
Installing Git and sfdx-cli will permit us to use those software in Jenkins
With sfdx-cli we will use sfdx command to interact with the dev hub and SO
With git, we will checkout our repo on github and get the code we want to test and
push to SO
3 - Installing tools
4 - Set up your github project
https://github.com/baddbaxx/sfdx-project.git
go to your github account
click “+” and import
repository
in clone URL insert :
https://github.com/baddbaxx/
sfdx-project.git
in Name of the new repo.
insert sfdx-project
=> Begin import
5 - Configure Variables
● Credentials
We will add the server.key file (created at the connected app step)
to Jenkins credentials :
Kind Secret file
Scope Global
Id SecretFile
5 - Configure Variables
● Environment variables
Check the environment variable checkbox and add those
4 variables
HUB_ORG_DH : The username for the Dev Hub org, such
as badbaxx@mydomain.com
SFDC_HOST_DH : The login URL of the Salesforce instance
that is hosting the Dev Hub org. The default is
https://login.salesforce.com
CONNECTED_APP_CONSUMER_KEY_DH : The consumer key
that was returned after you created a connected app in
your Dev Hub org.
JWT_CRED_ID_DH : The credentials ID for the private key
file that you stored in the Jenkins Admin Credentials
interface
We will now create the first jenkins job. Select New Item and Freestyle project to star
6 - Create the first job
6 - Create the first job
Select > Pipeline script from SCM
SCM > Git
Repository > Url to your github project
Branch > */master
Script path > Jenkinsfile (in root directory)
Save
and ...
6 - Create the first job
Click buld Now to start the build and play the
script contained in the Jenkins File
fail…
let’s look at the log to debug :
click the little arrow near your build
and select
6 - Create the first job
6 - Create the first job
As you can see, the problem come from a security issue:
you need to approve the signature
=> click on the link Administrators can decide whether to ...
click approve and go back to the job and
click again
6 - Create the first job
you should need to launch again the job 2
time and approve the same way
(See possible trouble next page)
6 - Create the first job
FInally ...
6 - Create the first job
TROUBLE !!!
1- You can only have 3 SO at the same time with a developer edition.
> The job will fail if you already have 3 SO associated with your dev hub
solution : go to your dev hub instance and delete SO
(App Laucher > Active Scratch Org)
2- You can only create a limited number of SO per day. If you reach this point,
you will need to wait 24h to create a new one (and success this pipeline)
6 - Create the first job
you can see all element from your repo deployed
your can see info for all test class (only one here)
Read the log :
Part II Summary
We set up Jenkins on aws to use sfdx-cli
We set up Jenkins on aws to use git
We create a sfdx project in github
We create a basic pipeline to :
- Create a Scratch Org (SO)
- Push Git project in the SO
- launch test class
In last part, we will see :
Deploy the sfdx-project in sandbox with jenkins
Restart Jenkins
sudo service jenkins restart
Annexe
Find something on your aws instance
which <software>
Navigate in file and folder with puTTY
https://www.computerhope.com/issues/chusedos.htm
Update sfdx
sfdx update

More Related Content

What's hot

Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
Paulo Henrique Nonaka
 
Git
GitGit
Devops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at GitlabDevops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at Gitlab
Filipa Lacerda
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Steffen Gebert
 
Git and git hub basics
Git and git hub basicsGit and git hub basics
Git and git hub basics
prostackacademy
 
Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Introducing GitLab (June 2018)
Introducing GitLab (June 2018)
Noa Harel
 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
Sébastien Saunier
 
Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github Actions
Knoldus Inc.
 
Control de versiones utilizando Git
Control de versiones utilizando GitControl de versiones utilizando Git
Control de versiones utilizando Git
Hugo Gilmar Erazo
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
Vladimir Parfenov
 
Azure DevOps
Azure DevOpsAzure DevOps
Azure DevOps
Allied Consultants
 
Version control
Version controlVersion control
Version control
visual28
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
Jeremy Coates
 
Introducing GitLab
Introducing GitLabIntroducing GitLab
Introducing GitLab
Taisuke Inoue
 
Hello Flutter
Hello FlutterHello Flutter
Hello Flutter
rihannakedy
 
Git advanced
Git advancedGit advanced
Git advanced
Peter Vandenabeele
 
React native
React nativeReact native
Getting started with flutter
Getting started with flutterGetting started with flutter
Getting started with flutter
rihannakedy
 
Techical Workflow for a Startup
Techical Workflow for a StartupTechical Workflow for a Startup
Techical Workflow for a Startup
Sébastien Saunier
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTree
Teerapat Khunpech
 

What's hot (20)

Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
 
Git
GitGit
Git
 
Devops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at GitlabDevops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at Gitlab
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Git and git hub basics
Git and git hub basicsGit and git hub basics
Git and git hub basics
 
Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Introducing GitLab (June 2018)
Introducing GitLab (June 2018)
 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
 
Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github Actions
 
Control de versiones utilizando Git
Control de versiones utilizando GitControl de versiones utilizando Git
Control de versiones utilizando Git
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
 
Azure DevOps
Azure DevOpsAzure DevOps
Azure DevOps
 
Version control
Version controlVersion control
Version control
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
 
Introducing GitLab
Introducing GitLabIntroducing GitLab
Introducing GitLab
 
Hello Flutter
Hello FlutterHello Flutter
Hello Flutter
 
Git advanced
Git advancedGit advanced
Git advanced
 
React native
React nativeReact native
React native
 
Getting started with flutter
Getting started with flutterGetting started with flutter
Getting started with flutter
 
Techical Workflow for a Startup
Techical Workflow for a StartupTechical Workflow for a Startup
Techical Workflow for a Startup
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTree
 

Similar to sfdx continuous Integration with Jenkins on aws (Part II)

Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)
Bohdan Dovhań
 
SFDX Presentation
SFDX PresentationSFDX Presentation
SFDX Presentation
Bohdan Dovhań
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
Pantheon
 
SFDX - Spring 2019 Update
SFDX - Spring 2019 UpdateSFDX - Spring 2019 Update
SFDX - Spring 2019 Update
Bohdan Dovhań
 
CodeShip
CodeShipCodeShip
CodeShip
Bryan Reinbolt
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
Amazon Web Services
 
Automate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaAutomate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon Vienna
Pantheon
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Acquia
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
kesavan N B
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Troublemaker Khunpech
 
Create Your First Cocoa pods
Create Your First Cocoa podsCreate Your First Cocoa pods
Create Your First Cocoa pods
Pawan Ramteke
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
Javier López
 
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Mihai Criveti
 
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer ToolsDevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
Amazon Web Services
 
Python Automation With Gauge + Selenium + API + Jenkins
Python Automation With Gauge + Selenium + API + JenkinsPython Automation With Gauge + Selenium + API + Jenkins
Python Automation With Gauge + Selenium + API + Jenkins
Fagun Priyadarshi
 
Develop FOSS project using Google Code Hosting
Develop FOSS project using Google Code HostingDevelop FOSS project using Google Code Hosting
Develop FOSS project using Google Code Hosting
Narendra Sisodiya
 
Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015
Kurt Madel
 
AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...
AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...
AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...
Amazon Web Services
 
[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입
[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입
[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입
choi sungwook
 

Similar to sfdx continuous Integration with Jenkins on aws (Part II) (20)

Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)
 
SFDX Presentation
SFDX PresentationSFDX Presentation
SFDX Presentation
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
SFDX - Spring 2019 Update
SFDX - Spring 2019 UpdateSFDX - Spring 2019 Update
SFDX - Spring 2019 Update
 
CodeShip
CodeShipCodeShip
CodeShip
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
Automate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaAutomate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon Vienna
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
 
Create Your First Cocoa pods
Create Your First Cocoa podsCreate Your First Cocoa pods
Create Your First Cocoa pods
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
 
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
 
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer ToolsDevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
 
Python Automation With Gauge + Selenium + API + Jenkins
Python Automation With Gauge + Selenium + API + JenkinsPython Automation With Gauge + Selenium + API + Jenkins
Python Automation With Gauge + Selenium + API + Jenkins
 
Develop FOSS project using Google Code Hosting
Develop FOSS project using Google Code HostingDevelop FOSS project using Google Code Hosting
Develop FOSS project using Google Code Hosting
 
Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015
 
AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...
AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...
AWS re:Invent 2016: DevOps on AWS: Accelerating Software Delivery with the AW...
 
[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입
[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입
[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입
 

Recently uploaded

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 

Recently uploaded (20)

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 

sfdx continuous Integration with Jenkins on aws (Part II)

  • 1. Salesforce developer journey in sfdx release management world ( part II ) 1 - Create AWS Instance > 2 Install Jenkins and sfdx on AWS Instance > 3 Setup Pipeline 1 : automate testing your code 4 - Setup Pipeline 2 : automate delivery in a sandbox Badbaxx - Salesforce developer @84D84XX
  • 2. “Back to salesforce side” 1 - Overview Lifecycle 2 - Settings dev hub 3 - Install Essentials Tools on aws (sfdx + git) 4 - Create Github Account and project 5 - Setup Variables Jenkins 6 - Create the Job
  • 3. An Overview of sfdx CI environment SO repo repo checkout repo dev. computer sfdx push sfdx pull git push git pull ● pipeline 1 : test code ● pipeline 2 : delivery ● pipeline n : ... Trigger by webhook or CRON
  • 4. pipeline 1 : basic test on code in our repo repo Run apex test 04 ● Run apex test (local) sfdx force:apex:test:run Push to Scratch Org 03 ➔ push data from the repo git sfdx force:source:push Create Scratch Org 02 ➔ Connect to devhub and create SO sfdx force:org:create 01 Checkout repo SO SO
  • 5. 2 - Setup Salesforce side We need now a developer org to continue. You can create one at : https://developer.salesforce.com/signup The first step is to activate dev hub option : From Setup, enter Dev Hub in Quick Find box > select Dev Hub. To enable Dev Hub, click Enable.
  • 6. Create jwt token as explain in salesforce documentation https://developer.salesforce.com/docs/atlas.en-us.s fdx_dev.meta/sfdx_dev/sfdx_dev_auth_key_and_c ert.htm Create jwt token 2 - Setup Salesforce side
  • 7. Create a connected app as explained in the documentation (step 1 to 15) https://developer.salesforce.com/docs/atlas.en-us. sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_connecte d_app.html Create connected App 2 - Setup Salesforce side
  • 8. With enabling dev hub in our org, we can now execute sfdx command on it The Connected app will permit Jenkins to authenticate with the dev hub org and communicate The jwt token is the way we will authenticate to the dev hub, via the connected app 2 - Setup Salesforce side
  • 9. 3 - Install git on your aws Instance Back in puTTY (see part 1) we will install git with the command : sudo yum install git You can verify that it was install with the command which git path where git is install : /usr/bin/git
  • 10. 3 - Install sfdx CLI on your aws instance You can Install the sfdx cli following salesforce documentation, with the following command in puTTY : wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd 64.tar.xz mkdir sfdx tar xJf sfdx-linux-amd64.tar.xz -C sfdx --strip-components 1 ./sfdx/install You can get the installation repository with the command : which sfdx https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
  • 11. Installing Git and sfdx-cli will permit us to use those software in Jenkins With sfdx-cli we will use sfdx command to interact with the dev hub and SO With git, we will checkout our repo on github and get the code we want to test and push to SO 3 - Installing tools
  • 12. 4 - Set up your github project https://github.com/baddbaxx/sfdx-project.git go to your github account click “+” and import repository in clone URL insert : https://github.com/baddbaxx/ sfdx-project.git in Name of the new repo. insert sfdx-project => Begin import
  • 13. 5 - Configure Variables ● Credentials We will add the server.key file (created at the connected app step) to Jenkins credentials : Kind Secret file Scope Global Id SecretFile
  • 14. 5 - Configure Variables ● Environment variables Check the environment variable checkbox and add those 4 variables HUB_ORG_DH : The username for the Dev Hub org, such as badbaxx@mydomain.com SFDC_HOST_DH : The login URL of the Salesforce instance that is hosting the Dev Hub org. The default is https://login.salesforce.com CONNECTED_APP_CONSUMER_KEY_DH : The consumer key that was returned after you created a connected app in your Dev Hub org. JWT_CRED_ID_DH : The credentials ID for the private key file that you stored in the Jenkins Admin Credentials interface
  • 15. We will now create the first jenkins job. Select New Item and Freestyle project to star 6 - Create the first job
  • 16. 6 - Create the first job Select > Pipeline script from SCM SCM > Git Repository > Url to your github project Branch > */master Script path > Jenkinsfile (in root directory) Save
  • 17. and ... 6 - Create the first job Click buld Now to start the build and play the script contained in the Jenkins File
  • 18. fail… let’s look at the log to debug : click the little arrow near your build and select 6 - Create the first job
  • 19. 6 - Create the first job As you can see, the problem come from a security issue: you need to approve the signature => click on the link Administrators can decide whether to ...
  • 20. click approve and go back to the job and click again 6 - Create the first job
  • 21. you should need to launch again the job 2 time and approve the same way (See possible trouble next page) 6 - Create the first job FInally ...
  • 22. 6 - Create the first job TROUBLE !!! 1- You can only have 3 SO at the same time with a developer edition. > The job will fail if you already have 3 SO associated with your dev hub solution : go to your dev hub instance and delete SO (App Laucher > Active Scratch Org) 2- You can only create a limited number of SO per day. If you reach this point, you will need to wait 24h to create a new one (and success this pipeline)
  • 23. 6 - Create the first job you can see all element from your repo deployed your can see info for all test class (only one here) Read the log :
  • 24. Part II Summary We set up Jenkins on aws to use sfdx-cli We set up Jenkins on aws to use git We create a sfdx project in github We create a basic pipeline to : - Create a Scratch Org (SO) - Push Git project in the SO - launch test class In last part, we will see : Deploy the sfdx-project in sandbox with jenkins
  • 25. Restart Jenkins sudo service jenkins restart Annexe Find something on your aws instance which <software> Navigate in file and folder with puTTY https://www.computerhope.com/issues/chusedos.htm Update sfdx sfdx update