Update Webhook

This commit is contained in:
Mo 2022-08-20 21:04:10 +02:00
parent 48cad5fc3f
commit b9abc94a81

View file

@ -7,18 +7,24 @@ set -l repo_dir ~/code/webhook
buildah rm compiler &>/dev/null
buildah from --pull --name compiler docker.io/library/golang:alpine
buildah copy compiler $repo_dir /src
buildah config --workingdir /src -e GOOS=linux -e GOARCH=amd64 compiler
buildah config --workingdir /src -e GOOS=linux -e GOARCH=amd64 -e CGO_ENABLED=0 compiler
buildah run compiler -- go get -u
buildah run compiler -- go build -o /main
buildah rm builder &>/dev/null
buildah from --name builder docker.io/library/alpine:latest
buildah from --pull --name builder docker.io/library/node:slim
buildah copy --from compiler builder /main /webhook/main
buildah rm compiler
buildah copy builder $container_volumes_dir/bin/* /usr/local/bin
buildah copy builder $repo_dir/config.json /webhook
buildah copy builder $HOME/bin/hugo /usr/local/bin/hugo
buildah run builder -- apk --no-cache --update add git git-lfs
buildah run builder -- apt update
buildah run builder -- apt dist-upgrade -y
buildah run builder -- apt install -y git-lfs
buildah run builder -- apt clean
buildah run builder -- git lfs install
buildah config --workingdir /webhook -e GIN_MODE=release -e GIN_PORT=80 builder
buildah config --cmd /webhook/main builder
@ -33,7 +39,6 @@ end
buildah commit --rm builder $container_name
podman-default-create \
$container_name \
--network traefik \