You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
2.0 KiB
Bash
58 lines
2.0 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# set -x
|
|
|
|
if [ $# -ne 1 ]
|
|
then
|
|
printf 'usage: %s GIT_TAG\n' "$0" >&2
|
|
printf 'expected 1 argument, got %s\n' "$#" >&2
|
|
exit 1
|
|
fi
|
|
|
|
tagname="$1"
|
|
|
|
ctr1=$(buildah from "docker://node:18-alpine")
|
|
|
|
buildah run "$ctr1" -- apk update
|
|
buildah run "$ctr1" -- apk upgrade
|
|
buildah run "$ctr1" -- apk add imagemagick
|
|
|
|
rm -rf _container/
|
|
mkdir _container/
|
|
(
|
|
cd _container
|
|
echo '*' > .gitignore
|
|
git clone --bare --branch main --depth 1 https://codeberg.org/stele-climbing/stele1.git
|
|
git --git-dir=stele1.git/ archive main | tar xf - javascript/
|
|
git clone --bare --branch main --depth 1 https://codeberg.org/stele-climbing/stele1-montserrat-editor.git
|
|
git --git-dir=stele1-montserrat-editor.git/ archive --prefix=montserrat/ $tagname | tar xf -
|
|
)
|
|
|
|
buildah add "$ctr1" ./_container/javascript/datatypes/ /usr/local/share/stele1-datatypes/
|
|
buildah add "$ctr1" ./_container/javascript/filesystem/ /usr/local/share/stele1-filesystem/
|
|
buildah add "$ctr1" ./_container/montserrat/ /usr/local/share/stele1-montserrat/
|
|
|
|
buildah add "$ctr1" ./client/keys.json /usr/local/share/stele1-montserrat/client/
|
|
|
|
buildah config --workingdir /usr/local/share/stele1-filesystem/ "$ctr1"
|
|
buildah run "$ctr1" -- npm install /usr/local/share/stele1-datatypes/
|
|
|
|
buildah config --workingdir /usr/local/share/stele1-montserrat/ "$ctr1"
|
|
buildah run "$ctr1" -- npm install /usr/local/share/stele1-datatypes/
|
|
buildah run "$ctr1" -- npm install /usr/local/share/stele1-filesystem/
|
|
buildah run "$ctr1" -- npm install --global
|
|
|
|
buildah config --entrypoint='["montserrat-editor", "-address", "0.0.0.0"]' "$ctr1"
|
|
buildah config --cmd '["/srv/project.stele1.d/"]' "$ctr1"
|
|
buildah config --port 8001 "$ctr1"
|
|
|
|
buildah commit "$ctr1" "stele1/montserrat-editor:$tagname"
|
|
|
|
buildah push \
|
|
localhost/stele1/montserrat-editor:${tagname} \
|
|
docker-archive:montserrat-editor_${tagname}_docker.tar:stele1/montserrat-editor:${tagname}
|
|
|
|
scp \
|
|
montserrat-editor_${tagname}_docker.tar \
|
|
stele1.steleclimbing.org:/srv/stele1.steleclimbing.org/tmp/montserrat-editor_${tagname}_docker.tar
|