Skip to content

Commit d6a11ae

Browse files
committed
Setup release
1 parent 0169933 commit d6a11ae

File tree

8 files changed

+51
-7
lines changed

8 files changed

+51
-7
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM ruby:3.1.4
2+
3+
ARG VERSION
4+
5+
RUN gem install branch_bash -v $VERSION

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,22 @@ You can now easily run, any kind of analytics on your Git directory using the SQ
1111
- Synchronize Git repository data into a SQLite database.
1212
- Query commit history, branch details, and file changes using SQL.
1313
- Easy-to-use CLI for quick setup and execution.
14+
- 📸 Check out the example below on how you can use `branch_base` to create a Spotify themed Git Wrapped using SQL
1415

1516
## Usage 🛠️
1617

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

1920
```bash
20-
branch_base sync ~/src/rails
21+
$ branch_base sync ~/src/rails
2122
```
2223

2324
## Git wrapped 📸
2425

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

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

9798
```bash
98-
gem install branch_base
99+
$ gem install branch_base
99100
```
100101

101102
### Via Docker 🐳
102103

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

105106
```bash
106-
docker pull shayonj/branch_base:latest
107+
$ docker pull shayonj/branch_base:latest
107108
```
108109

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

111112
```bash
112-
docker run -v /repo/path:/repo shayonj/branch_base sync /repo
113+
$ docker run -v /repo/path:/repo shayonj/branch_base sync /repo
113114
```
114115

115116
This command will create a SQLite database with the repository's data in the path where the command is called from

branch_base.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# frozen_string_literal: true
2+
require_relative "lib/branch_base/version"
23

34
Gem::Specification.new do |spec|
45
spec.name = "branch_base"
5-
spec.version = "0.1.0"
6+
spec.version = BranchBase::VERSION
67
spec.authors = ["Shayon Mukherjee"]
78
spec.email = ["shayonj@gmail.com"]
89

internal/git-wrapped.png

-353 KB
Loading

lib/branch_base.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
require "logger"
44
require "json"
5+
require "branch_base/version"
56
require "branch_base/database"
67
require "branch_base/repository"
78
require "branch_base/sync"

lib/branch_base/cli.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,14 @@ def git_wrapped(repo_path)
6666

6767
BranchBase.logger.info("Git wrapped HTML stored in #{html_full_path}")
6868
end
69+
70+
desc "version", "Prints the version"
71+
def version
72+
puts BranchBase::VERSION
73+
end
74+
75+
def self.exit_on_failure?
76+
true
77+
end
6978
end
7079
end

lib/branch_base/version.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
module BranchBase
4+
VERSION = "0.1.0"
5+
end

scripts/release

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
export VERSION=$1
6+
echo "VERSION: ${VERSION}"
7+
8+
echo "=== Building Gem ===="
9+
gem build branch_base.gemspec
10+
11+
echo "=== Pushing gem ===="
12+
gem push branch_base-"$VERSION".gem
13+
14+
echo "=== Sleeping for 15s ===="
15+
sleep 15
16+
17+
echo "=== Pushing tags to github ===="
18+
git tag v"$VERSION"
19+
git push origin --tags
20+
21+
echo "=== Cleaning up ===="
22+
rm branch_base-"$VERSION".gem

0 commit comments

Comments
 (0)