Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
58347f5
Switch builds to native GitHub actions
bastelfreak Jul 25, 2025
1c76c92
feat: build upon ruby and java matrix
rwaffen Aug 18, 2025
48ad765
fix: move bundle install task after ruby installation
rwaffen Aug 18, 2025
c7bbcd7
fix: test if ref changes build
rwaffen Aug 18, 2025
5c6d1b7
fix: ref does not help
rwaffen Aug 18, 2025
6935a08
fix: bring back lein
rwaffen Aug 18, 2025
b289d84
fix: use packaging gem from github registry
rwaffen Aug 18, 2025
761aee8
fix: update packaging gem source to use GitHub repository again
rwaffen Aug 18, 2025
12ef082
fix: update packaging gem source to use specific git URL and tag
rwaffen Aug 18, 2025
4bd1195
revert: back to original gem installation
rwaffen Aug 18, 2025
97bde34
fix: enhance command output visibility during ezbake installation and…
rwaffen Aug 18, 2025
db0ffdc
fix: update build process to include bundle install before lein install
rwaffen Aug 18, 2025
db55bac
fix: remove redundant bundle commands from CI workflow and add bundle…
rwaffen Aug 18, 2025
1f20605
fix: add command to list bundled gems during openvox-server build pro…
rwaffen Aug 18, 2025
3996b71
fix: replace ls command with bundle info for better gem information d…
rwaffen Aug 18, 2025
534c570
fix: update bundle info command to specify packaging for clearer outp…
rwaffen Aug 18, 2025
b6d2464
fix: update build process to set environment variables for local builds
rwaffen Aug 18, 2025
196d54f
fix: move packaging gem definitions to their own group for better org…
rwaffen Aug 18, 2025
7b54a9c
fix: update build environment to use ubuntu-22.04 and streamline buil…
rwaffen Aug 18, 2025
48e5a67
fix: add comments to clarify RPM version compatibility in build job
rwaffen Aug 18, 2025
9160518
CI: Dont build packages in a Ruby matrix
bastelfreak Aug 20, 2025
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
38 changes: 32 additions & 6 deletions .github/workflows/pr-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,48 @@ jobs:
run: rake spec

build:
name: build openvox-server
runs-on: ubuntu-24.04
name: build openvox-server - Java ${{ matrix.java }} Ruby ${{ matrix.ruby }}
# https://rpm.org/releases/4.18.2
# https://github.com/actions/runner-images?tab=readme-ov-file
# rpm in 22 is version 4.17.x and allows our macros
# rpm in 24 is version 4.18.x and does not allow our rpmversion macro
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java: ['11', '17', '21']
ruby: ['3.3']
steps:
- name: checkout repo
uses: actions/checkout@v5
with:
submodules: recursive
- name: setup ruby

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Setup Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
# uses the Dockerfile to build openvox-server in a container
# the container hardcodes the java version

- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
lein: latest

- name: build it
run: bundle exec rake vox:build
env:
EZBAKE_ALLOW_UNREPRODUCIBLE_BUILDS: true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we would merge this now, the package builds for PRs would work, but we would break the release workflow. That still uses the docker container and the vox:build rake task. And it pulls ezbake from main. I would like to:

  • refactor the rake task so we have something like vox:buildindocker and vox:buildnative
  • update the ezbake repo handling so it relies on tags/git refs
  • do a bit more work in ezbake to reduce depdencies to the packaging gem or get rid of it. I think we only need it to render erb templates

EZBAKE_BRANCH: no-bundle-on-local-build
EZBAKE_NODEPLOY: true
EZBAKE_REPO: https://github.com/rwaffen/ezbake
LEIN_PROFILES: ezbake

clojure-linting:
name: Clojure Linting
Expand Down
19 changes: 0 additions & 19 deletions Dockerfile

This file was deleted.

8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ def location_for(place, fake_version = nil)
end

gem 'public_suffix', '>= 4.0.7', '< 7'
# 1.0.0 is the first OpenVoxProject release
gem 'packaging', '~> 1.0', github: 'OpenVoxProject/packaging'
gem 'rake', :group => [:development, :test]

group :test do
Expand All @@ -29,6 +27,12 @@ group :test do
gem 'docker-api', '>=1.31.0', '< 3'
end

# cut from ezbake
group :packaging do
gem 'packaging', '~> 1.0', github: 'OpenVoxProject/packaging'
gem 'fpm', '~> 1.16'
end

group :release, optional: true do
# usually we pin to ~> 2.1, but some of the EoL beaker 6 dependencies require ancient faraday versions
# it's all a huge pain and the beaker setup needs to be reworked
Expand Down
87 changes: 25 additions & 62 deletions tasks/build.rake
Original file line number Diff line number Diff line change
Expand Up @@ -18,71 +18,34 @@ rpm_platforms = ENV['RPM_PLATFORMS'] || 'el-7,el-8,el-9,el-10,sles-15,amazon-202
@debs = deb_platforms.split(',').map{ |p| "base-#{p.split('-').join}-i386.cow" }.join(' ')
@rpms = rpm_platforms.split(',').map{ |p| "pl-#{p}-x86_64" }.join(' ')

def image_exists
!`docker images -q #{@image}`.strip.empty?
end

def container_exists
!`docker container ls --all --filter 'name=#{@container}' --format json`.strip.empty?
end

def teardown
if container_exists
puts "Stopping #{@container}"
run_command("docker stop #{@container}", silent: false, print_command: true)
run_command("docker rm #{@container}", silent: false, print_command: true)
end
end

def start_container(ezbake_dir)
run_command("docker run -d --name #{@container} -v .:/code -v #{ezbake_dir}:/ezbake #{@image} /bin/sh -c 'tail -f /dev/null'", silent: false, print_command: true)
end

def run(cmd)
run_command("docker exec #{@container} /bin/bash --login -c '#{cmd}'", silent: false, print_command: true)
end

namespace :vox do
desc 'Build openvox-server packages with Docker'
task :build, [:tag] do |_, args|
begin
#abort 'You must provide a tag.' if args[:tag].nil? || args[:tag].empty?
if args[:tag].nil? || args[:tag].empty?
puts 'running build with current branch'
else
puts "running build on #{args[:tag]}"
run_command("git fetch --tags && git checkout #{args[:tag]}")
end

# If the Dockerfile has changed since this was last built,
# delete all containers and do `docker rmi ezbake-builder`
unless image_exists
puts "Building ezbake-builder image"
run_command("docker build -t ezbake-builder .", silent: false, print_command: true)
end

puts "Checking out ezbake"
tmp = Dir.mktmpdir("ezbake")
ezbake_dir = "#{tmp}/ezbake"
ezbake_repo = ENV.fetch('EZBAKE_REPO', 'https://github.com/openvoxproject/ezbake')
ezbake_branch = ENV['EZBAKE_BRANCH'] || 'main'
run_command("git clone -b #{ezbake_branch} #{ezbake_repo} #{ezbake_dir}", silent: false, print_command: true)

puts "Starting container"
teardown if container_exists
start_container(ezbake_dir)

puts "Installing ezbake from source"
run("cd /ezbake && lein install")

puts "Building openvox-server"
run("cd /code && rm -rf ruby && rm -rf output && bundle install --without test && lein install")
run("cd /code && COW=\"#{@debs}\" MOCK=\"#{@rpms}\" GEM_SOURCE='https://rubygems.org' EZBAKE_ALLOW_UNREPRODUCIBLE_BUILDS=true EZBAKE_NODEPLOY=true LEIN_PROFILES=ezbake lein with-profile user,ezbake,provided,internal ezbake local-build")
run_command("sudo chown -R $USER output", print_command: true)
Dir.glob('output/**/*i386*').each { |f| FileUtils.rm_rf(f) }
Dir.glob('output/puppetserver-*.tar.gz').each { |f| FileUtils.mv(f, f.sub('puppetserver','openvox-server'))}
ensure
teardown
if args[:tag].nil? || args[:tag].empty?
puts 'running build with current branch'
else
puts "running build on #{args[:tag]}"
run_command("git fetch --tags && git checkout #{args[:tag]}")
end

puts "Checking out ezbake"
tmp = Dir.mktmpdir("ezbake")
ezbake_dir = "#{tmp}/ezbake"
ezbake_repo = ENV.fetch('EZBAKE_REPO', 'https://github.com/openvoxproject/ezbake')
ezbake_branch = ENV['EZBAKE_BRANCH'] || 'main'
run_command("git clone -b #{ezbake_branch} #{ezbake_repo} #{ezbake_dir}", silent: false, print_command: true)

# prepare git foo for packaging gem (????)
run_command("git config --global user.email '[email protected]'; git config --global user.name 'Your Name'")

puts "Installing ezbake from source"
run_command("cd #{ezbake_dir} && lein install", silent: false, print_command: true)

puts "Building openvox-server"
run_command("rm -rf ruby && rm -rf output && bundle install --without test && lein install", silent: false, print_command: true)
run_command("COW=\"#{@debs}\" MOCK=\"#{@rpms}\" lein with-profile user,ezbake,provided ezbake local-build", silent: false, print_command: true)
run_command("sudo chown -R $USER output", print_command: true)
Dir.glob('output/**/*i386*').each { |f| FileUtils.rm_rf(f) }
Dir.glob('output/puppetserver-*.tar.gz').each { |f| FileUtils.mv(f, f.sub('puppetserver','openvox-server'))}
end
end