From e700f2e3e77d1c705ceb9df4eeef27abd00cea3f Mon Sep 17 00:00:00 2001 From: David Hollinger Date: Thu, 26 Mar 2020 09:55:33 -0500 Subject: [PATCH] Added several package versions and a yum repo file --- README.md | 47 ++++++++++++++----- build/repos/voxpupuli.repo | 7 +++ build/vanagon/components/app.rb | 3 +- build/vanagon/components/ruby-2.6.rb | 2 +- build/vanagon/platforms/debian-10-amd64.rb | 13 +++++ build/vanagon/platforms/debian-9-amd64.rb | 13 +++++ build/vanagon/platforms/el-7-x86_64.rb | 27 +++++++++++ build/vanagon/platforms/el-8-x86_64.rb | 27 +++++++++++ build/vanagon/platforms/ubuntu-16.04-amd64.rb | 30 ++++++++++++ 9 files changed, 154 insertions(+), 15 deletions(-) create mode 100644 build/repos/voxpupuli.repo create mode 100644 build/vanagon/platforms/debian-10-amd64.rb create mode 100644 build/vanagon/platforms/debian-9-amd64.rb create mode 100644 build/vanagon/platforms/el-7-x86_64.rb create mode 100644 build/vanagon/platforms/el-8-x86_64.rb create mode 100644 build/vanagon/platforms/ubuntu-16.04-amd64.rb diff --git a/README.md b/README.md index aa860cb..0ca475a 100644 --- a/README.md +++ b/README.md @@ -31,22 +31,31 @@ Please see the pre-2.x [documentation](docs/LEGACY.md) if using the old gem-base ### Modern puppet_webhook (>= 2.x) -#### Generic - -This assumes you already have the correct Ruby version installed in the system or via a tool like `rbenv`, `rvm`, or `asdf`. +#### Ubuntu/Debian -1. Download the latest release from the [Releases](https://github.com/voxpupuli/puppet_webhook/releases) page. -2. Extract the tarball into the desired directory: +Add the Voxpupuli GPG key and repository: ```bash -$ tar -xzvf puppet_webhook-latest.tar.gz -C /opt/puppet_webhook +wget -qO - "https://bintray.com/user/downloadSubjectPublicKey?username=voxpupuli" | sudo apt-key add - +echo "deb https://dl.bintray.com/voxpupuli/deb $(grep "VERSION_CODENAME=" /etc/os-release |awk -F= '{print $2}') main" | sudo tee -a /etc/apt/sources.list.d/voxpupuli.list +sudo apt update ``` -3. Enter the install directory and install dependencies: + +Install puppet_webhook ```bash -$ cd /opt/puppet_webhook && bundle install +sudo apt install puppet-webhook ``` -4. Start the process: + +#### RedHat/CentOS/Oracle/Amazon + +Download the voxpupuli.repo file ```bash -$ bundle exec puma config.ru +wget https://raw.githubusercontent.com/voxpupuli/puppet_webhook/master/build/repos/voxpupuli.repo -o voxpupuli.repo +sudo mv voxpupuli.repo /etc/yum.repos.d/voxpupuli.repo +``` + +Install puppet_webhook +``` +yum install puppet-webhook ``` #### Docker Compose @@ -59,11 +68,23 @@ $ wget -O docker-compose.yml https://raw.githubusercontent.com/voxpupuli/puppet_ 2. Edit the image, environment, and volumes keys based on your own needs. 3. run `docker-compose up` -#### What about RPM/DEB/Arch/Helm/ETC +#### Generic -Packages for RPM and Deb systems are in the works, but are taking a bit longer to roll out due to needing to package the dependencies with the application. An Arch package is also on the way. +This assumes you already have the correct Ruby version installed in the system or via a tool like `rbenv`, `rvm`, or `asdf`. -A Helm chart is planned for the future, but not currently in development as we work to iron out any issues with the Webhook API Server after the initial 2.x release. +1. Download the latest release from the [Releases](https://github.com/voxpupuli/puppet_webhook/releases) page. +2. Extract the tarball into the desired directory: +```bash +$ tar -xzvf puppet_webhook-latest.tar.gz -C /opt/puppet_webhook +``` +3. Enter the install directory and install dependencies: +```bash +$ cd /opt/puppet_webhook && bundle install +``` +4. Start the process: +```bash +$ bundle exec puma config.ru +``` ## Configuration diff --git a/build/repos/voxpupuli.repo b/build/repos/voxpupuli.repo new file mode 100644 index 0000000..1f39e88 --- /dev/null +++ b/build/repos/voxpupuli.repo @@ -0,0 +1,7 @@ +[voxpupuli] +name=voxpupuli +baseurl=https://dl.bintray.com/voxpupuli/rpm/el/$releasever/$basearch +gpgcheck=0 +repo_gpgcheck=1 +enabled=1 +gpgkey="https://bintray.com/user/downloadSubjectPublicKey?username=voxpupuli" diff --git a/build/vanagon/components/app.rb b/build/vanagon/components/app.rb index 30c10f9..29dd2b4 100644 --- a/build/vanagon/components/app.rb +++ b/build/vanagon/components/app.rb @@ -4,9 +4,11 @@ pkg.url 'https://github.com/voxpupuli/puppet_webhook' if platform.is_deb? + pkg.build_requires 'sqlite3' pkg.requires 'sqlite3' pkg.requires 'redis-server' elsif platform.is_el? + build_requires 'sqlite-devel' pkg.requires 'sqlite' pkg.requires 'redis' else @@ -14,7 +16,6 @@ end pkg.build_requires 'ruby-2.6' - pkg.build_requires 'sqlite3' pkg.build_requires 'runtime' pkg.environment 'PATH', '/opt/voxpupuli/webhook/bin:$(PATH)' pkg.environment 'GEM_HOME', '/opt/voxpupuli/webhook/lib/ruby/2.6.0' diff --git a/build/vanagon/components/ruby-2.6.rb b/build/vanagon/components/ruby-2.6.rb index 026c003..ffd97a9 100644 --- a/build/vanagon/components/ruby-2.6.rb +++ b/build/vanagon/components/ruby-2.6.rb @@ -13,7 +13,7 @@ pkg.environment 'optflags', '-O2' - special_flags = " --prefix=#{ruby_dir} --with-opt-dir=#{settings[:prefix]} --enable-dtrace --with-baseruby=#{host_ruby}" + special_flags = " --prefix=#{ruby_dir} --with-opt-dir=#{settings[:prefix]} --with-baseruby=#{host_ruby} --with-compress-debug-sections=no" pkg.configure do [ diff --git a/build/vanagon/platforms/debian-10-amd64.rb b/build/vanagon/platforms/debian-10-amd64.rb new file mode 100644 index 0000000..6bd8890 --- /dev/null +++ b/build/vanagon/platforms/debian-10-amd64.rb @@ -0,0 +1,13 @@ +platform "debian-9-amd64" do |plat| + plat.servicedir "/lib/systemd/system" + plat.defaultdir "/etc/default" + plat.servicetype "systemd" + plat.codename "buster" + + plat.docker_image 'voxpupuli/pkg_builder:buster' + plat.docker_run_args '--privileged=true' + + plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends build-essential devscripts make quilt pkg-config debhelper rsync fakeroot" + plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends " + plat.output_dir File.join("deb", plat.get_codename) +end diff --git a/build/vanagon/platforms/debian-9-amd64.rb b/build/vanagon/platforms/debian-9-amd64.rb new file mode 100644 index 0000000..5500a84 --- /dev/null +++ b/build/vanagon/platforms/debian-9-amd64.rb @@ -0,0 +1,13 @@ +platform "debian-9-amd64" do |plat| + plat.servicedir "/lib/systemd/system" + plat.defaultdir "/etc/default" + plat.servicetype "systemd" + plat.codename "stretch" + + plat.docker_image 'voxpupuli/pkg_builder:stretch' + plat.docker_run_args '--privileged=true' + + plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends build-essential devscripts make quilt pkg-config debhelper rsync fakeroot" + plat.install_build_dependencies_with "DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends " + plat.output_dir File.join("deb", plat.get_codename) +end diff --git a/build/vanagon/platforms/el-7-x86_64.rb b/build/vanagon/platforms/el-7-x86_64.rb new file mode 100644 index 0000000..2cbd188 --- /dev/null +++ b/build/vanagon/platforms/el-7-x86_64.rb @@ -0,0 +1,27 @@ +platform "el-7-x86_64" do |plat| + plat.servicedir "/usr/lib/systemd/system" + plat.defaultdir "/etc/sysconfig" + plat.servicetype "systemd" + + plat.docker_image "voxpupuli/pkg_builder:el7" + plat.docker_run_args "--privileged=true" + + plat.provision_with "yum update -y; yum groupinstall --assumeyes 'Development Tools'; yum install --assumeyes autoconf automake createrepo devscripts fakeroot rsync gcc make rpmdevtools rpm-libs yum-utils rpm-sign" + plat.install_build_dependencies_with "yum install --assumeyes" + + packages = %w[ + bzip2-devel + readline-devel + make + pkgconfig + zlib-devel + pl-cmake + pl-gcc + systemtap-sdt-devel + java-1.8.0-openjdk-headless + ] + + plat.provision_with "yum install --assumeyes #{packages.join(' ')}" + + plat.output_dir File.join('el', 'PC1') +end diff --git a/build/vanagon/platforms/el-8-x86_64.rb b/build/vanagon/platforms/el-8-x86_64.rb new file mode 100644 index 0000000..be2c1e9 --- /dev/null +++ b/build/vanagon/platforms/el-8-x86_64.rb @@ -0,0 +1,27 @@ +platform "el-8-x86_64" do |plat| + plat.servicedir "/usr/lib/systemd/system" + plat.defaultdir "/etc/sysconfig" + plat.servicetype "systemd" + + plat.docker_image "voxpupuli/pkg_builder:el8" + plat.docker_run_args "--privileged=true" + + plat.provision_with "yum update -y; yum groupinstall --assumeyes 'Development Tools'; yum install --assumeyes autoconf automake createrepo rsync gcc make rpmdevtools rpm-libs yum-utils rpm-sign" + plat.install_build_dependencies_with "yum install --assumeyes" + + packages = %w[ + bzip2-devel + readline-devel + make + pkgconfig + zlib-devel + pl-cmake + pl-gcc + systemtap-sdt-devel + java-1.8.0-openjdk-headless + ] + + plat.provision_with "yum install --assumeyes #{packages.join(' ')}" + + plat.output_dir File.join('el', 'PC1') +end diff --git a/build/vanagon/platforms/ubuntu-16.04-amd64.rb b/build/vanagon/platforms/ubuntu-16.04-amd64.rb new file mode 100644 index 0000000..b74c6d9 --- /dev/null +++ b/build/vanagon/platforms/ubuntu-16.04-amd64.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +platform 'ubuntu-16.04-amd64' do |plat| + plat.defaultdir '/etc/default' + plat.servicetype 'systemd' + plat.codename 'xenial' + plat.servicedir '/etc/systemd/system' + + plat.docker_image 'voxpupuli/pkg_builder:xenial' + plat.docker_run_args '--privileged=true' + + plat.provision_with 'export DEBIAN_FRONTEND=noninteractive; apt-get update -qq; apt-get install -qy --no-install-recommends build-essential devscripts make quilt pkg-config debhelper rsync fakeroot' + plat.install_build_dependencies_with 'DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends --allow-unauthenticated' + + packages = [ + 'libbz2-dev', + 'libreadline-dev', + 'make', + 'pkg-config', + 'zlib1g-dev', + 'pl-cmake', + 'pl-gcc', + 'systemtap-sdt-dev', + 'openjdk-8-jre-headless' + ] + + plat.provision_with "export DEBIAN_FRONTEND=noninteractive; apt-get install -qy --no-install-recommends #{packages.join(' ')}" + + plat.output_dir File.join('deb', plat.get_codename, 'PC1') +end