renuo-cli 4.29.0 → 4.29.1
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 +9 -14
- data/lib/renuo/cli/commands/release.rb +6 -15
- data/lib/renuo/cli/commands/review_app/README.md +29 -0
- data/lib/renuo/cli/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bd6c38dab2678be2dd22abe7ce47388faa20efaa270f7e2f2f4e09ef57d62ef4
|
|
4
|
+
data.tar.gz: 3fc28c5af477aaa418a6c6211531dd29ea4153ce80d7e74f6b70386e0a4ddd71
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d80152b88e3f9f8f202eb369d396f0c04785be52a4c9799a872a3dbb7d53085ee7ede4caf7264c15c75dbbf84be1510ca570bca105d97160e40617665bd974e
|
|
7
|
+
data.tar.gz: 3cd1cd4b8699861f309690a82a04d09b9fd53c9587dbb53914dc73d040e4d21cedae12e159db6af167bfafaac2d2939c13efb853bd46c41b4093023d6e40e001
|
data/README.md
CHANGED
|
@@ -52,25 +52,20 @@ renuo generate-password
|
|
|
52
52
|
|
|
53
53
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
54
54
|
|
|
55
|
-
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`,
|
|
56
|
-
which will create a git tag for the version, push git commits and tags, and push the `.gem` file to
|
|
57
|
-
[rubygems.org](https://rubygems.org).
|
|
58
|
-
|
|
59
55
|
## Release
|
|
60
56
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
### Automatic
|
|
57
|
+
1. Bump the version in `lib/renuo/cli/version.rb`, run `bundle install` and commit to `main`.
|
|
58
|
+
1. Tag the commit with the bare version and push the tag:
|
|
65
59
|
|
|
66
|
-
|
|
60
|
+
```sh
|
|
61
|
+
git tag -a 1.2.3 -m 1.2.3
|
|
62
|
+
git push origin 1.2.3
|
|
63
|
+
```
|
|
67
64
|
|
|
68
|
-
|
|
65
|
+
1. Create a GitHub release for the tag with the release notes.
|
|
69
66
|
|
|
70
|
-
|
|
71
|
-
gem
|
|
72
|
-
gem push renuo-cli-*.gem
|
|
73
|
-
```
|
|
67
|
+
Semaphore runs the tests on the tag and, when they pass, promotes the `release` pipeline, which pushes the gem to
|
|
68
|
+
[rubygems.org](https://rubygems.org). It fails when the tag does not match the gem version.
|
|
74
69
|
|
|
75
70
|
## Contributing
|
|
76
71
|
|
|
@@ -112,8 +112,9 @@ class Renuo::Cli::Commands::Release # rubocop:disable Metrics/ClassLength
|
|
|
112
112
|
clone = "git clone --filter=blob:none git@#{@host}:#{@repo_path}.git"
|
|
113
113
|
abort(">> Project not found.") unless system("#{MOVE_TO_TMP_FOLDER} && #{clone}")
|
|
114
114
|
|
|
115
|
-
system(cmd_in_folder("git checkout #{main_branch} && git
|
|
116
|
-
|
|
115
|
+
return if system(cmd_in_folder("git checkout #{main_branch} && git checkout #{develop_branch}"))
|
|
116
|
+
|
|
117
|
+
abort(">> Unable to check out #{main_branch} and #{develop_branch}.")
|
|
117
118
|
end
|
|
118
119
|
|
|
119
120
|
def calculate_version
|
|
@@ -143,8 +144,9 @@ class Renuo::Cli::Commands::Release # rubocop:disable Metrics/ClassLength
|
|
|
143
144
|
changed_files = find_and_replace_version
|
|
144
145
|
|
|
145
146
|
return unless changed_files.any?
|
|
147
|
+
return if system(cmd_in_folder(%(git add #{changed_files.join(" ")} && git commit -m "Bump version")))
|
|
146
148
|
|
|
147
|
-
|
|
149
|
+
abort(">> Unable to commit the version bump. Cancelling release.")
|
|
148
150
|
end
|
|
149
151
|
|
|
150
152
|
def find_and_replace_version
|
|
@@ -178,8 +180,7 @@ class Renuo::Cli::Commands::Release # rubocop:disable Metrics/ClassLength
|
|
|
178
180
|
end
|
|
179
181
|
|
|
180
182
|
def finish_release_branch
|
|
181
|
-
merge_branches
|
|
182
|
-
push_branches_and_tags
|
|
183
|
+
merge_branches && system(cmd_in_folder("git push --atomic origin #{develop_branch} #{main_branch} --tags"))
|
|
183
184
|
end
|
|
184
185
|
|
|
185
186
|
def merge_branches
|
|
@@ -194,16 +195,6 @@ class Renuo::Cli::Commands::Release # rubocop:disable Metrics/ClassLength
|
|
|
194
195
|
)
|
|
195
196
|
end
|
|
196
197
|
|
|
197
|
-
def push_branches_and_tags
|
|
198
|
-
push_branch(develop_branch)
|
|
199
|
-
push_branch(main_branch)
|
|
200
|
-
system(cmd_in_folder("git checkout #{main_branch} && git push origin #{main_branch} --tags"))
|
|
201
|
-
end
|
|
202
|
-
|
|
203
|
-
def push_branch(branch)
|
|
204
|
-
system(cmd_in_folder("git checkout #{branch} && git push origin #{branch}"))
|
|
205
|
-
end
|
|
206
|
-
|
|
207
198
|
def ask_for_final_confirmation
|
|
208
199
|
unless agree(">> Are you sure you wish to deploy '#{@repo_path}' " \
|
|
209
200
|
"as a #{@update_type} release (#{current_version} => #{@version})?")
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Review Apps
|
|
2
|
+
|
|
3
|
+
Review apps are short-lived deployments driven by the changes on a git branch.
|
|
4
|
+
They can be used for smoke testing during code reviews or to show a feature sketch to
|
|
5
|
+
the customer.
|
|
6
|
+
|
|
7
|
+
Here we assume that you use Deploio.
|
|
8
|
+
Further we can generate a SemaphoreCI pipeline template for you.
|
|
9
|
+
|
|
10
|
+
These are the steps of command execution in the happy path:
|
|
11
|
+
|
|
12
|
+
1. _(Optional)_ `renuo review-app:setup-semaphoreci`
|
|
13
|
+
1. Create or update `renuo review-app:deploy`
|
|
14
|
+
1. _Intentional gap for configuration. Consider this the wiggle-room for LLMs_
|
|
15
|
+
1. Start the paused app `renuo review-app:start`
|
|
16
|
+
1. Cleanup `renuo review-app:purge`
|
|
17
|
+
|
|
18
|
+
## Design Choices
|
|
19
|
+
|
|
20
|
+
* The git branch determines the lifetime of a review app
|
|
21
|
+
* The branch name **hash** is the only safe identifier.
|
|
22
|
+
It is being used to purge resources.
|
|
23
|
+
Connected services do not work across all systems (e.g. Nutanix Object Storage)
|
|
24
|
+
* A dry-run command flag is not easily possible because we rely on generated system output.
|
|
25
|
+
* We use the sunny/actor gem to concentrate reviewability to the command flow
|
|
26
|
+
* There is a special "safeguards" feature test. It covers the safe name contract.
|
|
27
|
+
* All `nctl` commands are routed through `system!` and are logged in a command trail for auditing.
|
|
28
|
+
* Configuration of system tools like `psql` is intentionally out of scope.
|
|
29
|
+
But CI templating can give you some pointers.
|
data/lib/renuo/cli/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: renuo-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.29.
|
|
4
|
+
version: 4.29.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Renuo AG
|
|
@@ -117,6 +117,7 @@ files:
|
|
|
117
117
|
- lib/renuo/cli/commands/heroku_users.rb
|
|
118
118
|
- lib/renuo/cli/commands/list_large_git_files.rb
|
|
119
119
|
- lib/renuo/cli/commands/release.rb
|
|
120
|
+
- lib/renuo/cli/commands/review_app/README.md
|
|
120
121
|
- lib/renuo/cli/commands/review_app/deploy.rb
|
|
121
122
|
- lib/renuo/cli/commands/review_app/name.rb
|
|
122
123
|
- lib/renuo/cli/commands/review_app/purge.rb
|