-
Notifications
You must be signed in to change notification settings - Fork 88
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
Freebsd pkg addon #154
Merged
Merged
Freebsd pkg addon #154
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4ed4faa
FreeBSD, add pkg addon
DamianSzymanski 20c9d25
Update schema
DamianSzymanski 615033f
Minor spec update add pkg
DamianSzymanski e8b72ea
spec addons.pkg
svenfuchs c0d4a90
Merge branch 'master' into freebsd_pkg_addon
DamianSzymanski 563d677
Remove package alias
DamianSzymanski 10677a7
Merge branch 'master' into freebsd_pkg_addon
DamianSzymanski e5ba9a3
Update specs
DamianSzymanski File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
require 'travis/yml/schema/type' | ||
|
||
module Travis | ||
module Yml | ||
module Schema | ||
module Def | ||
module Addon | ||
class Pkg < Addon | ||
register :pkg | ||
|
||
def define | ||
prefix :packages | ||
|
||
map :packages, to: :seq, alias: :package, summary: 'Package names', eg: 'cmake' | ||
map :branch, to: :str, summary: 'Packages branch', eg: 'quarterly' | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
describe Travis::Yml, 'addon: pkg' do | ||
subject { described_class.apply(parse(yaml)) } | ||
|
||
describe 'packages given a string' do | ||
yaml %( | ||
addons: | ||
pkg: | ||
packages: str | ||
) | ||
it { should serialize_to addons: { pkg: { packages: ['str'] } } } | ||
it { should_not have_msg } | ||
end | ||
|
||
describe 'package given a string (alias)' do | ||
yaml %( | ||
addons: | ||
pkg: | ||
package: str | ||
) | ||
it { should serialize_to addons: { pkg: { packages: ['str'] } } } | ||
it { should have_msg [:info, :'addons.pkg', :alias_key, alias: 'package', key: 'packages'] } | ||
end | ||
|
||
describe 'packages given a seq' do | ||
yaml %( | ||
addons: | ||
pkg: | ||
packages: | ||
- str | ||
) | ||
it { should serialize_to addons: { pkg: { packages: ['str'] } } } | ||
it { should_not have_msg } | ||
end | ||
|
||
describe 'package given a seq (alias)' do | ||
yaml %( | ||
addons: | ||
pkg: | ||
package: | ||
- str | ||
) | ||
it { should serialize_to addons: { pkg: { packages: ['str'] } } } | ||
it { should have_msg [:info, :'addons.pkg', :alias_key, alias: 'package', key: 'packages'] } | ||
end | ||
|
||
describe 'branch given a string' do | ||
yaml %( | ||
addons: | ||
pkg: | ||
branch: str | ||
) | ||
it { should serialize_to addons: { pkg: { branch: 'str' } } } | ||
it { should_not have_msg } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
describe Travis::Yml::Schema::Def::Addon::Pkg do | ||
subject { Travis::Yml.schema[:definitions][:addon][:pkg] } | ||
|
||
# it { puts JSON.pretty_generate(subject) } | ||
|
||
it do | ||
should eq( | ||
'$id': :pkg, | ||
title: 'Pkg', | ||
anyOf: [ | ||
{ | ||
type: :object, | ||
properties: { | ||
packages: { | ||
'$ref': '#/definitions/type/strs', | ||
aliases: [ | ||
:package | ||
], | ||
summary: 'Package names', | ||
example: 'cmake' | ||
}, | ||
branch: { | ||
type: :string, | ||
summary: 'Packages branch', | ||
example: 'quarterly' | ||
} | ||
}, | ||
additionalProperties: false, | ||
prefix: { | ||
key: :packages | ||
}, | ||
normal: true, | ||
changes: [ | ||
{ | ||
change: :enable | ||
} | ||
] | ||
}, | ||
{ | ||
'$ref': '#/definitions/type/strs', | ||
example: 'cmake' | ||
}, | ||
{ | ||
type: :boolean | ||
} | ||
], | ||
normal: true, | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,7 @@ | |
jwts | ||
sauce_connect | ||
snaps | ||
pkg | ||
sonarcloud | ||
), | ||
deploy: %i( | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'd suggest using
names
herepkg
already suggests "package", so "package names" would read better than "package package".also, i'd suggest not adding aliases unless we have to.
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.
It was suggestion from freebsd community c (like apt)
and alias
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.
On Ubuntu builds we keep aliases as follows:
apt
is replaced withpkg
in FreeBSD, which may be not so fortunate, but I'm for keeping it consistent with linux based mechanism - less confusion for usersThere 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.
and we already made it consistent on macos:
so if we introduce something different now, we should allow it for all other OSes - I'd prefer to give less options to the users