This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
/
snapcraft.yaml
71 lines (68 loc) · 1.72 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: fluxctl
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.
confinement: strict
adopt-info: fluxctl
base: core18
parts:
launcher:
source: snap/local
source-type: local
plugin: dump
organize:
'*': bin/
override-stage: |
cd $SNAPCRAFT_PART_INSTALL
chmod +x bin/fluxctl-launch
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: nil
override-build: |
export GOBIN=$SNAPCRAFT_PART_INSTALL/bin
go build -o $GOBIN/fluxctl ./cmd/fluxctl
build-environment:
- GO111MODULE: 'on'
- CGO_ENABLED: '0'
build-packages:
- gcc
- git
build-snaps:
- go/1.12/stable
stage:
- -bin/fluxd
- -bin/helm-operator
organize:
bin/fluxctl: bin/fluxctl.real
after: [launcher]
plugs:
kube-config:
interface: personal-files
read:
- $HOME/.kube
- $HOME/.minikube
- $HOME/.config/k3d # hard-coded $XDG_CONFIG_HOME for the common case
apps:
fluxctl:
command: bin/fluxctl-launch
plugs:
- kube-config
- network
- network-bind