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

Commit

Permalink
Merge pull request #2 from Trendyol/develop
Browse files Browse the repository at this point in the history
Add goreleaser and circleci integrations
  • Loading branch information
Batuhan Apaydın authored Sep 12, 2019
2 parents a102175 + 70b7add commit 77845eb
Show file tree
Hide file tree
Showing 5,098 changed files with 145 additions and 2,009,746 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
jobs:
release:
docker:
- image: circleci/golang:1.12
steps:
- checkout
- run: curl -sL https://git.io/goreleaser | bash
workflows:
version: 2
release:
jobs:
- release:
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
27 changes: 27 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
---
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ Or you can easily download project via brew (OSX package manager)
brew tap trendyol/trendyol-tap
brew install easy-rollback
```

Or you can install the pre-compiled binary
```bash
wget https://github.com/Trendyol/easy-rollback/releases/download/v1.0.10/easy-rollback_1.0.10_Linux_x86_64.tar.gz
tar xvfz easy-rollback_1.0.10_Linux_x86_64.tar.gz
mv easy-rollback /usr/local/bin
```

## Usage
Project look at your .kube/config file to read current-context configs hence of you should have kubernetes environment configurations inside .kube/config.

Expand Down
3 changes: 2 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package client

import (
"path/filepath"

"github.com/mitchellh/go-homedir"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"path/filepath"
)

func NewK8sClient() *kubernetes.Clientset {
Expand Down
15 changes: 13 additions & 2 deletions command/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ package command

import (
"fmt"
"os"

"github.com/Trendyol/easy-rollback/kubernetes"
"github.com/spf13/cobra"
"os"
)

const VERSION = "1.0.8"

var rootCmd = &cobra.Command{
Use: "",
Short: "",
Expand All @@ -26,6 +29,14 @@ var rollbackCommand = &cobra.Command{
Run: kubernetes.RollbackDeployment(),
}

var versionCommand = &cobra.Command{
Use: "version",
Short: "Print the version number of easy-rollback",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("easy-rollback:", VERSION)
},
}

func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
Expand All @@ -37,5 +48,5 @@ func init() {
rootCmd.PersistentFlags().String("namespace", "default", "namespace")
rootCmd.PersistentFlags().String("deployment", "", "deployment")
rollbackCommand.Flags().String("to-image", "", "to-image")
rootCmd.AddCommand(listCommand, rollbackCommand)
rootCmd.AddCommand(listCommand, rollbackCommand, versionCommand)
}
259 changes: 0 additions & 259 deletions glide.lock

This file was deleted.

12 changes: 0 additions & 12 deletions glide.yaml

This file was deleted.

Loading

0 comments on commit 77845eb

Please sign in to comment.