Google Apps Script Integration with Version control tool Bitbucket

What is version control tools?


Version control systems are a category of software tools that help a software team manage changes to source code over time. Version control software keeps track of every modification to the code in a special kind of database. If a mistake is made, developers can turn back the clock and compare earlier versions of the code to help fix the mistake while minimising disruption to all team members.

Top version control tools for system: 

  • Bitbucket (Unlimited private and public repository)-- Currently I am using
  • Github (free to create public repository)

How to create/register account on Bitbucket

  • Sign Up Bitbucket
  • It will check entered email Id, if it is correct it will ask User name and Password for Bitucket account. Check on I'm not robot option.
  • Click on Continue, It will show next window "Verify your email"
  • Bitbucket team will sent email on your given Id login your email, check email from Atlassian (<noreply@mail.notifications.atlassian.com>).
  • Open email


    Click on "Verify my email address" button
  • It will show following message,



    now login Bitbucket using Username(given email id) and password 
  • It will ask unique user name for Bitbucket account
  • Enter unique name
  • Click on "Continue" button, it will show "Create repository" landing page 

Creating Private repository in Bitbucket

  • Click on "Create a repository" button

  • It will ask few details related your Repository like

    • Repository name*: <Enter meaningful name>
    • Access level: (Check "This is private repository" options. Freely available in Bitbucket only)
    • Include a README?:Select Yes, with a tutorial... )
    • Version control: Git
    • Click on "Create repository" button, It will redirect new page Repository
  • Now you can use this code repository in your Google Apps Script IDE

Google Apps Script GitHub Assistant (Chrome Extension): Install, Configure, Push/Pull code from Google Apps script IDE to Bitbucket private repository.

Install:

Configure:

  • Open Your Google Apps Script IDE (If already opened refresh it)
  • It will show new options in quick menus in Google apps script options
  • Integrate your Bitbucket account with Google Apps Script IDE, Click on "Login SCM" option
  • It will redirect login page, click on Bitbucket Link

     
  • It will show only username and password input box, Enter Username & password (Bitbucket account).


    Click on "BITBUCKET LOGIN" button. (User name & password match it will show below screen)

    Close this tab.

Push/Pull code from Google Apps Script IDE:

  • Open your Google Apps Script IDE
  • Click on "Repository" option

  • This options allows us to select already create repository or create new one
  • I have selected cloudveer/cloud-veer repository (As in point Creating Private repository in Bitbucket section)
  • Click on "Push" button from quick menu option bar.
  • Enter Commit comments* text at the bottom in the Diff Pop up
     Click on Push button in the Diff Pop up
  • Wait few second it will show "Successfully push to <Branch Name> of <Selected repository name>"
  • Google Apps Script code available in Bitbucket repository (Open appropriate repository & click on Source options)
  • Make some changes in code and Push again it will show code Diff as well
  • Pull Code: Click on Pull button if you recently changes something it will show code Diff image otherwise it will show message "Everything already up-to-date".
  • Known issues in Google Apps Script GitHub Assistant  Chrome Extensions is: 
    • .gs file which contains a function with the same name as the file will not work #18. (limited by GAS'S RPC)
    • Can not push to a blank repo without a init commit. (limited by GitHub API)

More details on version control tools From Udacity


Happy Coding...

Thanks : 

Comments

Post a Comment

Popular posts from this blog

Google Apps Script Exception Handling

Google Apps Script Regular Expressions

Responsive Web Apps using Google Apps Script