From b29e9107223a3a06c01ec18e96c02ab87e40dc3d Mon Sep 17 00:00:00 2001 From: Fabio Ribeiro Date: Sat, 21 Oct 2023 21:00:15 +0200 Subject: [PATCH] in-dev --- .goreleaser.yaml | 6 ++++++ env/debian/movies.conf | 14 ++++++++++++++ env/debian/movies.service | 14 ++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 env/debian/movies.conf create mode 100644 env/debian/movies.service diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 14bdc0b..bd64464 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -46,6 +46,12 @@ nfpms: license: MIT formats: - deb + contents: + - src: "env/debian/movies.service" + dst: "/lib/systemd/system/movies.service" + - src: "env/debian/movies.conf" + dst: "/etc/default/movies" + type: config scripts: preinstall: "env/debian/pre-install.sh" preremove: "env/debian/pre-remove.sh" diff --git a/env/debian/movies.conf b/env/debian/movies.conf new file mode 100644 index 0000000..ce106b0 --- /dev/null +++ b/env/debian/movies.conf @@ -0,0 +1,14 @@ +# --------------------------------- +# Movies configuration file +# --------------------------------- +# +# The commented-out settings shown in this file represent the default values. +# +# This file is read when movies service start +# +# ----------------------------------------------------------------------------- +# Datastore +# ----------------------------------------------------------------------------- + +# Database path configuration +MOVIES_DB_PATH="/var/lib/movies-demo" diff --git a/env/debian/movies.service b/env/debian/movies.service new file mode 100644 index 0000000..f580443 --- /dev/null +++ b/env/debian/movies.service @@ -0,0 +1,14 @@ +[Unit] +Description=Movies-demo - manages movie collection throught API +Documentation="https://github.com/faabiosr/go-movies-demo" + +[Service] +EnvironmentFile=/etc/default/movies +ExecStart=/usr/local/bin/movies +Restart=on-failure +User=www-data +Group=www-data +KillSignal=SIGINT + +[Install] +WantedBy=multi-user.target