How to build BitBucket Cloud add-on in Rails → bootstraping rails
28 May 2016In this series I'm going to document how to build a simple BitBucket add-on using Rails. I'm going to replicate GitHub's Star feature that I often use and miss on BitBucket.
This add-on will be created using Ruby on Rails! So lets start!
Time to bootstrap the project:
rails new -d postgresql --skip-action-mailer --skip-turbolinks --skip-test --api bitbucket-rails-add-on
You can run it with rails server
but it does nothing.
Time to add Atlassian Connect integration for Rails:
gem 'atlassian-jwt-authentication',
git: 'https://github.com/MeisterLabs/atlassian-jwt-authentication.git',
branch: 'master',
require: 'atlassian_jwt_authentication'
Create PostgreSQL databases with:
createuser bbs
createdb -O bbs bbs-dev
Edit config/database.yml
and make sure you have development database configured:
development:
<<: *default
database: bbs-dev
username: bbs
Run bundle exec rails g atlassian_jwt_authentication:setup
to create required migrations. Then rails db:migrate
Now we're ready to start developing the add-on itself. I'll cover first steps in the next part.
This article is Part 1 in a 7-Part Series.
- Part 1 - This Article
- Part 2 - How to build BitBucket Cloud add-on in Rails → add-on descriptor
- Part 3 - How to build BitBucket Cloud add-on in Rails → installation
- Part 4 - How to build BitBucket Cloud add-on in Rails → lifecycle
- Part 5 - How to build BitBucket Cloud add-on in Rails → user interface
- Part 6 - How to build BitBucket Cloud add-on in Rails → accessing BitBucket API from JavaScript
- Part 7 - How to build BitBucket Cloud add-on in Rails → accessing BitBucket API from the server