Skip to content
This repository was archived by the owner on Jan 29, 2022. It is now read-only.

Added several package versions and a yum repo file #123

Merged
merged 2 commits into from
Mar 26, 2020
Merged
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
48 changes: 34 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 $(awk -F= '/VERSION_CODENAME=/ {print $2}' /etc/os-release) 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
Expand All @@ -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

Expand Down Expand Up @@ -146,4 +167,3 @@ Default: []
type: Boolean
description: Allow uppercase within the name of the module or environment passed to the API.
default: true

7 changes: 7 additions & 0 deletions build/repos/voxpupuli.repo
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 2 additions & 1 deletion build/vanagon/components/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
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
raise("Plaform #{platform.name} is not yet supported")
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'
Expand Down
2 changes: 1 addition & 1 deletion build/vanagon/components/ruby-2.6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

pkg.environment 'optflags', '-O2'

special_flags = " --prefix=#{ruby_dir} --with-opt-dir=#{settings[:prefix]} --enable-dtrace --with-baseruby=#{host_ruby}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DTrace is old and, in the case of Debian, not included in the system at all. Not sure if it's really needed for this anyway.

special_flags = " --prefix=#{ruby_dir} --with-opt-dir=#{settings[:prefix]} --with-baseruby=#{host_ruby} --with-compress-debug-sections=no"

pkg.configure do
[
Expand Down
15 changes: 15 additions & 0 deletions build/vanagon/platforms/debian-10-amd64.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

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
15 changes: 15 additions & 0 deletions build/vanagon/platforms/debian-9-amd64.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

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
29 changes: 29 additions & 0 deletions build/vanagon/platforms/el-7-x86_64.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is java needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and the below) are both leftovers from when I copied the files from the vanagon puppet_runtime repo. Planned cleanup as part of the next few releases.

]

plat.provision_with "yum install --assumeyes #{packages.join(' ')}"

plat.output_dir File.join('el', 'PC1')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PC1 looks like the old Puppet 4 configs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above ^

end
29 changes: 29 additions & 0 deletions build/vanagon/platforms/el-8-x86_64.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

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
30 changes: 30 additions & 0 deletions build/vanagon/platforms/ubuntu-16.04-amd64.rb
Original file line number Diff line number Diff line change
@@ -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