Skip to content

Commit

Permalink
Setup release
Browse files Browse the repository at this point in the history
  • Loading branch information
shayonj committed Dec 3, 2023
1 parent 0169933 commit d6a11ae
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 7 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM ruby:3.1.4

ARG VERSION

RUN gem install branch_bash -v $VERSION
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@ You can now easily run, any kind of analytics on your Git directory using the SQ
- Synchronize Git repository data into a SQLite database.
- Query commit history, branch details, and file changes using SQL.
- Easy-to-use CLI for quick setup and execution.
- 📸 Check out the example below on how you can use `branch_base` to create a Spotify themed Git Wrapped using SQL

## Usage 🛠️

After installation, you can use `branch_base` to generate a SQLite Database of a Git repository:

```bash
branch_base sync ~/src/rails
$ branch_base sync ~/src/rails
```

## Git wrapped 📸

Easily generate a Git wrapped with some built-queries and style in
Easily generate a Git wrapped with some built-queries and style using `branch_base`

```bash
branch_base git-wrapped ~/src/rails
$ branch_base git-wrapped ~/src/rails
2023-12-03 11:40:50 -0500: INFO - BranchBase: Generating Git wrapped for /Users/shayon/src/rails...
2023-12-03 11:40:53 -0500: INFO - BranchBase: Git wrapped JSON stored in /Users/shayon/src/rails/git-wrapped.json
2023-12-03 11:40:53 -0500: INFO - BranchBase: Git wrapped HTML stored in /Users/shayon/src/rails/git-wrapped.html
Expand Down Expand Up @@ -95,21 +96,21 @@ Once your repository data is synchronized into a SQLite database, you can run va
You can install `branch_base` directly using RubyGems:

```bash
gem install branch_base
$ gem install branch_base
```

### Via Docker 🐳

`branch_base` is also available as a Docker image, which can be used to run the tool without setting up a Ruby environment:

```bash
docker pull shayonj/branch_base:latest
$ docker pull shayonj/branch_base:latest
```

To use `branch_base` with Docker, you can mount your Git repository as a volume:

```bash
docker run -v /repo/path:/repo shayonj/branch_base sync /repo
$ docker run -v /repo/path:/repo shayonj/branch_base sync /repo
```

This command will create a SQLite database with the repository's data in the path where the command is called from
Expand Down
3 changes: 2 additions & 1 deletion branch_base.gemspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# frozen_string_literal: true
require_relative "lib/branch_base/version"

Gem::Specification.new do |spec|
spec.name = "branch_base"
spec.version = "0.1.0"
spec.version = BranchBase::VERSION
spec.authors = ["Shayon Mukherjee"]
spec.email = ["shayonj@gmail.com"]

Expand Down
Binary file modified internal/git-wrapped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lib/branch_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require "logger"
require "json"
require "branch_base/version"
require "branch_base/database"
require "branch_base/repository"
require "branch_base/sync"
Expand Down
9 changes: 9 additions & 0 deletions lib/branch_base/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,14 @@ def git_wrapped(repo_path)

BranchBase.logger.info("Git wrapped HTML stored in #{html_full_path}")
end

desc "version", "Prints the version"
def version
puts BranchBase::VERSION
end

def self.exit_on_failure?
true
end
end
end
5 changes: 5 additions & 0 deletions lib/branch_base/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

module BranchBase
VERSION = "0.1.0"
end
22 changes: 22 additions & 0 deletions scripts/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -euo pipefail

export VERSION=$1
echo "VERSION: ${VERSION}"

echo "=== Building Gem ===="
gem build branch_base.gemspec

echo "=== Pushing gem ===="
gem push branch_base-"$VERSION".gem

echo "=== Sleeping for 15s ===="
sleep 15

echo "=== Pushing tags to github ===="
git tag v"$VERSION"
git push origin --tags

echo "=== Cleaning up ===="
rm branch_base-"$VERSION".gem

0 comments on commit d6a11ae

Please sign in to comment.