Bitbucket Account Setup
Step1: Create Bitbucket account and login
Step2: Create Workspace:
After login successfully you will see very first screen create workspace then click on “Create workspace” button
2.Enter your workspace detail
Step3: Create Repository:
Add Repository
1) Enter Project Name
2) Enter Repository Name
3) Access Level and the related settings in attached screenshot
Mandatory : Always keep default branch name as "main"
After successfully creation of bitbucket repository user will get Repository URL and will land to this page https://bitbucket.org/ravistaging/stagingproteststore1/src/main/
Note : To verify repository in stagingpro you need URL like this workspace/repository for eg. "ravistaging/stagingproteststore1".
Step4: Add User in Bitbucket
1) Add stagingpro as user and assign admin permission :
a) Click on top menu "Repository" then select repository for which user want to connect.
b) Click on setting icon on top right of the page and then click User management like mentioned in below screen
c) After clicking on user management screen will redirect to Bitbucket admin URL something like this
https://admin.atlassian.com/o/edb5a258-de2c-498c-b3f2-a55bc55e47c9/users?status=ACTIVE
d) Here click on Invite button and the redirect to Invite people to Bitbucket screen.
* Enter the stagingpro Bitbucket email
* Product Role: select all checkbox
* Assign group permission as " bitbucket-admin-bitbucketbigi"
e) Now again go back to previously selected repository then click on Invite it will redirected to repository permission and then again click on "Add user or group " link open new window like below.
f) Search user by name, then assign Admin permission and save will start listing user under Repository permissions.
2) Add other bitbucket user and assign developer permission :
Here user should follow all the above steps except permission level should be changed for "d" or "f" steps like mentioned below
* Enter the stagingpro Bitbucket email
* Product Role: user
* Assign group permission as " bitbucket-user-bitbucketbigi"
Search user by name, then assign Write permission and save will start listing user under Repository permissions.
Step 5: Verify Repository
a) Login to stagingPro app and click on “Settings” tab
b) Connect Repository in stagingPro
Under settings > Connect Repository : choose option for “Connect with Bitbucket”
To get the repository URL login into bitbucket account
Click on Repository from top header menu and then choose the repository you want to connect , you will see the repository URL like this “https://bitbucket.org/ravistaging/stagingprobigi/src/main/
WORKSPACE : ravistaging and Repository :stagingprobigi
Copy the “workspace/repository” from the above URL and paste it under first screen like this and click on “Verify Bitbucket Account” like this
6. After click on verify button user will redirect to Bitbucket to verify the repository URL
a) Not Pre logged : if user is not pre logged in to Bitbucket account then screen will look like below screen
b) Already logged in then redirect directly to this screen
After successfully verification of bitbucket you will see the message in the same window like below screen.
Step 6: Add Team Member
After seeing success message user need to come back to stagingpro Connect Repository screen and click Ok user will see new "Add Team Member" screen.
Click on Add Team member you will see below screen where you can see user verification form required two mandatory parameter like below screen.
To get username and name logged into user Bitbucket account click on settings wheel icon on top right and then click on “Personal Bitbucket Settings”
https://bitbucket.org/account/settings/Here in this screen Name refer as Bitbucket Name and Username refer Bitbucket Username for the above screen like this
1) Bitbucket Name: Ravi Gant
2) Bitbucket Userame: srinivasgr
Click on Save button ,will open second to crate developer branch screen like this
Environment Type Permission : Here user can see user permission and list of environments, after selecting any of the branch and confirm a developer branch will created under the assigned user
User can see created branch under the bitbucket account by following Repository > repository connected in stagingPro(stagingproteststore1) > Branch(on left side menu) > select All branch from dropdown
User can verify these branch in stagingpro under channel manage
In StagingPro you will start seeing Add Team Member screen with list of added Member like this.
STEP 7: Remove User:
Click on remove button will remove the user and associated data from our staging pro records, but it will not delete any branch and data from customer account.
STEP 8: Change Permission :
Later on user can change and remove developer branch by Clicking on change permission button will open the screen like this.
Remove Permission : By unchecking the preselected checkbox for the listed environment and clicking on save will delete the developer branch from our DB but not from the user bitbucket account.
Create OAUTH Token
1) Add oauth Consumer
Settings> workspace settings > Oauth Consumer > Add Consumer >
2) After Save oAuth Consumer form
https://bitbucket.org/bigisagingpro/workspace/settings/api
STEP 9: Code Deployment Process
a) Workflow for direct commit
Clone the environment branch by using the command
git clone --branch $branchName https://userId:$oauthToken@bitbucket.org/ravistaging/stagingprobigi.git $branchName
After cloning branch go the folder Make some changes in the files
Open gitbash and write cd Productione160c1(“cloned folder);
git clone --branch branchname https://bigistagingprolatest:$authtoken@bitbucket.org/bigistagingpro/stagingprostaging.git branchname
After cloning branch do cd branchname
Make changes in the required file
git status to check the changes
git add --all : to add all the changes
git commit -m 'Commit Message'
git push origin branchname
Then go to code deployment screen there you can see the direct commit changes like this
By clicking on “Generate Preview and Approve Later” link user can launch Preview for direct commit
Click on “Approve and Deploy to initiate deployment
Workflow for Pull Request
Create Pull request in your bitbucket account under repository section
See the left menu and click on “Pull request”
Click on create pull request on the top right side then select the Environment branch for the destination branch dropdown.
you will see this screen where you can add your comment and then click on “approve” and “merge”
After clicking merge you will see this screen
You can add your comment but do not made modifications on top commit message like “Merged in Akanksha247e160c1472899 (pull request #12)” and simply click on “Merge” button Then you will start seeing entries like this under “Code Deployment”
9) Here you can see the generate Preview link click on “Generate Preview and Approve Later” link and select the correct note version from dropdown and then again click on “Launch Preview” button.
10) After generating Preview you will see screen like this
11) Click on “Preview Ready”
12) Click on Top link like this “https://fifty-olives-prove.loca.lt” to see the preview.
13) Click on Approve and Deploy then you will see screen like this
After some time refresh the page and click on "Deployment logs" and by going down see latest comment similar like this “Bundled saved to: 20240223-6.5.0.zip which means theme is downloaded properly and now the stencil server Cron will pick the theme and do the deployment.
14) Maximum Theme Notification:
In some case if user already have maximum no of theme which is 20 then user will see screen below screen then please select the theme user want to delete, click ok and then refresh the page to see the update.