Update webhook

This commit is contained in:
Mo 2022-12-14 19:17:43 +01:00
parent 736d5b2269
commit e27601b26e
4 changed files with 46 additions and 51 deletions

View file

@ -5,7 +5,6 @@ set -l container_volumes_dir ~/volumes/$container_name
set -l repo_dir ~/code/yinghong-massage.de/contact-form
cd $repo_dir
cargo update
cargo build -r
podman-default-create \
@ -14,6 +13,6 @@ podman-default-create \
-v $repo_dir:/volumes/repo:Z,ro \
-v $container_volumes_dir/logs:/volumes/logs:Z \
-w /volumes/repo \
-e CF_CONFIG_FILE=config.json \
-e CF_CONFIG_FILE=config.yaml \
registry.fedoraproject.org/fedora:latest \
target/release/contact-form

View file

@ -1,49 +0,0 @@
#!/usr/bin/env fish
set -l container_name webhook
set -l container_volumes_dir ~/volumes/$container_name
set -l repo_dir ~/code/git-webhook-client
buildah rm builder &>/dev/null
buildah from --pull --name builder registry.fedoraproject.org/fedora:latest
buildah run builder -- dnf upgrade -y
buildah run builder -- dnf install -y git-lfs sqlite-devel npm
buildah run builder -- dnf autoremove -y
buildah run builder -- dnf clean all
buildah run builder -- git lfs install
buildah run builder -- curl -Ls https://github.com/getzola/zola/releases/latest/download/zola-v0.16.1-x86_64-unknown-linux-gnu.tar.gz -o zola.tar.gz
buildah run builder -- tar -xzvf zola.tar.gz
buildah run builder -- rm zola.tar.gz
buildah run builder -- mv zola /usr/local/bin
buildah config \
--workingdir /volumes/src \
-e DATABASE_URL=/volumes/db/db.sqlite \
-e GWC_CONFIG_FILE=/volumes/src/config.json \
--cmd /volumes/src/target/release/git-webhook-client \
builder
if systemctl --user is-enabled container-$container_name
systemctl --user disable --now container-$container_name
end
if podman image exists $container_name
podman rmi $container_name
end
buildah commit --rm builder $container_name
cd $repo_dir
cargo update
cargo build -r
podman-default-create \
$container_name \
--network traefik \
-v $repo_dir:/volumes/src:Z \
-v $container_volumes_dir/db:/volumes/db:Z \
-v $container_volumes_dir/repos:/volumes/repos:Z \
-v ~/volumes/nginx/sites:/volumes/sites:z \
localhost/$container_name:latest

View file

@ -0,0 +1,20 @@
FROM registry.fedoraproject.org/fedora:latest
EXPOSE 80
WORKDIR /volumes/src
ENV DATABASE_URL=/volumes/db/db.sqlite
ENV GWC_CONFIG_FILE=/volumes/src/config.yaml
RUN dnf upgrade -y && \
dnf install -y git-lfs sqlite-devel npm && \
dnf autoremove -y && \
dnf clean all && \
git lfs install && \
curl -Ls https://github.com/getzola/zola/releases/latest/download/zola-v0.16.1-x86_64-unknown-linux-gnu.tar.gz -o zola.tar.gz && \
tar -xzvf zola.tar.gz && \
rm zola.tar.gz && \
mv zola /usr/local/bin
CMD ["target/release/git-webhook-client"]

25
containers/webhook/webhook.fish Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env fish
set -l container_name webhook
set -l container_volumes_dir ~/volumes/$container_name
set -l repo_dir ~/code/git-webhook-client
if systemctl --user is-enabled container-$container_name
systemctl --user disable --now container-$container_name
end
buildah build --layers -t $container_name:latest
cd $repo_dir
cargo update
cargo build -r
podman-default-create \
$container_name \
--network traefik \
-v $repo_dir:/volumes/src:Z \
-v $container_volumes_dir/db:/volumes/db:Z \
-v $container_volumes_dir/repos:/volumes/repos:Z \
-v $container_volumes_dir/logs:/volumes/logs:Z \
-v ~/volumes/nginx/sites:/volumes/sites:z \
localhost/$container_name:latest