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

Commit

Permalink
Merge pull request #2350 from fluxcd/flux-version-script
Browse files Browse the repository at this point in the history
[snapcraft] stop using soon-to-be deprecated version-script
  • Loading branch information
Daniel Holbach authored Aug 13, 2019
2 parents 691ebd9 + 363f529 commit 9372621
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
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:
Expand All @@ -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
Expand Down

0 comments on commit 9372621

Please sign in to comment.