taskwarrior/scripts/review-dockerfile
Tomas Babej 7d5c82e3e7 meta: Expand review build target to allow specifying PR reference for libshared
This allows us to conveniently review PRs for libshared using

    make LIBPR=62 review

and taskwarrior PRs that require libshared PRs as well using

    make PR=2189 LIBPR=63 review
2021-09-04 12:13:25 -04:00

46 lines
1.3 KiB
Text

# Dockerfile for containers to perform PR review in
# Use with make as follows: make PR=1234 review
FROM centos:8
RUN dnf update -y
RUN yum install epel-release -y
RUN dnf install python38 git gcc gcc-c++ cmake make gnutls-devel libuuid-devel libfaketime sudo man -y
RUN useradd warrior
RUN echo warrior ALL=NOPASSWD:ALL > /etc/sudoers.d/warrior
USER warrior
WORKDIR /home/warrior/
# Setup taskwarrior
# The purpose is to speed up subsequent re-installs due to Docker layer caching
RUN git clone https://github.com/GothenburgBitFactory/taskwarrior.git
WORKDIR /home/warrior/taskwarrior/
RUN git submodule init
RUN git submodule update
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN sudo make install
# Use specified PR's branch, if provided
ARG PR
RUN if [[ ! -z $PR ]]; then \
git fetch origin refs/pull/${PR}/head:pr-${PR}; \
git checkout pr-${PR}; fi
# Use specified libshared PR's branch, if provided
ARG LIBPR
WORKDIR /home/warrior/taskwarrior/src/libshared/
RUN if [[ ! -z $LIBPR ]]; then \
git fetch origin refs/pull/${LIBPR}/head:libpr-${LIBPR}; \
git checkout libpr-${LIBPR}; fi
# Install taskwarrior
WORKDIR /home/warrior/taskwarrior/
RUN cmake -DCMAKE_BUILD_TYPE=debug .
RUN make -j8
RUN sudo make install
WORKDIR /home/warrior
RUN task rc.confirmation=0 _ids || : # Generate default taskrc