2023-08-13 03:14:28 +00:00
FROM alpine:3.17 AS build
RUN apk add --no-cache build-base musl-dev git autoconf make texinfo gnutls-dev ncurses-dev gawk
FROM build AS build-emacs
2023-08-25 05:37:25 +00:00
ARG EMACS_VERSION = emacs-29.1
RUN git clone --depth 1 --branch $EMACS_VERSION https://git.savannah.gnu.org/git/emacs.git /root/emacs
2023-08-13 03:14:28 +00:00
WORKDIR /root/emacs
RUN mkdir /root/dist
RUN ./autogen.sh
RUN ./configure --prefix /usr --without-x --without-sound
RUN make
RUN make DESTDIR = "/root/dist" install
2023-07-13 03:14:22 +00:00
2023-08-13 03:14:28 +00:00
FROM build AS build-org-mode
2023-08-25 06:55:01 +00:00
ARG ORG_VERSION = 7bdec435ff5d86220d13c431e799c5ed44a57da1
2023-08-13 03:14:28 +00:00
COPY --from= build-emacs /root/dist/ /
RUN mkdir /root/dist
2023-08-25 05:37:25 +00:00
# Savannah does not allow fetching specific revisions, so we're going to have to put unnecessary load on their server by cloning main and then checking out the revision we want.
RUN git clone https://git.savannah.gnu.org/git/emacs/org-mode.git /root/org-mode && git -C /root/org-mode checkout $ORG_VERSION
# RUN mkdir /root/org-mode && git -C /root/org-mode init --initial-branch=main && git -C /root/org-mode remote add origin https://git.savannah.gnu.org/git/emacs/org-mode.git && git -C /root/org-mode fetch origin $ORG_VERSION && git -C /root/org-mode checkout FETCH_HEAD
2023-08-13 03:14:28 +00:00
WORKDIR /root/org-mode
RUN make compile
RUN make DESTDIR = "/root/dist" install
2023-09-06 19:54:25 +00:00
FROM rustlang/rust:nightly-alpine3.17 AS tester
2023-09-01 00:19:28 +00:00
ENV LANG = en_US.UTF-8
2023-08-13 03:14:28 +00:00
RUN apk add --no-cache musl-dev ncurses gnutls
2023-07-14 05:59:51 +00:00
RUN cargo install --locked --no-default-features --features ci-autoclean cargo-cache
2023-08-13 03:14:28 +00:00
COPY --from= build-emacs /root/dist/ /
COPY --from= build-org-mode /root/dist/ /
2023-08-27 21:29:55 +00:00
ENTRYPOINT [ "cargo" , "test" ]
2023-09-06 19:54:25 +00:00
FROM build as foreign-document-gather
2023-09-06 23:49:04 +00:00
ARG HOWARD_ABRAMS_DOT_FILES_VERSION = 1b54fe75d74670dc7bcbb6b01ea560c45528c628
ARG HOWARD_ABRAMS_DOT_FILES_PATH = /foreign_documents/howardabrams/dot-files
2023-09-07 00:56:36 +00:00
ARG HOWARD_ABRAMS_DOT_FILES_REPO = https://github.com/howardabrams/dot-files.git
2023-09-06 19:54:25 +00:00
RUN mkdir /foreign_documents
2023-09-07 00:56:36 +00:00
RUN mkdir -p $HOWARD_ABRAMS_DOT_FILES_PATH && git -C $HOWARD_ABRAMS_DOT_FILES_PATH init --initial-branch= main && git -C $HOWARD_ABRAMS_DOT_FILES_PATH remote add origin $HOWARD_ABRAMS_DOT_FILES_REPO && git -C $HOWARD_ABRAMS_DOT_FILES_PATH fetch origin $HOWARD_ABRAMS_DOT_FILES_VERSION && git -C $HOWARD_ABRAMS_DOT_FILES_PATH checkout FETCH_HEAD
ARG HOWARD_ABRAMS_HAMACS_VERSION = da51188cc195d41882175d412fe40a8bc5730c5c
ARG HOWARD_ABRAMS_HAMACS_PATH = /foreign_documents/howardabrams/hamacs
ARG HOWARD_ABRAMS_HAMACS_REPO = https://github.com/howardabrams/hamacs.git
RUN mkdir -p $HOWARD_ABRAMS_HAMACS_PATH && git -C $HOWARD_ABRAMS_HAMACS_PATH init --initial-branch= main && git -C $HOWARD_ABRAMS_HAMACS_PATH remote add origin $HOWARD_ABRAMS_HAMACS_REPO && git -C $HOWARD_ABRAMS_HAMACS_PATH fetch origin $HOWARD_ABRAMS_HAMACS_VERSION && git -C $HOWARD_ABRAMS_HAMACS_PATH checkout FETCH_HEAD
2023-09-06 19:54:25 +00:00
FROM tester as foreign-document-test
2023-09-06 21:02:56 +00:00
RUN apk add --no-cache bash coreutils
2023-09-06 19:54:25 +00:00
RUN mkdir /foreign_documents
2023-09-06 21:02:56 +00:00
COPY --from= build-org-mode /root/org-mode /foreign_documents/org-mode
2023-09-06 21:06:17 +00:00
COPY --from= build-emacs /root/emacs /foreign_documents/emacs
2023-09-07 00:56:36 +00:00
COPY --from= foreign-document-gather /foreign_documents/howardabrams /foreign_documents/howardabrams
2023-09-06 20:03:59 +00:00
COPY foreign_document_test_entrypoint.sh /entrypoint.sh
2023-09-06 19:54:25 +00:00
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]