#!/bin/bash set -Eeuxo pipefail LOCAL_COMMIT="$(git rev-parse HEAD)" 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://git.keganmyers.com/nrd.li/akkoma.git akkoma pushd akkoma git checkout stable git pull AKKOMA_COMMIT="$(git rev-parse HEAD)" AKKOMA_BASE_IMAGE="registry.nrd.li/nrdli/akkoma-base:${AKKOMA_COMMIT}" # build and store base image docker build \ -t "${AKKOMA_BASE_IMAGE}" \ . docker push "${AKKOMA_BASE_IMAGE}" popd chown -R 1000:1000 ./akkoma # run install steps for akkoma docker build \ -t "${AKKOMA_FINAL_IMAGE}" \ --build-arg "AKKOMA_COMMIT=${AKKOMA_COMMIT}" \ . docker push "${AKKOMA_FINAL_IMAGE}"