-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch to tedge-configuration-plugin
Signed-off-by: Reuben Miller <[email protected]>
- Loading branch information
1 parent
85b1e73
commit 86f9d2c
Showing
38 changed files
with
280 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
configuration/init/systemd/tedge-configuration-plugin.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=thin-edge.io configuration management | ||
After=syslog.target network.target mosquitto.service | ||
|
||
[Service] | ||
ExecStart=/usr/bin/tedge-configuration-plugin | ||
Restart=on-failure | ||
RestartPreventExitStatus=255 | ||
RestartSec=5 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
69 changes: 69 additions & 0 deletions
69
configuration/package_manifests/nfpm.tedge-configuration-plugin.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# yaml-language-server: $schema=https://nfpm.goreleaser.com/static/schema.json | ||
--- | ||
name: tedge-configuration-plugin | ||
description: | | ||
thin-edge.io configuration management | ||
arch: "${PKG_ARCH}" | ||
platform: "linux" | ||
version: "${GIT_SEMVER}" | ||
release: "${RELEASE}" | ||
section: misc | ||
priority: "optional" | ||
maintainer: "thin-edge.io team <[email protected]>" | ||
vendor: "thin-edge.io" | ||
homepage: "https://thin-edge.io" | ||
license: "Apache-2.0" | ||
|
||
depends: | ||
- tedge | ||
replaces: | ||
- c8y_configuration_plugin | ||
- c8y-configuration-plugin | ||
conflicts: | ||
- c8y_configuration_plugin (<= 0.8.1) | ||
- c8y-configuration-plugin | ||
|
||
deb: | ||
fields: | ||
Vcs-Browser: ${CI_PROJECT_URL} | ||
Vcs-Git: ${CI_PROJECT_URL} | ||
compression: xz | ||
breaks: | ||
- c8y_configuration_plugin (<= 0.8.1) | ||
- c8y-configuration-plugin | ||
|
||
contents: | ||
# service definitions | ||
- src: ./configuration/init/systemd/tedge-configuration-plugin.service | ||
dst: /lib/systemd/system/ | ||
file_info: | ||
mode: 0644 | ||
packager: deb | ||
|
||
- src: ./configuration/init/systemd/tedge-configuration-plugin.service | ||
dst: /lib/systemd/system/ | ||
file_info: | ||
mode: 0644 | ||
packager: rpm | ||
|
||
overrides: | ||
apk: | ||
scripts: | ||
preinstall: configuration/package_scripts/_generated/tedge-configuration-plugin/apk/preinst | ||
postinstall: configuration/package_scripts/_generated/tedge-configuration-plugin/apk/postinst | ||
preremove: configuration/package_scripts/_generated/tedge-configuration-plugin/apk/prerm | ||
postremove: configuration/package_scripts/_generated/tedge-configuration-plugin/apk/postrm | ||
|
||
rpm: | ||
scripts: | ||
preinstall: configuration/package_scripts/_generated/tedge-configuration-plugin/rpm/preinst | ||
postinstall: configuration/package_scripts/_generated/tedge-configuration-plugin/rpm/postinst | ||
preremove: configuration/package_scripts/_generated/tedge-configuration-plugin/rpm/prerm | ||
postremove: configuration/package_scripts/_generated/tedge-configuration-plugin/rpm/postrm | ||
|
||
deb: | ||
scripts: | ||
preinstall: configuration/package_scripts/_generated/tedge-configuration-plugin/deb/preinst | ||
postinstall: configuration/package_scripts/_generated/tedge-configuration-plugin/deb/postinst | ||
preremove: configuration/package_scripts/_generated/tedge-configuration-plugin/deb/prerm | ||
postremove: configuration/package_scripts/_generated/tedge-configuration-plugin/deb/postrm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
configuration/package_scripts/_generated/tedge-configuration-plugin/apk/postinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
set -e | ||
|
3 changes: 3 additions & 0 deletions
3
configuration/package_scripts/_generated/tedge-configuration-plugin/apk/postrm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
set -e | ||
|
2 changes: 2 additions & 0 deletions
2
configuration/package_scripts/_generated/tedge-configuration-plugin/apk/preinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
set -e |
2 changes: 2 additions & 0 deletions
2
configuration/package_scripts/_generated/tedge-configuration-plugin/apk/prerm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
set -e |
32 changes: 32 additions & 0 deletions
32
configuration/package_scripts/_generated/tedge-configuration-plugin/deb/postinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
set -e | ||
# Automatically added by thin-edge.io | ||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then | ||
# This will only remove masks created by d-s-h on package removal. | ||
deb-systemd-helper unmask tedge-configuration-plugin.service >/dev/null || true | ||
|
||
# was-enabled defaults to true, so new installations run enable. | ||
if deb-systemd-helper --quiet was-enabled tedge-configuration-plugin.service; then | ||
# Enables the unit on first installation, creates new | ||
# symlinks on upgrades if the unit file has changed. | ||
deb-systemd-helper enable tedge-configuration-plugin.service >/dev/null || true | ||
else | ||
# Update the statefile to add new symlinks (if any), which need to be | ||
# cleaned up on purge. Also remove old symlinks. | ||
deb-systemd-helper update-state tedge-configuration-plugin.service >/dev/null || true | ||
fi | ||
fi | ||
# End automatically added section | ||
# Automatically added by thin-edge.io | ||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then | ||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
if [ -n "$2" ]; then | ||
_dh_action=restart | ||
else | ||
_dh_action=start | ||
fi | ||
deb-systemd-invoke $_dh_action tedge-configuration-plugin.service >/dev/null || true | ||
fi | ||
fi | ||
# End automatically added section |
21 changes: 21 additions & 0 deletions
21
configuration/package_scripts/_generated/tedge-configuration-plugin/deb/postrm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
set -e | ||
# Automatically added by thin-edge.io | ||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
fi | ||
# End automatically added section | ||
# Automatically added by thin-edge.io | ||
if [ "$1" = "remove" ]; then | ||
if [ -x "/usr/bin/deb-systemd-helper" ]; then | ||
deb-systemd-helper mask tedge-configuration-plugin.service >/dev/null || true | ||
fi | ||
fi | ||
|
||
if [ "$1" = "purge" ]; then | ||
if [ -x "/usr/bin/deb-systemd-helper" ]; then | ||
deb-systemd-helper purge tedge-configuration-plugin.service >/dev/null || true | ||
deb-systemd-helper unmask tedge-configuration-plugin.service >/dev/null || true | ||
fi | ||
fi | ||
# End automatically added section |
2 changes: 2 additions & 0 deletions
2
configuration/package_scripts/_generated/tedge-configuration-plugin/deb/preinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
set -e |
7 changes: 7 additions & 0 deletions
7
configuration/package_scripts/_generated/tedge-configuration-plugin/deb/prerm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
set -e | ||
# Automatically added by thin-edge.io | ||
if [ -d /run/systemd/system ] && [ "$1" = remove ]; then | ||
deb-systemd-invoke stop tedge-configuration-plugin.service >/dev/null || true | ||
fi | ||
# End automatically added section |
19 changes: 19 additions & 0 deletions
19
configuration/package_scripts/_generated/tedge-configuration-plugin/rpm/postinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
set -e | ||
# Automatically added by thin-edge.io | ||
if [ $1 -eq 1 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then | ||
# Initial installation | ||
/usr/lib/systemd/systemd-update-helper install-system-units tedge-configuration-plugin.service || : | ||
fi | ||
# End automatically added section | ||
# Automatically added by thin-edge.io | ||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
if [ $1 -eq 2 ]; then | ||
_dh_action=restart | ||
else | ||
_dh_action=start | ||
fi | ||
systemctl $_dh_action tedge-configuration-plugin.service >/dev/null || true | ||
fi | ||
# End automatically added section |
14 changes: 14 additions & 0 deletions
14
configuration/package_scripts/_generated/tedge-configuration-plugin/rpm/postrm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
set -e | ||
# Automatically added by thin-edge.io | ||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
fi | ||
# End automatically added section | ||
# Automatically added by thin-edge.io | ||
if [ $1 -ge 1 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then | ||
# Package upgrade, not uninstall | ||
/usr/lib/systemd/systemd-update-helper mark-restart-system-units tedge-configuration-plugin.service || : | ||
fi | ||
|
||
# End automatically added section |
2 changes: 2 additions & 0 deletions
2
configuration/package_scripts/_generated/tedge-configuration-plugin/rpm/preinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
set -e |
8 changes: 8 additions & 0 deletions
8
configuration/package_scripts/_generated/tedge-configuration-plugin/rpm/prerm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
set -e | ||
# Automatically added by thin-edge.io | ||
if [ $1 -eq 0 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then | ||
# Package removal, not upgrade | ||
/usr/lib/systemd/systemd-update-helper remove-system-units tedge-configuration-plugin.service || : | ||
fi | ||
# End automatically added section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.