We’re Here to Help!!

Find A Solution, Learn Best Practices & Get Support 24x7

Git Integrations

Follow

Release Management
Implementation Guide

Index

    Core Setups
  • 1Overview
  • 2Installing Flosum
  • 3Setting up Flosum integration user
  • 4Connecting sandboxes to Flosum
  • 5Setting up users in Flosum
  • 6Setting org permissions
  • 7Decide on naming convention
  • 8Initialize the repository
  • 9Setting up workflow permissions
  • Application Development Flow
  • 10Pulling changes from dev sandboxes
  • 11Branching strategy
  • 12Conflict and Merge strategy
  • 13Static Code Analysis
  • 14Apex
  • 15Regression testing
  • 16Reference Architecture
  • Integrations
  • 17Jira
  • 18TFS/Azure Devops
  • 19Git Integrations
  • Compliance & Governance
  • 20Compliance & Governance

This guide will walk you through how to configure an integration with Git. Please complete the applicable steps in the order they appear. 

  • Installing Flosum – Git app
  • Configuring GitHub
  • Configuring GitLab
  • Configuring BitBucket
  • Set up Heroku App
  • Adding Users to BitBucket
  • Adding Users to GitHub
  • Committing using trigger

 

1. Installing Flosum – Git app

The first step is to install the Flosum-Git app.

To install this app, login to your Salesforce org. Then click on this packaging URL:


https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1i0000013uiI - Version 1.16

mceclip1.png

Select “Install for All Users”, check the checkbox and click “Install”.


On the next screen, select all of the checkboxes and then click “Continue”.

mceclip2.png

Do not close this window. The installation will take approximately 5-10 minutes to complete.

After the installation is complete, we need to create a connected app on GitLab and/or GitHub and set up our layout. The BitBucket integration setup is very easy.

The next step is to add remote site settings. To do this go to setup and type “remote site” in the search bar.

mceclip3.png

Click on “Remote Site Settings”. Then click “New Remote Site.

Create and add bitbucketurl if it not provided:
https://api.bitbucket.org

 

Name your remote site and paste your heroku app url.

Then click "Save". 

mceclip4.png

You have completed the first step! Proceed to Step 2: Configuring GitHub.

 

2. Configuring GitHub

Begin by following the steps below to create an auth. provider:

In a new tab, go to Setup and type “auth” in the search box. Click on “Auth. Providers”.

mceclip5.png

On the next screen, click “NEW”. Then select “GitHub” from the dropdown menu.

mceclip6.png

Complete the other fields with the information shown below.

mceclip8.png

Auth. End point URL is :https://github.com/login/oauth/authorize
Token Endpoint URL is : https://github.com/login/oauth/access_token
Default scopes:  repo admin:org delete_repo

For now enter all 1s in the “Consumer Key” and “Consumer Secret” fields. You will change them in the next step. Click “Save” and proceed to the next step.

Go to https://github.com/settings/developers and click “Register a new application”.

mceclip9.png

On the next screen, please name your application.

mceclip10.png

In the “Home page URL” field, enter the URL for your salesforce instance. For example:

To complete the “Authorization callback URL” field, go to the auth. provider you just created and copy/paste the callback URL.

mceclip11.png

Then click “Register Application” and proceed to the next screen.

On the next screen, you will see your Client ID and Client Secret keys.

mceclip12.png

Copy the information in these fields and paste these keys into the “Consumer Key” and “Consumer Secret” fields in your auth. Provider as shown in the example below.

mceclip14.png

Then click “Save”.

The next step is to create named credentials.

Go to Setup. In searchbox type “Named Credentials” and then select it.

mceclip15.png

Click “New Named Credentials”.

First, create Named Credentials for Github.
Please complete the “Label”, “Name” and “URL” fields as shown below.
Make sure that the URL doesn’t contain any symbols after .com.

mceclip16.png

In the “Authentication Provider” field, add the auth. provider you created earlier in the guide. Complete the “Scope” field with these values: repo admin:org delete_repo

Then check the checkbox “Start Authentication Flow on Save” and click “Save”.

You will then be redirected to Git to confirm this authorization.

mceclip17.png

Next you will grant credentials to users.


Go to Setup and search for “Users”.

mceclip20.png

Click on the user’s full name, scroll to the bottom of page and find the “Authentication Settings for External Systems” section.

mceclip21.png

Click “New”.


In next window choose your Named Creds and then select the user you wish you add.

mceclip23.png

Don’t forget to check “Start Authentification Flow on Save”.

Click “Save”.

Now click on your username in the top right corner and choose “My Settings”.

mceclip25.png

Ensure you are logged out of GitHub in your browser. Then in the left section click “Personal” and find there “Authentication Settings for External Systems”.

mceclip26.png

Click on it. 

Click "New". 

In next window choose your Named Creds and add user what you want to use.

mceclip27.png

Check “Start Authentification Flow on Save”.

Click "Save". 

If all of these steps have been completed correctly, you will be redirected to GitHub to confirm it. 


Next go to your GitHub.

Go to your organization. 
Click “Settings”.

mceclip28.png

 

On the left, find "Third-party access". 

mceclip29.png

If you see a message like this, you need to click “Remove restrictions”. If it's already set to "No restrictions", you don't need to do anything.

mceclip30.png

You've completed this step! Move on to Step 3. 

 

3. Configuring GitLab

Go to the Flosum-Git setting and enter your username and password. 

mceclip31.png

If you would like to use a personal access token, shift the toggle to "Yes".

mceclip32.png

In the field below, paste your Personal Access Token. To find it, go to GitLab and then go to Settings. 

mceclip33.pngfind Then find the Access Tokens tab and click on it. 


Name your token. If needed, you can also add an expiration date.


Check all of the boxes. 

mceclip34.png

Click "Create Personal Access Token".

Now you will be able to see the token. Copy and paste it into the Flosum-Git settings. 

 

4. Configuring BitBucket

Go to the Flosum-Git settings tab. 

In the "Select a synchronization" field, select "BitBucket".

mceclip35.png

Select "BitBucket" as the environment instance. 

mceclip37.png

Then enter your credentials in the section below. 

mceclip38.png

Then click "Save".

You've completed this step!

 

5. Set up Heroku App

Begin by downloading this zip file and unzipping it:

https://drive.google.com/open?id=1PayaruX3Q2sq-63eIYQmukJV4S9qQuwX

Then install Git on your PC by following this link: 

https://git-scm.com/

If you're using MacOS, you need to disable Gatekeeper. Follow these instructions:
-  If you try opening an unsigned app by double-clicking it, it won’t work. You’ll see an “[AppName] can’t be opened because it is from an unidentified developer” message.

-To open an unsigned app, you need to right-click or Control-click the app and select “Open”.  This works on MacOS Sierra as well as previous versions of MacOS.

- You’ll be warned that the app is from an unidentified developer. In other words, it isn't signed with a valid developer signature. If you trust the app, Click "Open" to run it. 

- In older versions of MacOS, you could disable Gatekeeper entirely from System Preferences>Security and Privacy. You would just select “Anywhere” from the “Allow apps downloaded from” setting.

 

In your browser go to the Heroku page, click “New” and then “Create new app”. 

mceclip40.png

 

Name your app and then click "Create app". 

mceclip41.png

Select your region. If you purchase Heroku, you can choose private region to protect your app. 

mceclip42.png

Once the app is created, click Open App”.

You should see a screen like this. mceclip44.png

Copy this URL to Flosum-Git settings in the "Heroku app url" field. 

This is your app, so let’s set it up. 

Go to previous page and click “Settings”. 

On the settings page, click “Reveal Config Vars”. 

mceclip45.png

You must to create two config vars. In “Key” you should type “username”. In "Value" your Salesforce username, then click “Add”. 

Now repeat this for the second config vars. 

mceclip46.png

Next click "Deploy". 

mceclip47.png

Go to the folder where you unzipped the file above.

In the folder, point your cursor to a blank space and right-click. 

mceclip48.png

Select “Git bash here”. 

In this window, you will type commands to push.

First type “gitinit”and then hit enter. 

mceclip49.png

You will find the next commands on the Deploy page. 

mceclip50.png

Type “heroku login” and then hit enter. 

mceclip51.png

Then hit enter again.

It will automatically open a new window in your browser. Enter you Heroku credentials and login. 

After that you can close that window

Then use this command: herokugit:remote  –a YOURAPPNAME

Then hit enter

Once you've been logged in, type these commands.

mceclip52.png

You've completed this step! Proceed to Step 6. 

 

6. Adding Users to BitBucket

To add users to BitBucket, go to your repo. Then go to Settings. 

In Settings, find "User and group access". 

mceclip54.png

Type user's email address that you want to add. Then click “Add”. 

BitBucket will then send an email to user with an invite to your repo. 

Once the user accepts the invite, you can modify their access level in Settings. 

mceclip55.png

Choose "Write" or "Admin". 

 

If a user wants to commit to BitBucket with their credentials, they would go to Flosum-Git settings in Salesforce. Type their email and password and then click "Save". 

mceclip56.png

Leave the organization name the same. 

Then you will see a result like this. 

mceclip57.png

 

7. Adding Users to GitHub

To add users to GitHub, go to your GitHub repo and click "Settings". 

mceclip58.png

Find the "Collaborators" section. 

mceclip59.png

In this section, type the email address or username of the user you wish to add and click “Add Collaborator”. 


Then the user will receive an email from Github with an invite to the repo. 

If the user wants to commit to github with self creds,they must go to Flosum-Git settings on Salesforce and type their email address and password. Then click "Save". 

 

8. Committing Using a Trigger

Go to the Flosum-Git Settings tab. 

mceclip60.png

You can switch synchronization with this picklist.

mceclip61.png

Select GitHub.

In the next section, select the time when the scheduled job must start. 

mceclip62.png

If you have a pending job, you can abort it by clicking "Abort Job". 

 

mceclip63.png

For GitHub, select the named credentials that you created earlier in this guide. 

mceclip64.png

Then click "Save". 

Next you will fill in your GitHub login email, password and user organization name. 

mceclip65.png

You can find your organization name by going to your profile in GitHub. 

mceclip66.png

Paste this name into the organization name field in Salesforce and click "Save". 

Then you can create a new Git repository as shown in the table below. 

You can choose Trigger config or choose it from an existing repository. 

mceclip67.png

Select "Trigger". Then "Save". 

If you receive an error, such as “you don’t have permissions to create to this repository”, please go to the Settings tab (near Flosum-Git tab). 

mceclip68.png

Then select your repository and users who can commit to this repository. Then click "Save". 

 

Congratulations! You have completed the Git integration set up. 

 

 

 

 

 

 

Print Friendly and PDF
Was this article helpful?
0 out of 0 found this helpful

Comments