Add systemd service + use self containt deployment
This commit is contained in:
@@ -1,17 +1,4 @@
|
||||
LAYERS += meta-security meta-perl meta-dotnet-core meta-testapp
|
||||
|
||||
meta-dotnet-core_repo = https://github.com/RDunkley/meta-dotnet-core.git
|
||||
meta-dotnet-core_branch = pre-honister
|
||||
meta-dotnet-core_commit = ee5e97afee3df14511283b217341ac29eabbf398
|
||||
|
||||
meta-security_repo = git://git.yoctoproject.org/meta-security
|
||||
meta-security_branch = dunfell
|
||||
meta-security_commit = 95a8f38d2e3019c696748468a990b07bcdd74807
|
||||
|
||||
meta-perl_repo = git://git.openembedded.org/meta-openembedded
|
||||
meta-perl_branch = dunfell
|
||||
meta-perl_commit = 86b864a4d8c28185a4a464583fb86f73aa22847a
|
||||
meta-perl_subdirs = meta-perl
|
||||
LAYERS += meta-testapp
|
||||
|
||||
meta-testapp_repo = https://git.bit-engineering.com/pMeter/EMOS-TestApp-Layer.git
|
||||
meta-testapp_branch = master
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
IMAGE_INSTALL += " dotnet-core testapp"
|
||||
|
||||
PREFERRED_VERSION_dotnet-core = "7.0.0"
|
||||
IMAGE_INSTALL += " testapp"
|
||||
|
||||
10
recipes-runtime/testapp/files/testapp.service
Normal file
10
recipes-runtime/testapp/files/testapp.service
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=E.ON ShowCase TestApp
|
||||
Requires=mosquitto.service
|
||||
After=mosquitto.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/TestApp/TestApp
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -4,25 +4,34 @@ LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
PR = "r0"
|
||||
|
||||
SRCREV = "8e7ae2664f2c6a9bf50a67fca54c306f525098a9"
|
||||
SRC_URI = "git://git.bit-engineering.com/pMeter/EMOS-TestApp.git;protocol=https"
|
||||
SRCREV = "685e9f9e1d7e8481b163efe8b3ecbcb70d703324"
|
||||
SRC_URI = "git://git.bit-engineering.com/pMeter/EMOS-TestApp.git;protocol=https \
|
||||
file://testapp.service"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit base
|
||||
inherit base systemd
|
||||
|
||||
SYSTEMD_AUTO_ENABLE = "enable"
|
||||
SYSTEMD_SERVICE_${PN} = "testapp.service"
|
||||
|
||||
RDEPENDS_${PN} = "lttng-ust zlib icu"
|
||||
|
||||
FILES_${PN} += " \
|
||||
/TestApp \
|
||||
${systemd_unitdir}/system/testapp.service \
|
||||
"
|
||||
|
||||
do_compile() {
|
||||
cd ${WORKDIR}/git
|
||||
/usr/bin/dotnet publish -c Release -r linux-arm64 --no-self-contained
|
||||
/usr/bin/dotnet publish -c Release -r linux-arm64 --self-contained -p PublishTrimmed=true
|
||||
}
|
||||
|
||||
do_install() {
|
||||
install -d ${D}/TestApp
|
||||
for file in ${WORKDIR}/git/TestApp/bin/Release/net7.0/linux-arm64/publish/*; do
|
||||
install -m 0755 "$file" ${D}/TestApp
|
||||
install -m 0755 "$file" ${D}/TestApp
|
||||
install -d ${D}/${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/testapp.service ${D}/${systemd_unitdir}/system
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user