diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 18dff02..aebc714 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -73,16 +73,4 @@ jobs: - name: Run omnibus run: | - cat <>build_docker.sh - #!/bin/bash --login - - # install omnibus' dependencies - bundle install - bundle binstubs --all - - # build the metasploit-framework package - bin/omnibus build metasploit-framework - EOF - - chmod +x ./build_docker.sh - /bin/bash -x -c "docker run --rm --volume $(pwd):$(pwd) --workdir $(pwd) --user jenkins --entrypoint '' ${BUILD_TAG} /bin/bash -l -c './build_docker.sh'" + /bin/bash -x -c "docker run --rm --volume $(pwd):$(pwd) --workdir $(pwd) --user jenkins --entrypoint '' ${BUILD_TAG} /bin/bash -l -c 'make'" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..17a0709 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +.DEFAULT_GOAL := all + +.PHONY: all +all: + # install omnibus' dependencies + bundle install + bundle binstubs --all + + # build the metasploit-framework package + bin/omnibus build metasploit-framework + +.PHONY: clean +clean: + bin/omnibus clean metasploit-framework diff --git a/docker/debian-aarch64/Dockerfile b/docker/debian-aarch64/Dockerfile index 1cbd1aa..328d371 100644 --- a/docker/debian-aarch64/Dockerfile +++ b/docker/debian-aarch64/Dockerfile @@ -56,9 +56,10 @@ RUN /bin/bash -l -c 'cd ~/ && git clone https://github.com/rapid7/metasploit-omn cd ~/metasploit-omnibus && bundle install && bundle binstubs --all && cd ~/ && rm -fr metasploit-omnibus' ENV JENKINS_HOME /home/jenkins -RUN useradd -d "$JENKINS_HOME" -u 1001 -m -s /bin/sh jenkins +RUN id jenkins || useradd -d "$JENKINS_HOME" -u 1001 -m -s /bin/sh jenkins RUN cp ~/.gitconfig "$JENKINS_HOME" RUN chown -R jenkins "$JENKINS_HOME" +RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers RUN mkdir -p /var/cache/omnibus RUN mkdir -p /opt/metasploit-framework diff --git a/docker/debian-armv7/Dockerfile b/docker/debian-armv7/Dockerfile index edecc2c..892bd91 100644 --- a/docker/debian-armv7/Dockerfile +++ b/docker/debian-armv7/Dockerfile @@ -48,6 +48,7 @@ ENV JENKINS_HOME /home/jenkins RUN useradd -d "$JENKINS_HOME" -u 1001 -m -s /bin/sh jenkins RUN cp ~/.gitconfig "$JENKINS_HOME" RUN chown -R jenkins "$JENKINS_HOME" +RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers RUN mkdir -p /var/cache/omnibus RUN mkdir -p /opt/metasploit-framework