Commit 30fda742 authored by Apollon Oikonomopoulos's avatar Apollon Oikonomopoulos

Merge tag '6.2.0' into debian

6.2.0
parents 654bb83a 84b80fbb
*
!project.clj
!src
!resources
!documentation
!docker/puppetdb
docker/puppetdb/* text eol=lf
docker/puppetdb/conf.d/* text eol=lf
docker/puppetdb/logging/* text eol=lf
docker/puppetdb/docker-entrypoint.d/* text eol=lf
# Leiningen
/target/
/target-gems/
/pom.xml
# Acceptance tests
......@@ -51,3 +52,13 @@ checkouts
/resources/locales.clj
/mp-*
/dev-resources/i18n/bin
/.bundle/
/ext/test-conf/pgbin-requested
/ext/test-conf/pgport-requested
/ext/test-conf/pgver-requested
/ext/test-conf/puppet-ref-requested
/ext/test-conf/puppetserver-dep
/ext/test-conf/puppetserver-ref-requested
/puppet/state/
/puppetserver/
language: clojure
lein: 2.7.1
language: generic
dist: trusty
# Always explicitly set sudo. Otherwise travis' defaults may vary
# based on when the repository testing was enabled.
sudo: required
matrix:
services:
- docker
# The test specifications are all extracted from the PDB_TEST value.
# jdk_switcher is a shell function, so we can't handle it in
# prep-os-essentials-for:
# https://github.com/travis-ci/travis-ci/issues/9927
# We explicitly set up lein and pgbox at the top level so that we can
# use them in commands like test-config, and so we can't end up doing
# it multiple times if any of the (e.g. boxed-) sub-commands also make
# the attempt.
aliases:
- &run-core-and-ext-tests |
set -e
jdk="$(ext/bin/jdk-from-spec "$PDB_TEST")"
jdkver="${jdk##*jdk}"
ext/travisci/prep-os-essentials-for "$PDB_TEST"
case "$OSTYPE" in
linux*)
if test "$jdkver" -lt 9 ; then
jdk_switcher use "$jdk";
else
ext/bin/require-jdk "$jdk" ext/travisci/local
export JAVA_HOME="$(pwd)/ext/travisci/local/jdk"
export PATH="$JAVA_HOME/bin:$PATH"
fi
;;
darwin*)
export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-$jdkver.jdk/Contents/Home"
export PATH="$JAVA_HOME/bin:$PATH"
hash -r
;;
*)
echo "$OSTYPE is not a supported system" 1>&2
exit 2
;;
esac
mkdir -p ext/travisci/local
export PATH="$(pwd)/ext/travisci/local/bin:$PATH"
ext/bin/require-leiningen default ext/travisci/local
ext/bin/require-pgbox default ext/travisci/local
pgver="$(ext/travisci/prefixed-ref-from-spec "$PDB_TEST" pg-)"
ext/bin/test-config --set pgver "$pgver"
ext/bin/test-config --set pgport 34335
ext/bin/check-spec-env "$PDB_TEST"
ext/bin/boxed-core-tests -- lein test
ext/bin/run-external-tests
- &run-integration-tests |
set -e
jdk="$(ext/bin/jdk-from-spec "$PDB_TEST")"
jdkver="${jdk##*jdk}"
ext/travisci/prep-os-essentials-for "$PDB_TEST"
case "$OSTYPE" in
linux*)
if test "$jdkver" -lt 9 ; then
jdk_switcher use "$jdk";
else
ext/bin/require-jdk "$jdk" ext/travisci/local
export JAVA_HOME="$(pwd)/ext/travisci/local/jdk"
export PATH="$JAVA_HOME/bin:$PATH"
fi
;;
darwin*)
export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-$jdkver.jdk/Contents/Home"
export PATH="$JAVA_HOME/bin:$PATH"
hash -r
;;
*)
echo "$OSTYPE is not a supported system" 1>&2
exit 2
;;
esac
mkdir -p ext/travisci/local
export PATH="$(pwd)/ext/travisci/local/bin:$PATH"
ext/bin/require-leiningen default ext/travisci/local
ext/bin/require-pgbox default ext/travisci/local
pgver="$(ext/travisci/prefixed-ref-from-spec "$PDB_TEST" pg-)"
puppet="$(ext/travisci/prefixed-ref-from-spec "$PDB_TEST" pup-)"
server="$(ext/travisci/prefixed-ref-from-spec "$PDB_TEST" srv-)"
ext/bin/test-config --set pgver "$pgver"
ext/bin/test-config --set pgport 34335
ext/bin/test-config --set puppet-ref "$puppet"
ext/bin/test-config --set puppetserver-ref "$server"
PDB_TEST_RICH_DATA="$(ext/travisci/spec-includes "$PDB_TEST" rich)"
export PDB_TEST_RICH_DATA
ext/bin/check-spec-env "$PDB_TEST"
ext/bin/boxed-integration-tests -- lein test :integration
- &run-spec-tests |
set -e
puppet_ref="$(ext/travisci/prefixed-ref-from-spec "$PDB_TEST" pup-)"
ext/bin/check-spec-env "$PDB_TEST"
ext/bin/run-rspec-tests "$puppet_ref"
- &run-docker-tests |
set -ex
cd docker
make lint
make build
make test
jobs:
include:
# terminus unit tests (spec tests)
- env: >
NAME=rspec-puppet-4.0
PDB_TEST_LANG=ruby
PUPPET_VERSION=4.0.0
- env: >
NAME=rspec-puppet-latest
PDB_TEST_LANG=ruby
PUPPET_VERSION=latest
# pdb unit tests
- env: >
NAME=unit-openjdk8
PDB_TEST_LANG=clojure
PDB_TEST_SELECTOR=:unit
jdk: openjdk8
- env: >
NAME=unit-openjdk7
PDB_TEST_LANG=clojure
PDB_TEST_SELECTOR=:unit
jdk: openjdk7
- env: >
NAME=unit-oracle8
PDB_TEST_LANG=clojure
PDB_TEST_SELECTOR=:unit
jdk: oraclejdk8
- env: >
NAME=unit-oracle7
PDB_TEST_LANG=clojure
PDB_TEST_SELECTOR=:unit
jdk: oraclejdk7
# pdb + terminus + puppetserver + puppet integration tests
- env: >
NAME=integration-stable-openjdk7
PDB_TEST_LANG=clojure
PDB_TEST_SELECTOR=:integration
PUPPET_VERSION=4.8.0
PUPPETSERVER_VERSION=2.7.2
jdk: openjdk7
- env: >
NAME=integration-stable-openjdk8
PDB_TEST_LANG=clojure
PDB_TEST_SELECTOR=:integration
PUPPET_VERSION=4.8.0
PUPPETSERVER_VERSION=2.7.2
jdk: openjdk8
- env: >
NAME=integration-latest-puppet-openjdk8
PDB_TEST_LANG=clojure
PDB_TEST_SELECTOR=:integration
PUPPET_VERSION=latest
PUPPETSERVER_VERSION=2.7.2
jdk: openjdk8
- env: >
NAME=integration-stable-oraclejdk8
PDB_TEST_LANG=clojure
PDB_TEST_SELECTOR=:integration
PUPPET_VERSION=4.8.0
PUPPETSERVER_VERSION=2.7.2
jdk: oraclejdk8
- env: >
NAME=integration-latest-puppet-oraclejdk8
PDB_TEST_LANG=clojure
PDB_TEST_SELECTOR=:integration
PUPPET_VERSION=latest
PUPPETSERVER_VERSION=2.7.2
jdk: oraclejdk8
before_install: ext/travisci/install_puppetserver.sh
script: ext/travisci/test.sh
# === core+ext tests
- stage: ❧ pdb tests
env: PDB_TEST=core+ext/openjdk8/pg-9.6
script: *run-core-and-ext-tests
- stage: ❧ pdb tests
env: PDB_TEST=core+ext/oraclejdk8/pg-9.6
script: *run-core-and-ext-tests
- stage: ❧ pdb tests
env: PDB_TEST=core+ext/openjdk10/pg-9.6
script: *run-core-and-ext-tests
- stage: ❧ pdb tests
env: PDB_TEST=core+ext/openjdk8/pg-11
script: *run-core-and-ext-tests
# === integration with master branches
- stage: ❧ pdb tests
env: PDB_TEST=int/openjdk10/pup-master/srv-master/pg-9.6
script: *run-integration-tests
- stage: ❧ pdb tests
env: PDB_TEST=int/openjdk10/pup-master/srv-master/pg-9.6/rich
script: *run-integration-tests
- stage: ❧ pdb tests
env: PDB_TEST=int/openjdk8/pup-master/srv-master/pg-9.6/rich
script: *run-integration-tests
- stage: ❧ pdb tests
env: PDB_TEST=int/oraclejdk8/pup-master/srv-master/pg-9.6/rich
script: *run-integration-tests
- stage: ❧ pdb tests
env: PDB_TEST=int/openjdk8/pup-master/srv-master/pg-11
script: *run-integration-tests
# === integration with current platform
- stage: ❧ pdb tests
env: PDB_TEST=int/openjdk10/pup-6.0.x/srv-6.0.x/pg-9.6
script: *run-integration-tests
- stage: ❧ pdb tests
env: PDB_TEST=int/openjdk10/pup-6.0.x/srv-6.0.x/pg-9.6/rich
script: *run-integration-tests
- stage: ❧ pdb tests
env: PDB_TEST=int/openjdk8/pup-6.0.x/srv-6.0.x/pg-9.6/rich
script: *run-integration-tests
- stage: ❧ pdb tests
env: PDB_TEST=int/oraclejdk8/pup-6.0.x/srv-6.0.x/pg-9.6/rich
script: *run-integration-tests
# === rspec tests
- stage: ❧ pdb tests
env: PDB_TEST=rspec/pup-6.0.x
script: *run-spec-tests
- stage: ❧ pdb tests
env: PDB_TEST=rspec/pup-5.5.x
script: *run-spec-tests
# ==== osx
# === core+ext tests
- stage: ❧ pdb tests
env: PDB_TEST=core+ext/openjdk8/pg-9.6
script: *run-core-and-ext-tests
os: osx
- stage: ❧ pdb tests
env: PDB_TEST=core+ext/openjdk10/pg-9.6
script: *run-core-and-ext-tests
os: osx
# === integration tests
- stage: ❧ pdb tests
env: PDB_TEST=int/openjdk8/pup-master/srv-master/pg-9.6/rich
script: *run-integration-tests
os: osx
- stage: ❧ pdb tests
env: PDB_TEST=int/openjdk10/pup-master/srv-master/pg-9.6/rich
script: *run-integration-tests
os: osx
# === rspec tests
- stage: ❧ pdb tests
env: PDB_TEST=rspec/pup-6.0.x
script: *run-spec-tests
os: osx
- stage: ❧ pdb container tests
script: *run-docker-tests
on_success: ext/travisci/on-success
notifications:
email: false
hipchat:
rooms:
secure: gZpfMrGsUEHKzHfDaq8S00Xd35gzwEzcAy5/VV7JOGcmXLyWlx7ojh/Ke4rJ1vOa59OlazyCt5o8uDhB0CcQnZ2Aa6ncoOyLpLLjO8/Ak8qsxPLgC4Ov/zuRA4oTvxqZtaR7Juwbeobp5lB1OSFb7o4G747tC2Ihd1Nhx717tdQ=
slack:
template:
- '%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message} (<a href="%{build_url}">Details</a>/<a href="%{compare_url}">Change view</a>)'
format: html
# Host addons handle buffer overflow in jdk 7 with travis' long
# hostnames:
# https://github.com/travis-ci/travis-ci/issues/5227#issuecomment-165131913
# http://mail.openjdk.java.net/pipermail/net-dev/2012-July/004603.html
# http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7089443
# http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7112670
addons:
hosts:
- pdbtest
hostname: pdbtest
postgresql: "9.4"
services: postgresql
- "<%{compare_url}|%{commit_subject}> | %{author}"
- "%{repository_slug} %{branch} | <%{build_url}|#%{build_number}> %{result} in %{elapsed_time}"
rooms:
secure: IJU0YgGYbKgM7NupaOmE2BYra2mNx7+e5vAYNL+5oaRXolbHCyg0WzfFWilhMK3KEi8oIMKXR4ZzoUZLAqeOQzX7nnsLqC3wjyDHCgxtp4O+5GNKyeLN4ItoI1f2d6qyiiBPkHgVPuLhG3yyQ+wD0dMc9vSYmxfoazqe9HD/9UE=
cache:
directories:
- $HOME/.m2
- $HOME/Library/Caches/Homebrew
- vendor/bundle/ruby
- ext/travisci/local/jdk
gemfile_home = File.dirname(__FILE__)
source ENV['GEM_SOURCE'] || "https://rubygems.org"
puppet_branch = ENV['PUPPET_VERSION'] || "latest"
oldest_supported_puppet = "4.0.0"
oldest_supported_puppet = "5.0.0"
beaker_version = ENV['BEAKER_VERSION']
begin
puppet_ref = File.read(gemfile_home + '/ext/test-conf/puppet-ref-requested').strip
rescue Errno::ENOENT
puppet_ref = File.read(gemfile_home + '/ext/test-conf/puppet-ref-default').strip
end
def location_for(place, fake_version = nil)
if place =~ /^(git:[^#]*)#(.*)/
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
......@@ -15,6 +22,7 @@ end
gem 'facter'
gem 'rake'
gem 'packaging', *location_for(ENV['PACKAGING_VERSION'] || '~> 0.99')
group :test do
# Add test-unit for ruby 2.2+ support (has been removed from stdlib)
......@@ -35,14 +43,14 @@ group :test do
# docker-api 1.32.0 requires ruby 2.0.0
gem 'docker-api', '1.31.0'
case puppet_branch
case puppet_ref
when "latest"
gem 'puppet', ">= #{oldest_supported_puppet}", :require => false
when "oldest"
gem 'puppet', oldest_supported_puppet, :require => false
else
gem 'puppet', :git => 'https://github.com/puppetlabs/puppet.git',
:branch => puppet_branch, :require => false
:ref => puppet_ref, :require => false
end
gem 'mocha', '~> 1.0'
......@@ -58,9 +66,11 @@ if ENV['NO_ACCEPTANCE'] != 'true'
gem 'beaker', *location_for(beaker_version)
else
# use the pinned version
gem 'beaker', '~> 3.4'
gem 'beaker', '~> 4.1'
end
end
gem 'beaker-hostgenerator', '0.8.2'
gem 'beaker-hostgenerator', '1.1.13'
gem 'beaker-abs', *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.2')
gem 'beaker-vmpooler', *location_for(ENV['BEAKER_VMPOOLER_VERSION'] || "~> 1.3")
gem 'beaker-puppet', '~> 1.0'
end
......@@ -4,11 +4,6 @@
"issues": "https://tickets.puppetlabs.com/browse/PDB",
"internal_list": "https://groups.google.com/a/puppet.com/forum/?hl=en#!forum/discuss-puppetdb-maintainers",
"people": [
{
"github": "senior",
"email": "ryan.senior@puppet.com",
"name": "Ryan Senior"
},
{
"github": "wkalt",
"email": "wyatt@puppet.com",
......@@ -33,11 +28,6 @@
"github": "rbrw",
"email": "rlb@puppet.com",
"name": "Rob Browning"
},
{
"github": "briancain",
"email": "brian.cain@puppet.com",
"name": "Brian Cain"
}
]
}
# PuppetDB [![Build Status](https://travis-ci.org/puppetlabs/puppetdb.svg?branch=stable)](https://travis-ci.org/puppetlabs/puppetdb)
# PuppetDB [![Build Status](https://travis-ci.org/puppetlabs/puppetdb.svg?branch=master)](https://travis-ci.org/puppetlabs/puppetdb)
[docs]: https://docs.puppet.com/puppetdb/latest
[contributing]: documentation/CONTRIBUTING.md
[users]: https://groups.google.com/forum/#!forum/puppet-users
PuppetDB is the fast, scalable, and reliable data warehouse for Puppet. It caches data generated by Puppet, and gives you advanced features at awesome speed with a powerful API.
......@@ -9,10 +10,10 @@ For documentation on this product, consult the [latest documentation][docs].
## Contributing
If you would like to contribute to PuppetDB, please take a look at our [contributing doc][contributing]
If you would like to contribute to PuppetDB, please take a look at our [contributing doc][contributing].
## Maintenance
Community Help: Puppet Users Forum <puppet-users@googlegroups.com>, [Puppet Community Portal](https://puppet.com/community)
Community Help: [Puppet Users Mailing List][users], [Puppet Community Portal](https://puppet.com/community)
Tickets: [https://tickets.puppet.com/browse/PDB](https://tickets.puppet.com/browse/PDB)
require 'rake'
RAKE_ROOT = File.dirname(__FILE__)
def run_beaker(test_files)
config = ENV["BEAKER_CONFIG"] || "acceptance/config/vmpooler.cfg"
options = ENV["BEAKER_OPTIONS"] || "acceptance/options/postgres.rb"
......@@ -66,39 +64,18 @@ namespace :beaker do
end
end
build_defs_file = File.join(RAKE_ROOT, 'ext', 'build_defaults.yaml')
if File.exist?(build_defs_file)
begin
require 'yaml'
@build_defaults ||= YAML.load_file(build_defs_file)
rescue Exception => e
STDERR.puts "Unable to load yaml from #{build_defs_file}:"
raise e
end
@packaging_url = @build_defaults['packaging_url']
@packaging_repo = @build_defaults['packaging_repo']
raise "Could not find packaging url in #{build_defs_file}" if @packaging_url.nil?
raise "Could not find packaging repo in #{build_defs_file}" if @packaging_repo.nil?
namespace :package do
desc "Bootstrap packaging automation, e.g. clone into packaging repo"
task :bootstrap do
if File.exist?(File.join(RAKE_ROOT, "ext", @packaging_repo))
puts "It looks like you already have ext/#{@packaging_repo}. If you don't like it, blow it away with package:implode."
else
cd File.join(RAKE_ROOT, 'ext') do
%x{git clone #{@packaging_url}}
end
end
end
desc "Remove all cloned packaging automation"
task :implode do
rm_rf File.join(RAKE_ROOT, "ext", @packaging_repo)
end
end
begin
require 'packaging'
Pkg::Util::RakeUtils.load_packaging_tasks
rescue LoadError => e
puts "Error loading packaging rake tasks: #{e}"
end
begin
load File.join(RAKE_ROOT, 'ext', 'packaging', 'packaging.rake')
rescue LoadError
namespace :package do
task :bootstrap do
puts 'Bootstrap is no longer needed, using packaging-as-a-gem'
end
task :implode do
puts 'Implode is no longer needed, using packaging-as-a-gem'
end
end
require 'cgi'
require 'beaker/dsl/install_utils'
require 'beaker/dsl/helpers'
require 'beaker-puppet'
require 'open3'
require 'pp'
require 'set'
require 'test/unit/assertions'
......@@ -10,7 +12,7 @@ require 'inifile'
module PuppetDBExtensions
include Test::Unit::Assertions
GitReposDir = Beaker::DSL::InstallUtils::SourcePath
GitReposDir = Beaker::DSL::InstallUtils::FOSSUtils::SourcePath
# We include the Puppet path here so we can use the Puppet ecosystem when
# using rake, which needs the facter gem to work - AIO ruby contains this
......@@ -25,9 +27,9 @@ module PuppetDBExtensions
[:git, :package, :pe], "install type", "PUPPETDB_INSTALL_TYPE", :git)
install_mode =
get_option_value(options[:install_mode],
[:install, :upgrade_latest, :upgrade_oldest], "install mode",
"INSTALL_MODE", :install)
get_option_value(options[:install_type],
[:install, :upgrade_latest, :upgrade_oldest], "install type",
"INSTALL_TYPE", :install)
validate_package_version =
get_option_value(options[:puppetdb_validate_package_version],
......@@ -264,12 +266,45 @@ module PuppetDBExtensions
raise
end
def get_package_version(host, version = nil)
def is_bionic()
return test_config[:os_families].has_key? 'ubuntu1804-64-1'
end
def oldest_supported
# account for special case where bionic doesn't have builds before 5.2.4
return is_bionic ? '5.2.4' : '5.1.1'
end
def get_testing_branch(version)
branch_name = /^((?:\d+\.)*)\d+/.match(version)[1] + 'x'
if branch_name.chars.first.to_i > 5
branch_name = 'master'
end
return branch_name
end
def get_latest_released(version)
cloned = system('git clone https://github.com/puppetlabs/puppetdb.git')
if cloned.nil?
raise 'error cloning puppetdb repo'
end
branch_name = get_testing_branch(version)
stdout, status = Open3.capture2('git', '-C', 'puppetdb', 'describe', '--tags', '--abbrev=0', "origin/#{branch_name}")
if status.exitstatus != 0
raise "error getting most recent tagged release. status: #{status}"
end
return stdout.delete!("\n")
end
def get_package_version(host, version = nil)
if version == 'latest'
return 'latest'
elsif version.nil?
version = PuppetDBExtensions.config[:package_build_version].to_s
# If no version was defined, default to latest.
if version == ''
return 'latest'
end
end
# version can look like:
......@@ -295,8 +330,14 @@ module PuppetDBExtensions
elsif host['platform'].include?('fedora')
version_tag = host['platform'].match(/^fedora-(\d+)/)[1]
"#{version}.fc#{version_tag}"
elsif host['platform'].include?('ubuntu') or host['platform'].include?('debian')
"#{version}puppetlabs1"
elsif host['platform'].include?('ubuntu-16.04')
"#{version}xenial"
elsif host['platform'].include?('ubuntu-18.04')
"#{version}bionic"
elsif host['platform'].include?('debian-8')
"#{version}jessie"