-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Packaging): Build and release deb and rpm packages #592
Conversation
Codecov Report
@@ Coverage Diff @@
## master #592 +/- ##
==========================================
- Coverage 76.69% 74.99% -1.70%
==========================================
Files 132 133 +1
Lines 8308 10086 +1778
==========================================
+ Hits 6371 7563 +1192
- Misses 1473 2053 +580
- Partials 464 470 +6
Continue to review full report at Codecov.
|
@@ -24,6 +24,32 @@ make build-darwin-amd64 | |||
|
|||
Tests can be run with `make test`. | |||
|
|||
## Integration Tests with CINC Test Kitchen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of the CINC stuff? I've not seen this before do we have a standard for using it elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CINC is an open source fork of Chef. Chef's license changed as is not suitable for us. I use CINC's Auditor (chef inspec) to validate post install state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not have a standard, however, I think it is important that we test the end state. You can run kitchen test <distro>
.
This config is using vagrant + virtual box, so it will not work for everyone. I think we can use vmware workstation or maybe GCE but support is not as great. Their virtual box implementation is very nice.
➜ stanza git:(packages-deb-rpm) kitchen test debian-10
-----> Starting Test Kitchen (v3.2.2)
-----> Cleaning up any prior instances of <default-debian-10>
-----> Destroying <default-debian-10>...
Finished destroying <default-debian-10> (0m0.00s).
-----> Testing <default-debian-10>
-----> Creating <default-debian-10>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/debian-10'...
==> default: Matching MAC address for NAT networking...
...
(Reading database ... 29511 files and directories currently installed.)
Preparing to unpack .../stanza_1.6.0_linux_amd64.deb ...
Unpacking stanza (1.6.0) ...
Setting up stanza (1.6.0) ...
detected service file directory: /usr/lib/systemd/system
configured systemd service
Created symlink /etc/systemd/system/multi-user.target.wants/stanza.service → /lib/systemd/system/stanza.service.
Downloading files from <default-debian-10>
Finished converging <default-debian-10> (0m1.88s).
-----> Setting up <default-debian-10>...
Finished setting up <default-debian-10> (0m0.00s).
-----> Verifying <default-debian-10>...
Loaded tests from {:path=>".home.jsirianni.git.stanza.build.package.test"}
Profile: tests from {:path=>"/home/jsirianni/git/stanza/build/package/test"} (tests from {:path=>".home.jsirianni.git.stanza.build.package.test"})
Version: (not specified)
Target: ssh://[email protected]:2222
File /opt/observiq/stanza
✔ mode is expected to cmp == "0755"
✔ owner is expected to eq "stanza"
✔ group is expected to eq "stanza"
✔ type is expected to cmp == "directory"
File /opt/observiq/stanza/plugins
✔ mode is expected to cmp == "0755"
✔ owner is expected to eq "stanza"
✔ group is expected to eq "stanza"
✔ type is expected to cmp == "directory"
File /opt/observiq/stanza/stanza.db
✔ mode is expected to cmp == "0600"
✔ owner is expected to eq "stanza"
✔ group is expected to eq "stanza"
✔ type is expected to cmp == "file"
File /opt/observiq/stanza/stanza.log
✔ mode is expected to cmp == "0644"
✔ owner is expected to eq "stanza"
✔ group is expected to eq "stanza"
✔ type is expected to cmp == "file"
File /opt/observiq/stanza/config.yaml
✔ mode is expected to cmp == "0640"
✔ owner is expected to eq "stanza"
✔ group is expected to eq "stanza"
✔ type is expected to cmp == "file"
File /usr/bin/stanza
✔ mode is expected to cmp == "0755"
✔ owner is expected to eq "root"
✔ group is expected to eq "root"
✔ type is expected to cmp == "file"
Service stanza
✔ is expected to be installed
✔ is expected to be enabled
✔ is expected to be running
Test Summary: 27 successful, 0 failures, 0 skipped
Finished verifying <default-debian-10> (0m1.41s).
-----> Destroying <default-debian-10>...
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
Vagrant instance <default-debian-10> destroyed.
Finished destroying <default-debian-10> (0m2.59s).
Finished testing <default-debian-10> (0m38.25s).
-----> Test Kitchen is finished. (0m38.77s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree testing is worth while. I'm ok with this for now but my fears are:
- bloat in our repos (maybe we move this tooling to an internal repo that just runs these types of tests)
- Complex tooling that doesn't work everywhere.
As an action item can you write up a proposal for using this or submit something to the standards repo if we want to move forward with this? I'm ok with Stanza being the poc repo for this but I would like some discussion before we put this heavy tooling in everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍
Description of Changes
Added deb and rpm package building to Goreleaser.
Set binary name to
stanza
and disabledno_unique_dist_dir
as this is the name that will be used during package install (/usr/bin/stanza
).Package install will
stanza
userAdded CINC Test Kitchen config
kitchen test debian-10
Documented how to use CINC / Test Kitchen.
Documented package install process.
Documented how to use a root user when installing with a package manager.
Questions
On release, I believe the binary file names will be
Which is not going to work with the current install script (line 309):
Should that be addressed with this PR?
Please check that the PR fulfills these requirements