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

Publish fluxctl Linux packages #1377

Closed
dholbach opened this issue Sep 20, 2018 · 10 comments
Closed

Publish fluxctl Linux packages #1377

dholbach opened this issue Sep 20, 2018 · 10 comments

Comments

@dholbach
Copy link
Member

It'd be great to have fluxctl packages for Linux distributed without having to go download a binary (and chmod) or build from source.

A similar discussion came up in the eksctl project recently (eksctl-io/eksctl#215) and I snaps, as they're supported on a variety of Linux flavours and the build ties in with our CI easily (only one additional yaml required).

Unfortunately are builds for both fluxctl and eksctl currently blocked on access to .dotfiles, but a strawman solution was just brought up to remedy this: canonical/snapd#5845

@hiddeco
Copy link
Member

hiddeco commented Sep 20, 2018

I am happy to provide an AUR package for Arch Linux based systems.

Snaps is a personal no-go for me as it adds another dependency to my system that I will likely not use 99.99% of the time.

@dholbach
Copy link
Member Author

I am happy to provide an AUR package for Arch Linux based systems.

Sure. Why not? :-)

@guilhem
Copy link

guilhem commented Jan 24, 2019

snap / flatpak / deb / rpm etc could be really cool.
And even if you dislike snap doesn't mean this project shouldn't provide it.

goreleaser is a really cool project to do this.

@dholbach
Copy link
Member Author

Thanks for the info, @guilhem.

Now that canonical/snapd#5845 is solved, I'm struggling with https://bugs.launchpad.net/snapcraft/+bug/1812633. I'm testing the fluxctl snap now.

name: fluxctl
version: 1.9.0+git3a0e5b88
summary: fluxctl talks to Weave Flux and helps you deploy your code
description: |
  fluxctl talks to your Weave 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
plugs:
  personal-files:
    read:
      - $HOME/.kube/config
      - $HOME/.minikube/client.key
      - $HOME/.minikube/client.crt
      - $HOME/.minikube/ca.crt

parts:
  fluxctl:
    plugin: go
    go-importpath: github.com/weaveworks/flux
    prime:
      - bin/fluxctl

apps:
  fluxctl:
    command: fluxctl
    plugs: [personal-files, network, network-bind]

^ This is what I currently have.

@guilhem
Copy link

guilhem commented Jan 25, 2019

!!! I didn't see it was solved !!! \o/
For your bug on version @dholbach , I answered on launchpad about version-script: metadata you can put.
Maybe try with a git describe without --dirty

@guilhem
Copy link

guilhem commented Jan 25, 2019

You may also put all $HOME/.kube folder as personal-files.
Sometime I use CRT not inline or split config file into multiples.

@guilhem
Copy link

guilhem commented Jan 25, 2019

I was asking myself about adding snapcraft release in #1689 ... but goreleaser lack some snapcraft features: goreleaser/goreleaser#914

@dholbach
Copy link
Member Author

Probably not the prettiest solution, but the version string I fixed now thanks to your suggestion.

I can't seem to add all of $HOME/.kube to personal-files. That's a blocker for a snap then, right?

Current snapcraft.yaml:

name: fluxctl
version-script: |
  FLUX_TAG="$(git tag -l | egrep -v '^(chart-|helm-|master-|pre-split)' | 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 Weave Flux and helps you deploy your code
description: |
  fluxctl talks to your Weave 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
plugs:
  personal-files:
    read:
      - $HOME/.kube/config
      - $HOME/.minikube/client.key
      - $HOME/.minikube/client.crt
      - $HOME/.minikube/ca.crt

parts:
  fluxctl:
    plugin: go
    go-importpath: github.com/weaveworks/flux
    prime:
      - bin/fluxctl

apps:
  fluxctl:
    command: fluxctl
    plugs: [personal-files, network, network-bind]

@dholbach
Copy link
Member Author

This is working for me now:

sudo snap install snapcraft --classic
sudo snap install multipass --beta --classic
snapcraft

With this snapcraft.yaml file:

name: fluxctl
version-script: |
  FLUX_TAG="$(git tag -l | egrep -v '^(chart-|helm-|master-|pre-split)' | sort -n | 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 Weave Flux and helps you deploy your code
description: |
  fluxctl talks to your Weave 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: classic
base: core18

parts:
  fluxctl:
    source: .
    plugin: go
    go-importpath: github.com/weaveworks/flux
    override-pull: |
      snapcraftctl pull
      export GOPATH=$(dirname $SNAPCRAFT_PART_INSTALL)/go
      export PATH=$GOPATH/bin:$PATH
      cd $GOPATH/src/github.com/weaveworks/flux
      dep ensure
    build-packages:
      - gcc
      - go-dep
    prime:
      - bin/fluxctl

apps:
  fluxctl:
    command: bin/fluxctl

@dholbach
Copy link
Member Author

dholbach commented May 7, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants