Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Add snap package definition #71

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ tf.json

# Docs
docs/_build

# Snap images
*.snap
45 changes: 45 additions & 0 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: wksctl
version: git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/fluxcd/flux/blame/master/snap/snapcraft.yaml#L23-L37 might be helpful for automatically getting you the version.

summary: Open Source Weaveworks Kubernetes System
description: >
wksctl allows simple creation of a Kubernetes cluster given a set of IP addresses and an SSH key. It
can be run in a standalone environment but is best used via a GitOps approach in which cluster and
machine descriptions are stored in Git and the state of the cluster tracks changes to the descriptions.

Its features include simple creation of Kubernetes clusters, manage cluster and machine descriptions using Git,
manage addons like Weave Net or Flux, Sealed Secret integration

confinement: strict
grade: stable
base: core18

parts:
wksctl:
source: .
# Don't use go plugin because it doesn't seem to work with Go modules
plugin: nil
override-build: |
export GOBIN=$SNAPCRAFT_PART_INSTALL/bin
export VERSION=$(git tag -l | egrep -v '^(chart-|helm-|master-|pre-split|[a-z])' | sort --version-sort | tail -n1)
go build -ldflags "-X github.com/weaveworks/wksctl/pkg/version.Version=$VERSION" -o $GOBIN/wksctl ./cmd/wksctl
build-environment:
- GO111MODULE: 'on'
- CGO_ENABLED: '0'
build-snaps:
- go/1.12/stable

plugs:
kube-config:
interface: personal-files
write:
- $HOME/.wks

apps:
wksctl:
command: bin/wksctl
plugs:
- kube-config
- removable-media
- home
- network
- network-bind