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

[snapcraft] stop using soon-to-be deprecated version-script #2350

Merged
merged 2 commits into from
Aug 13, 2019
Merged
Changes from 1 commit
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
Next Next commit
[snapcraft] stop using soon-to-be deprecated version-script
  • Loading branch information
Daniel Holbach committed Aug 12, 2019
commit 170f50796e8084b2463a31608e4e2016b5a92598
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