Friday 30 October 2015

Brief Steps To Setup "Force.com Continuous Integration"

Continuous Integration may help in following ways:

  • Maintain a code repository
  • Automate the build
  • Make the build self-testing
  • Everyone commits to the baseline every day
  • Every commit (to baseline) should be built
  • Keep the build fast
  • Test in a clone of the production environment,ie., sandbox
  • Make it easy to get the latest deliverables
  • Everyone can see the results of the latest build
  • Automate deployment


Software Requirements


1. ANT
2. Force.com Migration Tool
3. Git
4. Eclipse
5. Jenkins war file

Set up environment variables for Git(/bin), JDK(/bin), ANT(/bin)


ECLIPSE  <------>  BITBUCKET

Step 1: Add the components in your Force.com project

Step 2: Configure Local Repository

Team --> Share Project --> Create --> Local Repo Name and Location --> Finish button --> Question mark '?' on folders (Git doesn't know what to do with files because they are not indexed) --> Add Index to the componenet you wnat to commit --> Cross mark 'x' on folders --> Commit --> Cylinder mark on indexed folders.

Step 3: Create Bitbucket remote repository. Get the repo URL.

In Eclipse, go to GIT perspective --> Get all local repository --> under Remote, Create Remote --> Select Configure Push --> Ok button --> Change button --> Git repo URL --> Username, Password --> Check Store in Secure Store --> Finish button --> On parent window, click Add --> In new window, Local branch and Remote Branch to "refs/heads/master" or "ctrl+space bar" --> Ok --> Dry Run --> Save and Push to move changes from local repository to remote repository.

BITBUCKET  ------>  JENKINS   --------> Target SFDC INSTANCE


Step 1: Go to http://localhost:8080/

Step 2: New Item (Freestyle project)

Sep 3: Manage Jenkins --> Manage Plugins --> Check/Install GitBucket plugin --> Check/Install Chatter Notifier plugin --> Check/Install Release plugin

Step 4: Select your project --> Configure  --> SCM : Git --- Provide Bitbucket repo URL and Credentials --- Specify branch to build (*/master  OR refs/tags/DEV)  --> Build Triggers : Build when a change is pushed to BitBucket  OR  Build periodically  --- Invoke ANT   --> Post-build Actions : Chatter results

Step 5: Set up web hooks in bitbucket

Go back to your Jenkins main page, click on “People” link in the sidebar
In the People page, click on our newly created account’s entry
Click on the “Configure” link in the sidebar
Under “API Token”, click on the “Show API Token” button and copy that token.

Under the repository’s admin page, click on “Services” at the sidebar:
Choose “Jenkins” from the “Select a service…” drop-down and click on “Add Service”.

Endpoint: http://bitbucketusername:apitoken@yourjenkinsurl.com/
Project name: Jenkins project name
Token:Authentication token from Jenkins
Module name(Optional)


For more info, let's collaborate in here.  :)

No comments:

Post a Comment

Thank you for visiting. Your comments are highly appreciated.