Skip to content

Commit

Permalink
refactor(snap): Remove external metadata sourcing (#4453)
Browse files Browse the repository at this point in the history
Signed-off-by: Farshid Tavakolizadeh <[email protected]>
  • Loading branch information
farshidtz authored Mar 16, 2023
1 parent d51f32b commit fb374ba
Showing 1 changed file with 15 additions and 32 deletions.
47 changes: 15 additions & 32 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: edgexfoundry
base: core20
type: app
adopt-info: metadata
summary: EdgeX core, security, and supporting components
description: Refer to https://snapcraft.io/edgexfoundry
adopt-info: edgex-go

# Different epochs prevent refreshes between major versions of EdgeX due
# to continued configuration changes.
Expand Down Expand Up @@ -455,16 +456,23 @@ parts:
- "PREFIX=$SNAPCRAFT_PART_INSTALL/"

edgex-go:
after:
- metadata
- go-builder
after: [go-builder]
source: .
plugin: make
override-build: |
cd $SNAPCRAFT_PART_SRC
# the version is needed for the build
cat ./VERSION
if git describe ; then
VERSION=$(git describe --tags --abbrev=0 | sed 's/v//')
else
VERSION="0.0.0"
fi
# set the version of the snap
snapcraftctl set-version $VERSION
# write version to file for the build
echo $VERSION > VERSION
[ ! -d "vendor" ] && go mod download all || echo "skipping..."
Expand Down Expand Up @@ -557,28 +565,3 @@ parts:
unzip $FILE_NAME -d $SNAPCRAFT_PART_INSTALL
organize:
vault: bin/vault

metadata:
plugin: nil
source: https://github.com/canonical/edgex-snap-metadata.git
source-branch: appstream
source-depth: 1
override-build: |
# install the icon at the default internal path
install -DT edgex-snap-icon.png \
$SNAPCRAFT_PART_INSTALL/meta/gui/icon.png
# change to this project's repo to get the version
cd $SNAPCRAFT_PROJECT_DIR
if git describe ; then
VERSION=$(git describe --tags --abbrev=0 | sed 's/v//')
else
VERSION="0.0.0"
fi
# write version to file for the build
echo $VERSION > ./VERSION
# set the version of this snap
snapcraftctl set-version $VERSION
parse-info: [edgexfoundry.metainfo.xml]

0 comments on commit fb374ba

Please sign in to comment.