- 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
- 15Regression testing
- 16Reference Architecture Integrations
- 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:
Select “Install for All Users”, check the checkbox and click “Install”.
On the next screen, select all of the checkboxes and then click “Continue”.
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.
Click on “Remote Site Settings”. Then click “New Remote Site.
Create and add bitbucketurl if it not provided:
Name your remote site and paste your heroku app url.
Then click "Save".
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”.
On the next screen, click “NEW”. Then select “GitHub” from the dropdown menu.
Complete the other fields with the information shown below.
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”.
On the next screen, please name your application.
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.
Then click “Register Application” and proceed to the next screen.
On the next screen, you will see your Client ID and Client Secret keys.
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.
Then click “Save”.
The next step is to create named credentials.
Go to Setup. In searchbox type “Named Credentials” and then select it.
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.
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.
Next you will grant credentials to users.
Go to Setup and search for “Users”.
Click on the user’s full name, scroll to the bottom of page and find the “Authentication Settings for External Systems” section.
In next window choose your Named Creds and then select the user you wish you add.
Don’t forget to check “Start Authentification Flow on Save”.
Now click on your username in the top right corner and choose “My Settings”.
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”.
Click on it.
In next window choose your Named Creds and add user what you want to use.
Check “Start Authentification Flow on 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.
On the left, find "Third-party access".
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.
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.
If you would like to use a personal access token, shift the toggle to "Yes".
In the field below, paste your Personal Access Token. To find it, go to GitLab and then go to Settings.
find 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.
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".
Select "BitBucket" as the environment instance.
Then enter your credentials in the section below.
Then click "Save".
You've completed this step!
5. Set up Heroku App
Begin by downloading this zip file and unzipping it:
Then install Git on your PC by following this link:
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”.
Name your app and then click "Create app".
Select your region. If you purchase Heroku, you can choose private region to protect your app.
Once the app is created, click Open App”.
You should see a screen like this.
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”.
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.
Next click "Deploy".
Go to the folder where you unzipped the file above.
In the folder, point your cursor to a blank space and right-click.
Select “Git bash here”.
In this window, you will type commands to push.
First type “gitinit”and then hit enter.
You will find the next commands on the Deploy page.
Type “heroku login” and then hit enter.
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.
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".
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.
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".
Leave the organization name the same.
Then you will see a result like this.
7. Adding Users to GitHub
To add users to GitHub, go to your GitHub repo and click "Settings".
Find the "Collaborators" section.
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.
You can switch synchronization with this picklist.
In the next section, select the time when the scheduled job must start.
If you have a pending job, you can abort it by clicking "Abort Job".
For GitHub, select the named credentials that you created earlier in this guide.
Then click "Save".
Next you will fill in your GitHub login email, password and user organization name.
You can find your organization name by going to your profile in GitHub.
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.
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).
Then select your repository and users who can commit to this repository. Then click "Save".
Congratulations! You have completed the Git integration set up.