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