From 91679e8c5af32bbfd3508c13dbc911a3300219ac Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Sun, 24 Nov 2024 12:05:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Initial=20`v2.4.0-1`=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9cab3b4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,63 @@ +# Base the container off the latest Alphine Linux base image +FROM alpine:latest + +# Setup the application working directory +WORKDIR /var/svn2git + +# Update the OS +RUN apk update; apk upgrade; apk add --no-cache \ + # Install latest Svn2Git dependencies + ruby \ + subversion \ + perl \ + perl-subversion \ + # Install temporary build tools + autoconf \ + g++ \ + make \ + zlib-dev \ + python3 \ + py-setuptools; + +# Build + install old Git v1.8.3.1 from source +# See: https://github.com/nirvdrum/svn2git/blob/v2.4.0/lib/svn2git/migration.rb#L353 +ENV GIT_VERSION=1.8.3.1 +RUN wget https://github.com/git/git/archive/refs/tags/v$GIT_VERSION.tar.gz; \ + tar -zxf ./v$GIT_VERSION.tar.gz; \ + rm ./v$GIT_VERSION.tar.gz; \ + cd ./git-$GIT_VERSION; \ + make NO_TCLTK=1 configure; \ + ./configure --prefix=/usr; \ + make NO_TCLTK=1 all; \ + make NO_TCLTK=1 install; \ + cd ..; \ + rm -r ./git-$GIT_VERSION/; + +# Remove temporary build tools +RUN apk del --no-cache \ + autoconf \ + g++ \ + make \ + zlib-dev \ + python3 \ + py-setuptools; + +# Install Svn2Git v2.4.0 from RubyGems +RUN gem install svn2git --version 2.4.0; + +# Patch Svn2Git v2.4.0 to support Ruby v3.2+ +# See: https://github.com/nirvdrum/svn2git/pull/333 +ENV SEARCH_STRING=" if File.exists?(File.expand_path(DEFAULT_AUTHORS_FILE))" +ENV REPLACE_STRING=" if File.exist?(File.expand_path(DEFAULT_AUTHORS_FILE))" +RUN sed -i "/^$SEARCH_STRING/s#$SEARCH_STRING#$REPLACE_STRING#" \ + "$(gem which svn2git | rev | cut -c 4- | rev)/migration.rb"; + +# Patch Svn2Git v2.4.0 to not error on '$stdin.gets.chomp' +# See: https://github.com/nirvdrum/svn2git/pull/308 +ENV SEARCH_STRING=" loop { @stdin_queue << \$stdin.gets.chomp }" +ENV REPLACE_STRING=" loop { @stdin_queue << \$stdin.gets }" +RUN sed -i "/^$SEARCH_STRING/s#$SEARCH_STRING#$REPLACE_STRING#" \ + "$(gem which svn2git | rev | cut -c 4- | rev)/migration.rb"; + +# Setup the application entry point +ENTRYPOINT ["svn2git"]