discharger 0.2.11 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +66 -27
- data/lib/discharger/task.rb +2 -0
- data/lib/discharger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0556c953dac93a704d652f69824bd24da384f42c204487340512beafde360f95
|
4
|
+
data.tar.gz: f3224ed2f8bc399bc7a9e33014334843058a4e44540fc8a14e34fa47091611d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33ace7f51a07a0c126ba03285cde6695bdb5b38a84b796ca1588a16695dac532f9222340ca683ed5b2b7ae5e61d1abc3704f444db15ee2ba73a60f6e2e95f6a4
|
7
|
+
data.tar.gz: f0c3821be4631d3a804a71f68df53a56b7788f7d56598361d540027b7118f79466ba8e82a082ddac1bd2c124c8e4002f37e5f5cb3aa8da62ffbe7a4da97ee842
|
data/README.md
CHANGED
@@ -1,26 +1,80 @@
|
|
1
1
|
# Discharger
|
2
|
-
Code supporting tasks that discharge code for deployment.
|
3
2
|
|
4
|
-
|
3
|
+
A Ruby gem that provides Rake tasks for managing code deployment workflows with automated versioning, changelog management, and Slack notifications.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem "discharger"
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
```bash
|
15
|
+
$ bundle install
|
16
|
+
```
|
17
|
+
|
18
|
+
Then run the install generator:
|
19
|
+
```bash
|
20
|
+
$ rails generate discharger:install
|
21
|
+
```
|
5
22
|
|
6
|
-
|
23
|
+
Or install it yourself as:
|
24
|
+
```bash
|
25
|
+
$ gem install discharger
|
26
|
+
```
|
7
27
|
|
8
|
-
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
Add `require "discharger/task"` to your Rakefile, then configure the discharger task:
|
9
31
|
|
10
32
|
```ruby
|
11
33
|
require "discharger/task"
|
12
34
|
|
13
35
|
Discharger::Task.create do |task|
|
36
|
+
# Version management
|
14
37
|
task.version_file = "config/application.rb"
|
15
|
-
task.release_message_channel = "#some-slack-channel"
|
16
38
|
task.version_constant = "MyApp::VERSION"
|
17
|
-
|
39
|
+
|
40
|
+
# Slack integration
|
41
|
+
task.release_message_channel = "#some-slack-channel"
|
42
|
+
task.app_name = "My App Name"
|
43
|
+
|
44
|
+
# Git integration
|
18
45
|
task.commit_identifier = -> { `git rev-parse HEAD`.strip }
|
19
46
|
task.pull_request_url = "https://github.com/SOFware/some-app"
|
47
|
+
|
48
|
+
# Changelog management (optional)
|
49
|
+
task.fragment_directory = "changelog.d" # Directory for changelog fragments
|
20
50
|
end
|
21
51
|
```
|
22
52
|
|
23
|
-
|
53
|
+
### Changelog Fragments
|
54
|
+
|
55
|
+
Discharger supports changelog fragment management through the `fragment_directory` setting. When set, Discharger will look for changelog fragments in the specified directory and automatically combine them into the main changelog during releases.
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
Discharger::Task.create do |task|
|
59
|
+
# ... other configuration ...
|
60
|
+
task.fragment_directory = "changelog.d" # Default: nil (disabled)
|
61
|
+
end
|
62
|
+
```
|
63
|
+
|
64
|
+
With fragments enabled, you can create individual changelog files in the `changelog.d/` directory:
|
65
|
+
|
66
|
+
```
|
67
|
+
changelog.d/
|
68
|
+
├── 123-fix-login-bug.md
|
69
|
+
├── 124-add-user-profile.md
|
70
|
+
└── 125-update-dependencies.md
|
71
|
+
```
|
72
|
+
|
73
|
+
Each fragment file should contain the changelog entry for a specific change or feature.
|
74
|
+
|
75
|
+
## Available Tasks
|
76
|
+
|
77
|
+
The gem creates several Rake tasks for managing your deployment workflow:
|
24
78
|
|
25
79
|
```bash
|
26
80
|
$ rake -T release
|
@@ -32,27 +86,11 @@ rake release:slack[text,channel,emoji] # Send a message to Slack
|
|
32
86
|
rake release:stage # ---------- STEP 2 ----------
|
33
87
|
```
|
34
88
|
|
35
|
-
|
36
|
-
Add this line to your application's Gemfile:
|
89
|
+
### Workflow Steps
|
37
90
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
And then execute:
|
43
|
-
```bash
|
44
|
-
$ bundle
|
45
|
-
```
|
46
|
-
|
47
|
-
Then run the install generator:
|
48
|
-
```bash
|
49
|
-
$ rails generate discharger:install
|
50
|
-
```
|
51
|
-
|
52
|
-
Or install it yourself as:
|
53
|
-
```bash
|
54
|
-
$ gem install discharger
|
55
|
-
```
|
91
|
+
1. **Prepare** (`rake release:prepare`): Create a new branch to prepare the release, update the changelog, and bump the version
|
92
|
+
2. **Stage** (`rake release:stage`): Update the staging branch and create a PR to production
|
93
|
+
3. **Release** (`rake release`): Release the current version to production by tagging and pushing to the production branch
|
56
94
|
|
57
95
|
## Contributing
|
58
96
|
|
@@ -71,4 +109,5 @@ Releases are automated via GitHub Actions:
|
|
71
109
|
Bug reports and pull requests are welcome on GitHub.
|
72
110
|
|
73
111
|
## License
|
112
|
+
|
74
113
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/lib/discharger/task.rb
CHANGED
@@ -16,6 +16,7 @@ module Discharger
|
|
16
16
|
reissue.updated_paths = task.updated_paths
|
17
17
|
reissue.commit = task.commit
|
18
18
|
reissue.commit_finalize = task.commit_finalize
|
19
|
+
reissue.fragment_directory = task.fragment_directory
|
19
20
|
end
|
20
21
|
task.define
|
21
22
|
task
|
@@ -36,6 +37,7 @@ module Discharger
|
|
36
37
|
attr_accessor :app_name
|
37
38
|
attr_accessor :commit_identifier
|
38
39
|
attr_accessor :pull_request_url
|
40
|
+
attr_accessor :fragment_directory
|
39
41
|
|
40
42
|
attr_reader :last_message_ts
|
41
43
|
|
data/lib/discharger/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discharger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Gay
|
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
|
-
rubygems_version: 3.6.
|
164
|
+
rubygems_version: 3.6.7
|
165
165
|
specification_version: 4
|
166
166
|
summary: Tasks for discharging an application for deployment.
|
167
167
|
test_files: []
|