2023-07-23 03:49:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -Eeuxo pipefail
|
|
|
|
|
2023-07-23 14:07:47 +00:00
|
|
|
AKKOMA_COMMIT="9d7c877de049303a4d4d8f5ecaac7da94ca59ebb"
|
2023-07-23 08:00:54 +00:00
|
|
|
LOCAL_COMMIT=$(git rev-parse HEAD)
|
2023-07-23 03:49:40 +00:00
|
|
|
AKKOMA_BASE_IMAGE="registry.nrd.li/nrdli/akkoma-base:${AKKOMA_COMMIT}"
|
2023-07-23 08:00:54 +00:00
|
|
|
AKKOMA_FINAL_IMAGE="registry.nrd.li/nrdli/akkoma:${LOCAL_COMMIT}"
|
2023-07-23 03:49:40 +00:00
|
|
|
|
2023-07-23 18:20:16 +00:00
|
|
|
# clone akkoma source code
|
|
|
|
if [ -d akkoma ]; then
|
|
|
|
rm -rf akkoma
|
2023-07-23 14:07:47 +00:00
|
|
|
fi
|
2023-07-23 18:20:16 +00:00
|
|
|
git clone https://akkoma.dev/AkkomaGang/akkoma.git akkoma
|
2023-07-23 08:17:35 +00:00
|
|
|
pushd akkoma
|
2023-07-23 14:07:47 +00:00
|
|
|
git fetch --all
|
|
|
|
git checkout "${AKKOMA_COMMIT}"
|
|
|
|
if [ "$(git rev-parse HEAD)" != "${AKKOMA_COMMIT}" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-07-23 18:20:16 +00:00
|
|
|
|
|
|
|
# build and store base image
|
2023-07-23 03:49:40 +00:00
|
|
|
docker build \
|
|
|
|
-t "${AKKOMA_BASE_IMAGE}" \
|
|
|
|
.
|
|
|
|
docker push "${AKKOMA_BASE_IMAGE}"
|
|
|
|
|
2023-07-23 18:20:16 +00:00
|
|
|
# run install steps for akkoma
|
2023-07-23 03:49:40 +00:00
|
|
|
docker build \
|
|
|
|
-t "${AKKOMA_FINAL_IMAGE}" \
|
|
|
|
--build-arg "AKKOMA_COMMIT=${AKKOMA_COMMIT}" \
|
|
|
|
.
|
|
|
|
docker push "${AKKOMA_FINAL_IMAGE}"
|