Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
build(snap): update versioning to use git tag (#70)
Browse files Browse the repository at this point in the history
This commit updates the snap to set the snap version to the latest git tag version.
It also creates a VERSION file for the cmake build to use.

Signed-off-by: Siggi Skulason <siggi.skulason@canonical.com>
  • Loading branch information
Siggi Skulason authored Jul 8, 2021
1 parent 25ecd52 commit 9c78a47
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ parts:
source: snap/local
override-pull: |
cd $SNAPCRAFT_PROJECT_DIR
if [ -f VERSION ]; then
PROJECT_VERSION=$(cat VERSION)
else
PROJECT_VERSION="0.0.0"
# The cmake build requires a VERSION file
echo $PROJECT_VERSION > VERSION
GIT_VERSION=$(git describe --tags --abbrev=0 | sed 's/v//')
if [ -z "$GIT_VERSION" ]; then
GIT_VERSION="0.0.0"
fi
snapcraftctl set-version ${PROJECT_VERSION}
snapcraftctl set-version ${GIT_VERSION}
config:
source: .
plugin: dump
Expand Down Expand Up @@ -151,6 +148,10 @@ parts:
edgex-device-grove:
source: .
plugin: cmake
override-pull: |
snapcraftctl pull
cd $SNAPCRAFT_PROJECT_DIR
make version
source-subdir: src/c
after:
- device-sdk-c
Expand Down

0 comments on commit 9c78a47

Please sign in to comment.