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

Commit 77845eb

Browse files
author
Batuhan Apaydın
authored
Merge pull request #2 from Trendyol/develop
Add goreleaser and circleci integrations
2 parents a102175 + 70b7add commit 77845eb

File tree

5,098 files changed

+145
-2009746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,098 files changed

+145
-2009746
lines changed

.circleci/config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
jobs:
3+
release:
4+
docker:
5+
- image: circleci/golang:1.12
6+
steps:
7+
- checkout
8+
- run: curl -sL https://git.io/goreleaser | bash
9+
workflows:
10+
version: 2
11+
release:
12+
jobs:
13+
- release:
14+
filters:
15+
branches:
16+
ignore: /.*/
17+
tags:
18+
only: /v[0-9]+(\.[0-9]+)*(-.*)*/

.goreleaser.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This is an example goreleaser.yaml file with some sane defaults.
2+
# Make sure to check the documentation at http://goreleaser.com
3+
---
4+
builds:
5+
- env:
6+
- CGO_ENABLED=0
7+
goos:
8+
- linux
9+
- darwin
10+
- windows
11+
archives:
12+
- replacements:
13+
darwin: Darwin
14+
linux: Linux
15+
windows: Windows
16+
386: i386
17+
amd64: x86_64
18+
checksum:
19+
name_template: 'checksums.txt'
20+
snapshot:
21+
name_template: "{{ .Tag }}"
22+
changelog:
23+
sort: asc
24+
filters:
25+
exclude:
26+
- '^docs:'
27+
- '^test:'

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ Or you can easily download project via brew (OSX package manager)
2222
brew tap trendyol/trendyol-tap
2323
brew install easy-rollback
2424
```
25+
26+
Or you can install the pre-compiled binary
27+
```bash
28+
wget https://github.com/Trendyol/easy-rollback/releases/download/v1.0.10/easy-rollback_1.0.10_Linux_x86_64.tar.gz
29+
tar xvfz easy-rollback_1.0.10_Linux_x86_64.tar.gz
30+
mv easy-rollback /usr/local/bin
31+
```
32+
2533
## Usage
2634
Project look at your .kube/config file to read current-context configs hence of you should have kubernetes environment configurations inside .kube/config.
2735

client/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package client
22

33
import (
4+
"path/filepath"
5+
46
"github.com/mitchellh/go-homedir"
57
"k8s.io/client-go/kubernetes"
68
"k8s.io/client-go/tools/clientcmd"
7-
"path/filepath"
89
)
910

1011
func NewK8sClient() *kubernetes.Clientset {

command/commands.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ package command
22

33
import (
44
"fmt"
5+
"os"
6+
57
"github.com/Trendyol/easy-rollback/kubernetes"
68
"github.com/spf13/cobra"
7-
"os"
89
)
910

11+
const VERSION = "1.0.8"
12+
1013
var rootCmd = &cobra.Command{
1114
Use: "",
1215
Short: "",
@@ -26,6 +29,14 @@ var rollbackCommand = &cobra.Command{
2629
Run: kubernetes.RollbackDeployment(),
2730
}
2831

32+
var versionCommand = &cobra.Command{
33+
Use: "version",
34+
Short: "Print the version number of easy-rollback",
35+
Run: func(cmd *cobra.Command, args []string) {
36+
fmt.Println("easy-rollback:", VERSION)
37+
},
38+
}
39+
2940
func Execute() {
3041
if err := rootCmd.Execute(); err != nil {
3142
fmt.Println(err)
@@ -37,5 +48,5 @@ func init() {
3748
rootCmd.PersistentFlags().String("namespace", "default", "namespace")
3849
rootCmd.PersistentFlags().String("deployment", "", "deployment")
3950
rollbackCommand.Flags().String("to-image", "", "to-image")
40-
rootCmd.AddCommand(listCommand, rollbackCommand)
51+
rootCmd.AddCommand(listCommand, rollbackCommand, versionCommand)
4152
}

glide.lock

Lines changed: 0 additions & 259 deletions
This file was deleted.

glide.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)