Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.rb eol=lf
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
*.epp eol=lf
26 changes: 13 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ cache:
before_script:
- bundle -v
- rm Gemfile.lock || true
- gem update --system
- gem update --system $RUBYGEMS_VERSION
- gem --version
- bundle -v
- bundle install --without system_tests --path vendor/bundle --jobs $(nproc)

parallel_spec-Ruby 2.1.9-Puppet ~> 4.0:
syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.5.1-Puppet ~> 6.0:
stage: syntax
image: ruby:2.1.9
image: ruby:2.5.1
script:
- bundle exec rake parallel_spec
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
variables:
PUPPET_GEM_VERSION: '~> 4.0'
PUPPET_GEM_VERSION: '~> 6.0'

syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.4.4-Puppet ~> 5.5:
stage: syntax
image: ruby:2.4.4
parallel_spec-Ruby 2.5.1-Puppet ~> 6.0:
stage: unit
image: ruby:2.5.1
script:
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 5.5'
PUPPET_GEM_VERSION: '~> 6.0'

parallel_spec-Ruby 2.4.4-Puppet ~> 5.5:
stage: syntax
parallel_spec-Ruby 2.4.4-Puppet ~> 5.0:
stage: unit
image: ruby:2.4.4
script:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 5.5'
PUPPET_GEM_VERSION: '~> 5.0'

13 changes: 13 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@
/convert_report.txt
/update_report.txt
.DS_Store
/appveyor.yml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
1 change: 1 addition & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--relative
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ AllCops:
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/*
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Expand Down
17 changes: 7 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
---
sudo: false
dist: trusty
language: ruby
cache: bundler
before_install:
- bundle -v
- rm -f Gemfile.lock
- gem update --system
- gem update --system $RUBYGEMS_VERSION
- gem --version
- bundle -v
script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.4.4
- 2.5.1
env:
global:
- BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0"
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
matrix:
fast_finish: true
include:
-
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
-
env: CHECK=parallel_spec
-
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.4
branches:
only:
- master
- /^v\d/
- master
- /^v\d/
notifications:
email: false
deploy:
Expand Down
35 changes: 9 additions & 26 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

def location_for(place_or_version, fake_version = nil)
if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)}
[fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
elsif place_or_version =~ %r{\Afile:\/\/(.*)}
['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
else
[place_or_version, { require: false }]
end
end
git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
file_url_regex = %r{\Afile:\/\/(?<path>.*)}

def gem_type(place_or_version)
if place_or_version =~ %r{\Agit[:@]}
:git
elsif !place_or_version.nil? && place_or_version.start_with?('file:')
:file
if place_or_version && (git_url = place_or_version.match(git_url_regex))
[fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
else
:gem
[place_or_version, { require: false }]
end
end

Expand All @@ -28,25 +21,15 @@ group :development do
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '<= 2.0.4', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
end

group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.13')
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
end

puppet_version = ENV['PUPPET_GEM_VERSION']
puppet_type = gem_type(puppet_version)
facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['HIERA_GEM_VERSION']

Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?

def changelog_user
return unless Rake.application.top_level_tasks.include? "changelog"
Expand Down
19 changes: 11 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
version: 1.1.x.{build}
branches:
only:
- master
skip_commits:
message: /^\(?doc\)?.*/
clone_depth: 10
Expand All @@ -14,14 +17,6 @@ environment:
-
RUBY_VERSION: 24-x64
CHECK: syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
-
PUPPET_GEM_VERSION: ~> 4.0
RUBY_VERSION: 21
CHECK: parallel_spec
-
PUPPET_GEM_VERSION: ~> 4.0
RUBY_VERSION: 21-x64
CHECK: parallel_spec
-
PUPPET_GEM_VERSION: ~> 5.0
RUBY_VERSION: 24
Expand All @@ -30,6 +25,14 @@ environment:
PUPPET_GEM_VERSION: ~> 5.0
RUBY_VERSION: 24-x64
CHECK: parallel_spec
-
PUPPET_GEM_VERSION: ~> 6.0
RUBY_VERSION: 25
CHECK: parallel_spec
-
PUPPET_GEM_VERSION: ~> 6.0
RUBY_VERSION: 25-x64
CHECK: parallel_spec
matrix:
fast_finish: true
install:
Expand Down
48 changes: 31 additions & 17 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,54 @@

class artifactory_pro(
String $license_key,
Boolean $manage_java = true,
String $yum_name = 'bintray-jfrog-artifactory-pro-rpms',
String $yum_baseurl = 'http://jfrog.bintray.com/artifactory-pro-rpms',
String $package_name = 'jfrog-artifactory-pro',
Optional[String] $jdbc_driver_url = undef,
Optional[Enum['mssql', 'mysql', 'oracle', 'postgresql']] $db_type = undef,
Optional[String] $db_url = undef,
Optional[String] $db_username = undef,
Optional[String] $db_password = undef,
Optional[Enum['filesystem', 'fullDb','cachedFS']] $binary_provider_type = undef,
Optional[Integer] $pool_max_active = undef,
Optional[Integer] $pool_max_idle = undef,
Optional[Integer] $binary_provider_cache_maxsize = undef,
Optional[String] $binary_provider_filesystem_dir = undef,
Optional[String] $binary_provider_cache_dir = undef,
Hash $plugin_urls = {},
Boolean $manage_java = true,
Boolean $manage_repo = true,
String $yum_name = 'bintray-jfrog-artifactory-pro-rpms',
String $yum_baseurl = 'http://jfrog.bintray.com/artifactory-pro-rpms',
String $package_name = 'jfrog-artifactory-pro',
String $package_version = 'present',
String $artifactory_home = '/var/opt/jfrog/artifactory',
Optional[String] $root_password = 'password',
Optional[String] $jdbc_driver_url = undef,
Optional[Enum['derby', 'mssql', 'mysql', 'oracle', 'postgresql']] $db_type = undef,
Optional[String] $db_url = undef,
Optional[String] $db_username = undef,
Optional[String] $db_password = undef,
Optional[Boolean] $db_automate = false,
Optional[Enum['filesystem', 'fullDb', 'cachedFS', 'fullDbDirect']] $binary_provider_type = undef,
Optional[Integer] $pool_max_active = undef,
Optional[Integer] $pool_max_idle = undef,
Optional[Integer] $binary_provider_cache_maxsize = undef,
Optional[String] $binary_provider_base_data_dir = undef,

Optional[String] $binary_provider_filesystem_dir = undef,
Optional[String] $binary_provider_cache_dir = undef,
Hash $plugin_urls = {},
Optional[String] $master_key = undef,
) {

class{'::artifactory':
manage_java => $manage_java,
manage_repo => $manage_repo,
yum_name => $yum_name,
yum_baseurl => $yum_baseurl,
package_name => $package_name,
package_version => $package_version,
root_password => $root_password,
jdbc_driver_url => $jdbc_driver_url,
db_type => $db_type,
db_url => $db_url,
db_username => $db_username,
db_password => $db_password,
db_automate => $db_automate,
binary_provider_type => $binary_provider_type,
pool_max_active => $pool_max_active,
pool_max_idle => $pool_max_idle,
binary_provider_cache_maxsize => $binary_provider_cache_maxsize,
binary_provider_filesystem_dir => $binary_provider_filesystem_dir,
binary_provider_base_data_dir => $binary_provider_base_data_dir,
binary_provider_cache_dir => $binary_provider_cache_dir,
jdbc_driver_url => $jdbc_driver_url,
master_key => $master_key,
}
-> class{'::artifactory_pro::config': }
-> class{'::artifactory_pro::post_config': }
Expand Down
24 changes: 20 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autostructure-artifactory_pro",
"version": "2.0.7",
"version": "2.1.0",
"author": "Bryan Belanger",
"summary": "Installs Artifactory Pro. Not HA configuration.",
"license": "Apache-2.0",
Expand All @@ -10,7 +10,23 @@
"dependencies": [
{
"name": "autostructure-artifactory",
"version_requirement": ">= 2.0.9 <= 2.0.15"
"version_requirement": ">= 2.1.0 <= 2.2.0"
},
{
"name": "puppetlabs-yumrepo_core",
"version_requirement": ">= 1.0.0 <= 2.0.0"
},
{
"name": "puppetlabs-mysql",
"version_requirement": ">= 8.0.0 <= 9.0.0"
},
{
"name": "puppetlabs-java",
"version_requirement": ">= 1.5.0 <= 3.0.0"
},
{
"name": "puppetlabs-stdlib",
"version_requirement": ">= 4.0.0 < 6.0.0"
}
],
"operatingsystem_support": [
Expand Down Expand Up @@ -42,7 +58,7 @@
"version_requirement": ">= 4.7.0 < 6.0.0"
}
],
"pdk-version": "1.6.1",
"pdk-version": "1.9.1",
"template-url": "file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git",
"template-ref": "1.6.1-0-g6b0d497"
"template-ref": "1.9.1-0-g6945d31"
}
1 change: 0 additions & 1 deletion spec/default_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#
# Facts specified here will override the values provided by rspec-puppet-facts.
---
concat_basedir: "/tmp"
ipaddress: "172.16.254.254"
is_pe: false
macaddress: "AA:AA:AA:AA:AA:AA"
Loading