Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

build(snap): Upgrade snap base to core22, remove deprecated plug #323

Merged
merged 1 commit into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: edgex-device-onvif-camera
base: core20
base: core22
license: Apache-2.0
summary: EdgeX ONVIF Camera Device Service
description: Refer to https://snapcraft.io/edgex-device-onvif-camera
Expand All @@ -23,14 +23,8 @@ plugs:
interface: content
target: $SNAP_DATA/config/device-onvif-camera

# deprecated
device-config:
interface: content
target: $SNAP_DATA/config/device-onvif-camera

apps:
device-onvif-camera:
adapter: full
command: bin/device-onvif-camera --configDir $SNAP_DATA/config/device-onvif-camera/res --configProvider --registry
command-chain:
- bin/source-env-file.sh
Expand All @@ -50,9 +44,9 @@ parts:
build-snaps:
- go/1.20/stable
override-build: |
cd $SNAPCRAFT_PART_SRC
cd $CRAFT_PART_SRC
make build
install -DT ./helper-go $SNAPCRAFT_PART_INSTALL/bin/helper-go
install -DT ./helper-go $CRAFT_PART_INSTALL/bin/helper-go

device-onvif-camera:
source: .
Expand All @@ -61,7 +55,7 @@ parts:
build-snaps:
- go/1.20/stable
override-build: |
cd $SNAPCRAFT_PART_SRC
cd $CRAFT_PART_SRC

if git describe ; then
VERSION=$(git describe --tags --abbrev=0 | sed 's/v//')
Expand All @@ -70,23 +64,20 @@ parts:
fi

# set the version of the snap
snapcraftctl set-version $VERSION
craftctl set version=$VERSION

# write version to file for the build
echo $VERSION > VERSION

make build

install -DT cmd/device-onvif-camera $SNAPCRAFT_PART_INSTALL/bin/device-onvif-camera
install -DT cmd/device-onvif-camera $CRAFT_PART_INSTALL/bin/device-onvif-camera

RES=$SNAPCRAFT_PART_INSTALL/config/device-onvif-camera/res/
RES=$CRAFT_PART_INSTALL/config/device-onvif-camera/res/
mkdir -p $RES
cp cmd/res/configuration.yaml $RES
cp -r cmd/res/devices $RES
cp -r cmd/res/profiles $RES
cp -r cmd/res/provisionwatchers $RES
cp -r cmd/res/* $RES

DOC=$SNAPCRAFT_PART_INSTALL/usr/share/doc/device-onvif-camera
DOC=$CRAFT_PART_INSTALL/usr/share/doc/device-onvif-camera
mkdir -p $DOC
cp Attribution.txt $DOC/Attribution.txt
cp LICENSE $DOC/LICENSE
Expand Down