Skip to content

Commit 8eeba3a

Browse files
authored
Merge pull request #279 from OpenVoxProject/fix-build-use-ruby-image
Use Ruby 4 for builder image and cache it
2 parents 648b1cc + 73d9030 commit 8eeba3a

5 files changed

Lines changed: 37 additions & 18 deletions

File tree

.github/workflows/main.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,26 @@ jobs:
135135
- name: setup ruby
136136
uses: ruby/setup-ruby@v1
137137
with:
138-
ruby-version: '3.2'
138+
ruby-version: '4.0'
139139
bundler-cache: true
140+
- id: docker-cache
141+
uses: actions/cache/restore@v4
142+
with:
143+
path: /tmp/ezbake-builder.tar
144+
key: docker-ezbake-${{ hashFiles('Dockerfile') }}
145+
- name: load or build docker image
146+
run: |
147+
if [[ -f /tmp/ezbake-builder.tar ]]; then
148+
docker load -i /tmp/ezbake-builder.tar
149+
else
150+
docker build -t ezbake-builder .
151+
docker save ezbake-builder -o /tmp/ezbake-builder.tar
152+
fi
153+
- uses: actions/cache/save@v4
154+
if: always() && steps.docker-cache.outputs.cache-hit != 'true'
155+
with:
156+
path: /tmp/ezbake-builder.tar
157+
key: docker-ezbake-${{ hashFiles('Dockerfile') }}
140158
- name: build it
141159
run: bundle exec rake vox:build
142160
- name: get version

Dockerfile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
FROM almalinux:9
1+
FROM ruby:4.0-bookworm
22

3-
WORKDIR /
3+
RUN apt-get update && \
4+
apt-get install -y --no-install-recommends \
5+
openjdk-17-jdk-headless \
6+
rpm \
7+
&& rm -rf /var/lib/apt/lists/*
48

5-
RUN dnf install -y --enablerepo=crb vim wget git rpm-build java-17-openjdk java-17-openjdk-devel libyaml-devel zlib zlib-devel gcc-c++ patch readline readline-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison sqlite-devel
6-
RUN wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
7-
RUN chmod a+x lein
8-
RUN mv lein /usr/local/bin
9-
RUN wget -q https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer -O- | bash
10-
RUN /bin/bash --login -c 'rbenv install 3.2.9'
11-
RUN /bin/bash --login -c 'rbenv global 3.2.9'
12-
RUN git config --global user.email "openvox@voxpupuli.org"
13-
RUN git config --global user.name "Vox Pupuli"
14-
RUN git config --global --add safe.directory /code
9+
RUN wget -q https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -O /usr/local/bin/lein && \
10+
chmod a+x /usr/local/bin/lein
1511

16-
CMD ["tail -f /dev/null"]
12+
RUN git config --global user.email "openvox@voxpupuli.org" && \
13+
git config --global user.name "Vox Pupuli" && \
14+
git config --global --add safe.directory /code
15+
16+
CMD ["tail", "-f", "/dev/null"]

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def location_for(place)
2323
end
2424

2525
gem 'openfact'
26+
gem 'ostruct'
2627
gem 'rake'
2728
gem 'packaging', '~> 1.0', github: 'OpenVoxProject/packaging'
2829

project.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110

111111
:url "https://github.com/openvoxproject/openvoxdb/"
112112

113-
:min-lein-version "2.7.1"
113+
:min-lein-version "2.12.0"
114114

115115
;; Abort when version ranges or version conflicts are detected in
116116
;; dependencies. Also supports :warn to simply emit warnings.
@@ -371,7 +371,7 @@
371371
;; via the release_scripts/sync_ezbake_dep.rb script.
372372
[org.openvoxproject/puppetdb "9.0.0-SNAPSHOT"]]
373373
:name "puppetdb"
374-
:plugins [[org.openvoxproject/lein-ezbake ~(or (System/getenv "EZBAKE_VERSION") "2.7.4")]]}
374+
:plugins [[org.openvoxproject/lein-ezbake ~(or (System/getenv "EZBAKE_VERSION") "2.7.6")]]}
375375
:ezbake-fips {:dependencies ^:replace [[org.bouncycastle/bcpkix-fips]
376376
[org.bouncycastle/bc-fips]
377377
[org.bouncycastle/bctls-fips]
@@ -381,7 +381,7 @@
381381
[org.openvoxproject/puppetdb "9.0.0-SNAPSHOT"]]
382382
:name "puppetdb"
383383
:uberjar-exclusions [#"^org/bouncycastle/.*"]
384-
:plugins [[org.openvoxproject/lein-ezbake ~(or (System/getenv "EZBAKE_VERSION") "2.7.4")]]}
384+
:plugins [[org.openvoxproject/lein-ezbake ~(or (System/getenv "EZBAKE_VERSION") "2.7.6")]]}
385385
:testutils {:source-paths ^:replace ["test"]
386386
:resource-paths ^:replace []
387387
;; Something else may need adjustment, but

rakelib/build.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ module Vox
164164
ezbake_version_var = ENV['EZBAKE_VERSION'] ? "EZBAKE_VERSION=#{ENV['EZBAKE_VERSION']}" : ""
165165

166166
puts 'Building openvoxdb'
167-
@runner.exec('cd /code && rm -rf ruby output && bundle install --without test && lein install')
167+
@runner.exec('cd /code && rm -rf ruby output && bundle config set without test && bundle install && lein install')
168168

169169
unless @debs.empty? && @nonfips_rpms.empty?
170170
@runner.exec(

0 commit comments

Comments
 (0)