Skip to content

Commit

Permalink
Merge pull request #1 from farshidtz/snap-v2-pathfix
Browse files Browse the repository at this point in the history
fix(snap): correct the executable and config paths
  • Loading branch information
marcpfuller authored Nov 12, 2021
2 parents 3c27557 + bb09994 commit 2f01496
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: edgex-device-rfid-llrp-go
name: edgex-device-rfid-llrp
base: core18
adopt-info: version
license: Apache-2.0
Expand All @@ -7,8 +7,8 @@ title: EdgeX Device LLRP Micro Service
description: |
The EdgeX Device LLRP service for connecting LLRP based RFID devices to EdgeX.
Initially the daemon in the snap is disabled - a device profile must be
provisioned externally with core-metadata or provided to device-rfid-llrp-go inside
"$SNAP_DATA/config/device-rfid-llrp-go/res" before starting.
provisioned externally with core-metadata or provided to device-rfid-llrp inside
"$SNAP_DATA/config/device-rfid-llrp/res" before starting.
# TODO: add armhf when the project supports this
architectures:
Expand All @@ -26,21 +26,21 @@ slots:
interface: content
content: edgex-secretstore-token
source:
write: [$SNAP_DATA/device-rfid-llrp-go]
write: [$SNAP_DATA/device-rfid-llrp]

apps:
device-rfid-llrp-go:
device-rfid-llrp:
adapter: full
command: bin/device-rfid-llrp-go $CONFIG_PRO_ARG $CONF_ARG $REGISTRY_ARG
command: bin/device-rfid-llrp $CONFIG_PRO_ARG $CONF_ARG $REGISTRY_ARG
command-chain:
- bin/startup-env-var.sh
environment:
CONFIG_PRO_ARG: "--cp=consul.http://localhost:8500"
CONF_ARG: "--confdir=$SNAP_DATA/config/device-rfid-llrp-go/res"
CONF_ARG: "--confdir=$SNAP_DATA/config/device-rfid-llrp/res"
REGISTRY_ARG: "--registry"
DEVICE_PROFILESDIR: "$SNAP_DATA/config/device-rfid-llrp-go/res/profiles"
DEVICE_DEVICESDIR: "$SNAP_DATA/config/device-rfid-llrp-go/res/devices"
SECRETSTORE_TOKENFILE: $SNAP_DATA/device-rfid-llrp-go/secrets-token.json
DEVICE_PROFILESDIR: "$SNAP_DATA/config/device-rfid-llrp/res/profiles"
# DEVICE_DEVICESDIR: "$SNAP_DATA/config/device-rfid-llrp/res/devices"
SECRETSTORE_TOKENFILE: $SNAP_DATA/device-rfid-llrp/secrets-token.json
daemon: simple
passthrough:
install-mode: disable
Expand All @@ -50,7 +50,7 @@ plugs:
device-config:
interface: content
content: device-config
target: $SNAP_DATA/config/device-rfid-llrp-go/res
target: $SNAP_DATA/config/device-rfid-llrp/res

parts:
version:
Expand All @@ -75,7 +75,7 @@ parts:
install -DT ./cmd/configure/configure "$SNAPCRAFT_PART_INSTALL/snap/hooks/configure"
install -DT ./cmd/install/install "$SNAPCRAFT_PART_INSTALL/snap/hooks/install"
device-rfid-llrp-go:
device-rfid-llrp:
source: .
plugin: make
build-packages: [git, libzmq3-dev, pkg-config]
Expand All @@ -96,23 +96,24 @@ parts:
go mod tidy
make build
# copy device-rfid-llrp-go and rename to device-rfid-llrp
install -DT "./cmd/device-rfid-llrp-go" "$SNAPCRAFT_PART_INSTALL/bin/device-rfid-llrp"
install -d "$SNAPCRAFT_PART_INSTALL/config/device-rfid-llrp-go/res/"
install -d "$SNAPCRAFT_PART_INSTALL/config/device-rfid-llrp/res/"
install -DT "./cmd/res/configuration.toml" \
"$SNAPCRAFT_PART_INSTALL/config/device-rfid-llrp-go/res/configuration.toml"
"$SNAPCRAFT_PART_INSTALL/config/device-rfid-llrp/res/configuration.toml"
install -d "$SNAPCRAFT_PART_INSTALL/config/device-rfid-llrp-go/res/profiles/"
install -d "$SNAPCRAFT_PART_INSTALL/config/device-rfid-llrp/res/profiles/"
for fpath in ./cmd/res/profiles/*.yaml; do
fname=$(basename "$fpath")
install -DT "./cmd/res/profiles/${fname}" \
"$SNAPCRAFT_PART_INSTALL/config/device-rfid-llrp-go/res/profiles/${fname}"
"$SNAPCRAFT_PART_INSTALL/config/device-rfid-llrp/res/profiles/${fname}"
done
install -DT "./Attribution.txt" \
"$SNAPCRAFT_PART_INSTALL/usr/share/doc/device-rfid-llrp-go/Attribution.txt"
"$SNAPCRAFT_PART_INSTALL/usr/share/doc/device-rfid-llrp/Attribution.txt"
install -DT "./LICENSE" \
"$SNAPCRAFT_PART_INSTALL/usr/share/doc/device-rfid-llrp-go/LICENSE"
"$SNAPCRAFT_PART_INSTALL/usr/share/doc/device-rfid-llrp/LICENSE"
config-common:
plugin: dump
Expand Down

0 comments on commit 2f01496

Please sign in to comment.