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

Commit

Permalink
feat: add snap
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-karan committed May 29, 2020
1 parent 7bf763d commit 6b74e12
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"fmt"
"os"
"path/filepath"

Expand Down Expand Up @@ -40,6 +41,7 @@ func initFileSystem(binPath string) (stuffbin.FileSystem, error) {
panic(err)
}
exPath := filepath.Dir(ex)
fmt.Println(exPath)
fs, err := stuffbin.UnStuff(filepath.Join(exPath, filepath.Base(os.Args[0])))
if err != nil {
return nil, err
Expand Down Expand Up @@ -71,6 +73,7 @@ func main() {
fs, err := initFileSystem(os.Args[0])
if err != nil {
logger.Errorf("error reading stuffed binary: %v", err)
os.Exit(1)
}
// Initialize hub.
hub := cmd.NewHub(logger, fs, buildVersion)
Expand All @@ -81,7 +84,7 @@ func main() {
hub.InitProject(hub.Config),
}
// Run the app.
hub.Logger.Info("Starting kubekutr...")
hub.Logger.Info("Starting kubekutr......")
err = app.Run(os.Args)
if err != nil {
logger.Errorf("Something terrbily went wrong: %s", err)
Expand Down
24 changes: 24 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: kubekutr
version: git
summary: Cookie cutter templating tool for scaffolding K8s manifests.
description: |
kubekutr lets you quickly scaffold a bespoke configuration for Kubernetes resource manifests with an opinionated GitOps
directory structure.
confinement: devmode
base: core18

parts:
kubekutr:
plugin: go
go-importpath: github.com/mr-karan/kubekutr
source: .
source-type: git
override-build: |
go get -u github.com/knadh/stuffbin/...
go build -o kubekutr -ldflags="-X 'main.buildVersion=${VERSION}' -X 'main.buildDate=${BUILD_DATE}'"
/root/go/bin/stuffbin -a stuff -in kubekutr -out kubekutr ./templates:/templates
snapcraftctl build
apps:
kubekutr:
command: bin/kubekutr

0 comments on commit 6b74e12

Please sign in to comment.