-
Notifications
You must be signed in to change notification settings - Fork 9
Switch builds to native GitHub actions #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bastelfreak
wants to merge
21
commits into
OpenVoxProject:main
Choose a base branch
from
bastelfreak:build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 1c76c92
feat: build upon ruby and java matrix
rwaffen 48ad765
fix: move bundle install task after ruby installation
rwaffen c7bbcd7
fix: test if ref changes build
rwaffen 5c6d1b7
fix: ref does not help
rwaffen 6935a08
fix: bring back lein
rwaffen b289d84
fix: use packaging gem from github registry
rwaffen 761aee8
fix: update packaging gem source to use GitHub repository again
rwaffen 12ef082
fix: update packaging gem source to use specific git URL and tag
rwaffen 4bd1195
revert: back to original gem installation
rwaffen 97bde34
fix: enhance command output visibility during ezbake installation and…
rwaffen db0ffdc
fix: update build process to include bundle install before lein install
rwaffen db55bac
fix: remove redundant bundle commands from CI workflow and add bundle…
rwaffen 1f20605
fix: add command to list bundled gems during openvox-server build pro…
rwaffen 3996b71
fix: replace ls command with bundle info for better gem information d…
rwaffen 534c570
fix: update bundle info command to specify packaging for clearer outp…
rwaffen b6d2464
fix: update build process to set environment variables for local builds
rwaffen 196d54f
fix: move packaging gem definitions to their own group for better org…
rwaffen 7b54a9c
fix: update build environment to use ubuntu-22.04 and streamline buil…
rwaffen 48e5a67
fix: add comments to clarify RPM version compatibility in build job
rwaffen 9160518
CI: Dont build packages in a Ruby matrix
bastelfreak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| 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 | ||
|
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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:buildrake task. And it pulls ezbake from main. I would like to:vox:buildindockerandvox:buildnative