Skip to content

Commit 6caf200

Browse files
committed
Update builders to use ruby 3.0
1 parent 13ac571 commit 6caf200

File tree

13 files changed

+77
-20
lines changed

13 files changed

+77
-20
lines changed

.github/workflows/verify.yml

+61-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jobs:
2828
# The job checkout structure is:
2929
# .
3030
# ├── metasploit-omnibus
31-
# └── metasploit-framework (Only if ARM builds)
31+
# └── metasploit-framework (Only if ARM/Windows builds)
32+
# For windows we additionally move metasploit-framework into the omnibus local cache
3233
#
3334
docker_arm:
3435
runs-on: ${{ matrix.os }}
@@ -208,12 +209,10 @@ jobs:
208209
# If required, change reported architecture in new program environment and set personality flags
209210
if [ ! -z "${LINUX32}" ] ; then
210211
echo 'setting linux32'
211-
architecturePrefix='linux32'
212+
/bin/bash -x -c "docker run --rm --volume $(pwd):$(pwd) --workdir $(pwd) --user jenkins ${DOCKER_IMAGE} linux32 /bin/bash -l -c 'cd metasploit-omnibus && ARCH=x86_64 make'"
212213
else
213-
echo 'no arch prefix supplied'
214-
architecturePrefix=''
214+
/bin/bash -x -c "docker run --rm --volume $(pwd):$(pwd) --workdir $(pwd) --user jenkins ${DOCKER_IMAGE} /bin/bash -l -c 'cd metasploit-omnibus && make'"
215215
fi
216-
/bin/bash -x -c "docker run --rm --volume $(pwd):$(pwd) --workdir $(pwd) --user jenkins ${DOCKER_IMAGE} ${architecturePrefix} /bin/bash -l -c 'cd metasploit-omnibus && make'"
217216
env:
218217
LINUX32: ${{ matrix.docker.linux32 }}
219218

@@ -227,13 +226,14 @@ jobs:
227226
os:
228227
- macos-11
229228
ruby:
230-
- 2.6
229+
- 3.0.6
231230

232231
name: ${{ matrix.os }}
233232
steps:
234233
- name: Checkout omnibus
235234
uses: actions/checkout@v4
236235
with:
236+
submodules: true
237237
path: metasploit-omnibus
238238

239239
- name: Setup Ruby
@@ -244,6 +244,7 @@ jobs:
244244
ruby-version: ${{ matrix.ruby }}
245245
bundler-cache: true
246246
cache-version: 4
247+
working-directory: metasploit-omnibus
247248

248249
- name: Run omnibus
249250
run: |
@@ -254,3 +255,57 @@ jobs:
254255
255256
cd metasploit-omnibus
256257
make
258+
259+
windows:
260+
runs-on: ${{ matrix.os }}
261+
timeout-minutes: 180
262+
263+
strategy:
264+
fail-fast: false
265+
matrix:
266+
os:
267+
- windows-2019
268+
ruby:
269+
- 3.0.6
270+
271+
name: ${{ matrix.os }}
272+
steps:
273+
- name: Checkout omnibus
274+
uses: actions/checkout@v4
275+
with:
276+
submodules: true
277+
path: metasploit-omnibus
278+
279+
- name: Setup Ruby
280+
env:
281+
BUNDLE_FORCE_RUBY_PLATFORM: true
282+
uses: ruby/setup-ruby@v1
283+
with:
284+
ruby-version: ${{ matrix.ruby }}
285+
bundler-cache: false
286+
cache-version: 4
287+
working-directory: metasploit-omnibus
288+
# Github actions with Ruby requires Bundler 2.2.18+
289+
# https://github.com/ruby/setup-ruby/tree/d2b39ad0b52eca07d23f3aa14fdf2a3fcc1f411c#windows
290+
bundler: 2.2.33
291+
292+
# Checkout framework
293+
- name: Checkout metasploit-framework code
294+
uses: actions/checkout@v4
295+
with:
296+
repository: rapid7/metasploit-framework
297+
path: metasploit-framework
298+
299+
- name: Extract xz files
300+
run: |
301+
cd metasploit-omnibus
302+
xz -d local/cache/*.xz
303+
304+
- name: Run omnibus
305+
run: |
306+
# mkdir -p metasploit-omnibus/local/cache/git_cache/c
307+
# mv metasploit-framework/ metasploit-omnibus/local/cache/git_cache/c
308+
# dir metasploit-omnibus/local/cache/git_cache/c
309+
# dir metasploit-omnibus/local/cache/git_cache/c/metasploit-framework
310+
cd metasploit-omnibus
311+
make

.ruby-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.5
1+
3.0.6

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ GEM
4040
aws-sigv4 (1.4.0)
4141
aws-eventstream (~> 1, >= 1.0.2)
4242
byebug (11.1.3)
43-
chef-cleanroom (1.0.4)
43+
chef-cleanroom (1.0.5)
4444
chef-config (16.16.13)
4545
addressable
4646
chef-utils (= 16.16.13)

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.PHONY: all
44
all: certs/ca-certificates.crt
5-
export SSL_CERT_FILE=${PWD}/certs/ca-certificates.crt
5+
# export SSL_CERT_FILE=${PWD}/certs/ca-certificates.crt
66

77
# Ensure consistent bundler versions
88
gem install bundler -v 2.2.3
@@ -11,8 +11,10 @@ all: certs/ca-certificates.crt
1111
bundle install
1212
bundle binstubs --all
1313

14+
gem install win32-process -v 0.9.0
15+
1416
# build the metasploit-framework package
15-
bin/omnibus build metasploit-framework
17+
ruby bin/omnibus build metasploit-framework
1618

1719
certs/ca-certificates.crt:
1820
mkdir -p certs

docker/centos6-x64/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ RUN su jenkins -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
102102
curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable'
103103

104104
RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'"
105-
RUN su jenkins -c "/bin/bash -l -c 'rvm install 2.6.5'"
105+
RUN su jenkins -c "/bin/bash -l -c 'rvm install 3.0.6'"
106106
RUN su jenkins -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'"
107107

108108
# pre-load the omnibus dependencies
109109
RUN su jenkins -c "/bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omnibus.git && \
110-
cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus'"
110+
cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus'"

docker/debian-aarch64/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ RUN command curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \
4848
command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \
4949
curl -L -sSL https://get.rvm.io | bash -s stable
5050
RUN /bin/bash -l -c "rvm requirements"
51-
RUN /bin/bash -l -c "rvm install 2.6.5"
51+
RUN /bin/bash -l -c "rvm install 3.0.6"
5252
RUN /bin/bash -l -c "gem install bundler -v 2.2.3 --no-document"
5353

5454
# pre-load the omnibus dependencies

docker/debian-armv7/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ RUN command curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \
3636
command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \
3737
curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable
3838
RUN /bin/bash -l -c "rvm requirements"
39-
RUN /bin/bash -l -c "rvm install 2.6.5"
39+
RUN /bin/bash -l -c "rvm install 3.0.6"
4040
RUN /bin/bash -l -c "gem install bundler -v 2.2.4 --no-document"
4141

4242
# pre-load the omnibus dependencies

docker/fedora30-x64/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ RUN su jenkins -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
7373
curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable'
7474

7575
RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'"
76-
RUN su jenkins -c "/bin/bash -l -c 'rvm install 2.6.5'"
76+
RUN su jenkins -c "/bin/bash -l -c 'rvm install 3.0.6'"
7777
RUN su jenkins -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'"
7878
# pre-load the omnibus dependencies
7979
RUN su jenkins -c "/bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omnibus.git && \

docker/kali109-x64/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ RUN mkdir -p /tmp/updated_certs && \
6363
rm -rf /tmp/updated_certs
6464

6565
RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'"
66-
RUN su jenkins -c "/bin/bash -l -c 'rvm install 2.6.5'"
66+
RUN su jenkins -c "/bin/bash -l -c 'rvm install 3.0.6'"
6767
RUN su jenkins -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'"
6868

6969
# pre-load the omnibus dependencies

docker/ubuntu1204-x64/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ RUN su jenkins -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
4646
curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable '
4747

4848
RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'"
49-
RUN su jenkins -c "/bin/bash -l -c 'rvm install 2.6.5'"
49+
RUN su jenkins -c "/bin/bash -l -c 'rvm install 3.0.6'"
5050
RUN su jenkins -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'"
5151

5252
# pre-load the omnibus dependencies

docker/ubuntu1204-x86/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ RUN su jenkins -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
4646
curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable '
4747

4848
RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'"
49-
RUN su jenkins -c "linux32 /bin/bash -l -c 'rvm install 2.6.5'"
49+
RUN su jenkins -c "linux32 /bin/bash -l -c 'rvm install 3.0.6'"
5050
RUN su jenkins -c "linux32 /bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'"
5151

5252
# pre-load the omnibus dependencies

docker/ubuntu1804-x64/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN su jenkins -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
4444
curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable'
4545

4646
RUN su jenkins -c "/bin/bash -l -c 'rvm requirements'"
47-
RUN su jenkins -c "/bin/bash -l -c 'rvm install 2.6.5'"
47+
RUN su jenkins -c "/bin/bash -l -c 'rvm install 3.0.6'"
4848
RUN su jenkins -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'"
4949

5050
# pre-load the omnibus dependencies

packer/configure_ami.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ su $BUILD_USER -c 'command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
5959
curl -L -sSL https://raw.githubusercontent.com/rvm/rvm/1.29.12/binscripts/rvm-installer | bash -s stable'
6060

6161
su $BUILD_USER -c "/bin/bash -l -c 'rvm requirements'"
62-
su $BUILD_USER -c "/bin/bash -l -c 'rvm install 2.6.5'"
62+
su $BUILD_USER -c "/bin/bash -l -c 'rvm install 3.0.6'"
6363
su $BUILD_USER -c "/bin/bash -l -c 'gem install bundler -v 2.2.3 --no-document'"
6464
su $BUILD_USER -c "/bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omnibus.git && \
6565
cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus'"

0 commit comments

Comments
 (0)