From aef10ffbe257119c43fa43f8cea452885d37cb86 Mon Sep 17 00:00:00 2001 From: Ada Date: Wed, 1 May 2024 21:02:04 +0200 Subject: [PATCH] WIP --- .goreleaser.yaml | 25 ++++++++----------------- deployement/goreleaser/postremove.sh | 1 + deployement/goreleaser/preinstall.sh | 8 ++++++++ deployement/goreleaser/preremove.sh | 1 + docker/docker-compose.yaml | 1 - 5 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 deployement/goreleaser/postremove.sh create mode 100644 deployement/goreleaser/preinstall.sh create mode 100644 deployement/goreleaser/preremove.sh diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a077d81..69c6f52 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,15 +1,6 @@ -# This is an example .goreleaser.yml file with some sensible defaults. -# Make sure to check the documentation at https://goreleaser.com - -# The lines below are called `modelines`. See `:help modeline` -# Feel free to remove those if you don't want/need to use them. -# yaml-language-server: $schema=https://goreleaser.com/static/schema.json -# vim: set ts=2 sw=2 tw=0 fo=cnqoj - gitea_urls: api: https://git.gnous.eu/api/v1 download: https://git.gnous.eu - # set to true if you use a self-signed certificate skip_tls_verify: false before: @@ -32,14 +23,10 @@ builds: archives: - format: tar.gz - # this name template makes the OS and Arch compatible with the results of `uname`. - name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end }} + format_overrides: + - + goos: windows + format: zip nfpms: - @@ -65,6 +52,10 @@ nfpms: dst: /etc/plakken/env - src: plakken.service dst: /usr/lib/systemd/system/plakken.service + scripts: + preinstall: "deployement/goreleaser/preinstall.sh" + preremove: "deployement/goreleaser/preremove.sh" + postremove: "deployement/goreleaser/postremove.sh" checksum: algorithm: sha256 diff --git a/deployement/goreleaser/postremove.sh b/deployement/goreleaser/postremove.sh new file mode 100644 index 0000000..d07f4fc --- /dev/null +++ b/deployement/goreleaser/postremove.sh @@ -0,0 +1 @@ +userdel -r plakken \ No newline at end of file diff --git a/deployement/goreleaser/preinstall.sh b/deployement/goreleaser/preinstall.sh new file mode 100644 index 0000000..6e2c87f --- /dev/null +++ b/deployement/goreleaser/preinstall.sh @@ -0,0 +1,8 @@ +if ! getent passwd plakken > /dev/null; then + useradd -r -d /var/lib/plakken -s /sbin/nologin -U plakken +fi +if ! test -d /var/lib/plakken; then + mkdir -p /var/lib/plakken + chmod 0750 /var/lib/plakken + chown -R plakken:plakken /var/lib/plakken +fi diff --git a/deployement/goreleaser/preremove.sh b/deployement/goreleaser/preremove.sh new file mode 100644 index 0000000..95f5448 --- /dev/null +++ b/deployement/goreleaser/preremove.sh @@ -0,0 +1 @@ +systemctl stop plakken \ No newline at end of file diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 1dc30b0..ddc6279 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -20,7 +20,6 @@ services: - "3000:3000" environment: - PLAKKEN_REDIS_ADDRESS=redis:6379 - - POSTGRES_PASSWORD=gitea - PLAKKEN_REDIS_DB=0 - PLAKKEN_URL_LENGTH=5 depends_on: