Skip to content

Commit

Permalink
Merge pull request #11 from ngtuna/v0.0.1-release
Browse files Browse the repository at this point in the history
Auto release kubeapps
  • Loading branch information
ngtuna authored Nov 6, 2017
2 parents 2487fc7 + 656174d commit 847f52f
Show file tree
Hide file tree
Showing 38 changed files with 91 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
language: go

os:
- linux
- osx

go:
- 1.8.3

go_import_path: github.com/kubeapps/installer

before_install:
- set -e

script:
- make test
- make VERSION=${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID} binary

before_deploy:
- echo OS_NAME=$TRAVIS_OS_NAME GO_VERSION=$TRAVIS_GO_VERSION
- EXE_NAME=kubeapps-$(go env GOOS)-$(go env GOARCH)
- cp kubeapps $EXE_NAME
- strip $EXE_NAME && ./$EXE_NAME version
- >
size $EXE_NAME || :
deploy:
provider: releases
api_key:
secure: "G0BmT6tXyXkXlgo9pa4/SNWYZHfwKqxWJ9hVz0LybYnon0IbEjpo5mppsltezEHEQvgdX6H+tujcmOIDAHK2hh3KdeYzZ7GjM1oGRau4x2sN42o6bw7wQ7lC9+ZgPvH9vWiBxf3bZ0TYVjmZ2OcvzBSycg2T5XFKEQKGyJc1cGABFm6At8WXimbaXhWLsrQ0MP9yd5uwvp9PBG+SxJmInDdUIw7sFtEYDL4YDIG6JVgJOV1+3f8oTNiM1wwTPJuaHoybbyeE8xdT9pN6DOk0HZXP+/f6rjx63lMoKCqsqMi6Bz6rDpmI5YfSRh7M2RVebaKnHxYhVKQ20+y0+0UznFmArVSSH4SbFCwz9fYn3NBPLMaSdR91HS4BZe1AeOdXZlfowGOdQuZf3oY/aLtB6cu2jwiUh58CtoTFbg53iZcYwiW69Ap6G40SD2JZNlHPScB5eFJkj1f+3CFHAmB89nLgpZw+S12/HZGQa/OmdB4wd73mqe2XQa7ez60UOjhURwU2LzI02/0NaSswcpu9ygCAYgz1Cy6jAJnmxdvIdcACzYDpgNKNj+yC8GSvAqxEDX+wi6WdUVhy+jwaCzhRgbBZScP8kcFFOKjmdLdeeujRpw3qUzqEh4HW8oNvlg6yXHpoNwjgQJlDIbCHsevPIs/duBCMPy+3st+KaLLwZig="
file_glob: true
file: $EXE_NAME
skip_cleanup: true
overwrite: true
on:
tags: true
branch: master
repo: kubeapps/installer
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
GO = go
GO_FLAGS =
GOFMT = gofmt
VERSION = dev-$(shell date +%FT%T%z)

OS = linux
ARCH = amd64
BINARY = kubeapps
GO_PACKAGES = ./cmd/...
GO_FILES := $(shell find $(shell $(GO) list -f '{{.Dir}}' $(GO_PACKAGES)) -name \*.go)
GO_FLAGS = -ldflags="-w -X github.com/kubeapps/installer/cmd.VERSION=${VERSION}"

.PHONY: binary

default: binary

binary:
$(GO) build -o $(BINARY) $(GO_FLAGS) .

test:
$(GO) test $(GO_FLAGS) $(GO_PACKAGES)

fmt:
$(GOFMT) -s -w $(GO_FILES)

vet:
$(GO) vet $(GO_FLAGS) $(GO_PACKAGES)
7 changes: 6 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -1090,10 +1090,15 @@ spec:
`
)

var (
// VERSION will be overwritten automatically by the build system
VERSION = "devel"
)

// RootCmd is the root of cobra subcommand tree
var RootCmd = &cobra.Command{
Use: "kubeapps",
Short: "Manage KubeApps infrastructure",
Short: "Kubeapps Installer manages to install Kubeapps components to your cluster",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
out := cmd.OutOrStderr()
logrus.SetOutput(out)
Expand Down
20 changes: 20 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version of Kubeapps Installer",
Long: ``,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Kubeapps Installer version: " + VERSION)
},
}

func init() {
RootCmd.AddCommand(versionCmd)
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 847f52f

Please sign in to comment.