Compare commits

...

10 commits

5 changed files with 31 additions and 16 deletions

View file

@ -1,3 +1,4 @@
*
!.git
!akkoma
!prod.exs

6
.gitmodules vendored
View file

@ -1,6 +0,0 @@
[submodule "src"]
path = src
url = https://akkoma.dev/AkkomaGang/akkoma.git
[submodule "akkoma"]
path = akkoma
url = https://akkoma.dev/AkkomaGang/akkoma.git

View file

@ -3,14 +3,22 @@ FROM registry.nrd.li/nrdli/akkoma-base:${AKKOMA_COMMIT}
ENV PROD_SECRET_FILE=/config/prod.secret.exs
ADD akkoma /opt/akkoma/
ADD prod.exs /opt/akkoma/config/prod.exs
USER root
RUN mkdir /config && touch /config/prod.secret.exs && chown -R 1000:1000 /opt/akkoma && chown -R 1000:1000 /config
RUN mkdir -p "$(dirname "${PROD_SECRET_FILE}")" && \
touch "${PROD_SECRET_FILE}" && \
chown -R 1000:1000 "$(dirname "${PROD_SECRET_FILE}")" && \
rm -rf /opt/akkoma && \
cd /opt && \
git clone https://akkoma.dev/AkkomaGang/akkoma.git akkoma && \
chown -R akkoma: /opt/akkoma
ADD --chown=akkoma:akkoma prod.exs /opt/akkoma/config/prod.exs
USER akkoma
RUN mix deps.get && \
mix compile && \
mix pleroma.frontend install pleroma-fe --ref stable && \
mix pleroma.frontend install admin-fe --ref stable
WORKDIR /opt/akkoma
RUN git fetch --all && git checkout $AKKOMA_COMMIT
RUN mix local.hex --force && mix local.rebar --force
RUN mix deps.get
RUN mix compile
RUN mix pleroma.frontend install pleroma-fe --ref stable
RUN mix pleroma.frontend install admin-fe --ref stable

1
akkoma

@ -1 +0,0 @@
Subproject commit 9d7c877de049303a4d4d8f5ecaac7da94ca59ebb

View file

@ -1,18 +1,31 @@
#!/bin/bash
set -Eeuxo pipefail
AKKOMA_COMMIT=$(cd akkoma; git rev-parse HEAD)
AKKOMA_COMMIT="9d7c877de049303a4d4d8f5ecaac7da94ca59ebb"
LOCAL_COMMIT=$(git rev-parse HEAD)
AKKOMA_BASE_IMAGE="registry.nrd.li/nrdli/akkoma-base:${AKKOMA_COMMIT}"
AKKOMA_FINAL_IMAGE="registry.nrd.li/nrdli/akkoma:${LOCAL_COMMIT}"
# clone akkoma source code
if [ -d akkoma ]; then
rm -rf akkoma
fi
git clone https://akkoma.dev/AkkomaGang/akkoma.git akkoma
pushd akkoma
git fetch --all
git checkout "${AKKOMA_COMMIT}"
if [ "$(git rev-parse HEAD)" != "${AKKOMA_COMMIT}" ]; then
exit 1
fi
# build and store base image
docker build \
-t "${AKKOMA_BASE_IMAGE}" \
.
docker push "${AKKOMA_BASE_IMAGE}"
popd
# run install steps for akkoma
docker build \
-t "${AKKOMA_FINAL_IMAGE}" \
--build-arg "AKKOMA_COMMIT=${AKKOMA_COMMIT}" \