[snapcraft] stop using soon-to-be deprecated version-script
name: fluxctl
-version-script: |
- FLUX_TAG="$(git tag -l | egrep -v '^(chart-|helm-|master-|pre-split)' | sort --version-sort | tail -n1)"
- if [ "$SNAPCRAFT_PROJECT_GRADE" = "stable" ]
- then
- echo "$FLUX_TAG"
- else
- GIT_REV="$(git rev-parse --short HEAD)"
- echo "$FLUX_TAG+$GIT_REV"
- fi
-version: git
summary: fluxctl talks to Flux and helps you deploy your code
description: |
fluxctl talks to your Flux instance and exposes all its
functionality to an easy to use command line interface.
-grade: devel # must be 'stable' to release into candidate/stable channels
confinement: strict
+adopt-info: fluxctl
base: core18
parts:
@@ -30,10 +20,26 @@ parts:
snapcraftctl stage
fluxctl:
source: .
+ override-pull: |
+ snapcraftctl pull
+ FLUX_TAG="$(git tag -l | egrep -v '^(chart-|helm-|master-|pre-split)' | sort --version-sort | tail -n1)"
+ set +e
+ git describe --exact-match --tags $(git log -n1 --pretty='%h')
+ retVal=$?
+ set -e
+ if [ $retVal -eq 0 ]; then
+ snapcraftctl set-version "$FLUX_TAG"
+ snapcraftctl set-grade stable
+ else
+ GIT_REV="$(git rev-parse --short HEAD)"
+ snapcraftctl set-version "$FLUX_TAG+$GIT_REV"
+ snapcraftctl set-grade devel
+ fi
plugin: go
go-importpath: github.com/weaveworks/flux
build-packages:
- gcc
+ - git
stage:
- -bin/fluxd
- -bin/helm-operator
