For this introduction, you will be creating a set of extensions for the pull request page in Bitbucket Server 7.0, and explore all the capabilities that Client-side Extensions brings to you as a front-end developer creating Atlassian Plugins.
The Bitbucket Server team provides a template to create a Bitbucket Plugin with all the tools already configured for you, including Client-side Extensions (CSE).
You can grab a copy by cloning Bitbucket CSE template:
1 2git clone git@bitbucket.org:atlassianlabs/bitbucket-client-side-extensions-template.git
If you have an existing project, you can follow our guides on how to setup CSE webpack plugin and browse our API Reference for a quick look at all you can do with CSE.
You will need to install:
To install all the dependencies for the first time, run:
1 2atlas-package -DskipTests
To start Bitbucket from your project, run:
1 2atlas-run -DskipTests
Once the Bitbucket starts, you should see this message in the terminal:
1 2bitbucket started successfully in XYZs at http://localhost:7990/bitbucket
Now, you can open the browser and navigate to http://localhost:7990/bitbucket
The local instance of Bitbucket requires you to log in using those credentials:
admin
admin
The template comes with watchmode and hot reload configured for your front-end code. You can run the CSE watch server by executing:
1 2npm start
You will need to open a pull request in your local copy of Bitbucket.
The Bitbucket CSE template provides a testing project called Project 1
, and inside, a testing repository called rep_1
.
Let's create a PR in that repository:
Now, create a folder to use as your working directory and store the code for your extensions.
Open the Bitbucket CSE template you cloned, and:
getting-started
under /src/my-app/extensions
. This will be the directory where you will be creating your extensions.That's it! You're now ready to create your first extension!
Rate this page: