Skip to content

Commit 86cc84d

Browse files
hossainemruztamalsaha
authored andcommitted
Prepare for v0.2.0 release (#11)
1 parent 5b596e5 commit 86cc84d

File tree

180 files changed

+2280
-11554
lines changed

Some content is hidden

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

180 files changed

+2280
-11554
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
- name: Check out code into the Go module directory
1818
uses: actions/checkout@v1
1919

20-
- name: Build
20+
- name: Run checks
2121
run: make ci

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
2323
- name: Set up Docker Buildx
2424
id: buildx
25-
uses: crazy-max/ghaction-docker-buildx@master
25+
uses: crazy-max/ghaction-docker-buildx@v1
2626
with:
2727
version: latest
2828

Makefile

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
SHELL=/bin/bash -o pipefail
1717

18-
# The binary to build (just the basename).
18+
GO_PKG := stash.appscode.dev
19+
REPO := $(notdir $(shell pwd))
1920
BIN := kubectl-stash
2021
COMPRESS ?= no
2122

@@ -43,7 +44,8 @@ endif
4344
### These variables should not need tweaking.
4445
###
4546

46-
SRC_DIRS := cmd pkg hack/gendocs # directories which hold app source (not vendored)
47+
SRC_PKGS := cmd pkg
48+
SRC_DIRS := $(SRC_PKGS) hack/gendocs # directories which hold app source (not vendored)
4749

4850
DOCKER_PLATFORMS := linux/amd64 linux/arm linux/arm64
4951
BIN_PLATFORMS := $(DOCKER_PLATFORMS) windows/amd64 darwin/amd64
@@ -52,7 +54,7 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) windows/amd64 darwin/amd64
5254
OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS))
5355
ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))
5456

55-
GO_VERSION ?= 1.12.10
57+
GO_VERSION ?= 1.12.12
5658
BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION)-stretch
5759

5860
OUTBIN = bin/$(OS)_$(ARCH)/$(BIN)
@@ -63,7 +65,11 @@ endif
6365
# Directories that we need created to build/test.
6466
BUILD_DIRS := bin/$(OS)_$(ARCH) \
6567
.go/bin/$(OS)_$(ARCH) \
66-
.go/cache
68+
.go/cache \
69+
hack/config \
70+
$(HOME)/.credentials \
71+
$(HOME)/.kube \
72+
$(HOME)/.minikube
6773

6874
# If you want to build all binaries, see the 'all-build' rule.
6975
# If you want to build all containers, see the 'all-container' rule.
@@ -90,7 +96,7 @@ version:
9096
@echo ::set-output name=commit_timestamp::$(commit_timestamp)
9197

9298
gen:
93-
./hack/codegen.sh
99+
@true
94100

95101
fmt: $(BUILD_DIRS)
96102
@docker run \
@@ -105,7 +111,10 @@ fmt: $(BUILD_DIRS)
105111
--env HTTP_PROXY=$(HTTP_PROXY) \
106112
--env HTTPS_PROXY=$(HTTPS_PROXY) \
107113
$(BUILD_IMAGE) \
108-
./hack/fmt.sh $(SRC_DIRS)
114+
/bin/bash -c " \
115+
REPO_PKG=$(GO_PKG) \
116+
./hack/fmt.sh $(SRC_DIRS) \
117+
"
109118

110119
build: $(OUTBIN)
111120

@@ -165,7 +174,10 @@ $(OUTBIN): .go/$(OUTBIN).stamp
165174
fi
166175
@echo
167176

168-
test: $(BUILD_DIRS)
177+
.PHONY: test
178+
test: unit-tests
179+
180+
unit-tests: $(BUILD_DIRS)
169181
@docker run \
170182
-i \
171183
--rm \
@@ -204,16 +216,33 @@ lint: $(BUILD_DIRS)
204216
--env GO111MODULE=on \
205217
--env GOFLAGS="-mod=vendor" \
206218
$(BUILD_IMAGE) \
207-
golangci-lint run --enable $(ADDTL_LINTERS) --skip-dirs-use-default --deadline=10m
219+
golangci-lint run --enable $(ADDTL_LINTERS) --deadline=10m --skip-files="generated.*\.go$\" --skip-dirs-use-default
208220

209221
$(BUILD_DIRS):
210222
@mkdir -p $@
211223

212224
.PHONY: dev
213225
dev: gen fmt build
214226

227+
.PHONY: verify
228+
verify: verify-modules verify-gen
229+
230+
.PHONY: verify-modules
231+
verify-modules:
232+
GO111MODULE=on go mod tidy
233+
GO111MODULE=on go mod vendor
234+
@if !(git diff --exit-code HEAD); then \
235+
echo "go module files are out of date"; exit 1; \
236+
fi
237+
238+
.PHONY: verify-gen
239+
verify-gen: gen fmt
240+
@if !(git diff --exit-code HEAD); then \
241+
echo "files are out of date, run make gen fmt"; exit 1; \
242+
fi
243+
215244
.PHONY: ci
216-
ci: lint test build #cover
245+
ci: verify lint build unit-tests #cover
217246

218247
.PHONY: qa
219248
qa:

cmd/kubectl-stash/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import (
66
"runtime"
77
"time"
88

9+
"stash.appscode.dev/cli/pkg"
10+
_ "stash.appscode.dev/stash/client/clientset/versioned/fake"
11+
912
"github.com/appscode/go/log"
1013
_ "k8s.io/client-go/kubernetes/fake"
1114
_ "k8s.io/client-go/plugin/pkg/client/auth"
1215
"kmodules.xyz/client-go/logs"
13-
"stash.appscode.dev/cli/pkg"
14-
_ "stash.appscode.dev/stash/client/clientset/versioned/fake"
1516
)
1617

1718
func main() {

docs/kubectl-stash.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ kubectl plugin for Stash by AppsCode. For more information, visit here: https://
3434
--cluster string The name of the kubeconfig cluster to use
3535
--context string The name of the kubeconfig context to use
3636
--enable-analytics Send analytical events to Google Analytics (default true)
37-
--enable-status-subresource If true, uses sub resource for crds.
3837
-h, --help help for kubectl-stash
3938
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
4039
--kubeconfig string Path to the kubeconfig file to use for CLI requests.

docs/kubectl-stash_clone.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Clone Kubernetes resources
3737
--cluster string The name of the kubeconfig cluster to use
3838
--context string The name of the kubeconfig context to use
3939
--enable-analytics Send analytical events to Google Analytics (default true)
40-
--enable-status-subresource If true, uses sub resource for crds.
4140
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
4241
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
4342
--log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0)

docs/kubectl-stash_clone_pvc.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ kubectl-stash clone pvc [flags]
5353
--cluster string The name of the kubeconfig cluster to use
5454
--context string The name of the kubeconfig context to use
5555
--enable-analytics Send analytical events to Google Analytics (default true)
56-
--enable-status-subresource If true, uses sub resource for crds.
5756
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
5857
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
5958
--log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0)

docs/kubectl-stash_cp.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Copy stash resources from one namespace to another namespace
3737
--cluster string The name of the kubeconfig cluster to use
3838
--context string The name of the kubeconfig context to use
3939
--enable-analytics Send analytical events to Google Analytics (default true)
40-
--enable-status-subresource If true, uses sub resource for crds.
4140
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
4241
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
4342
--log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0)

docs/kubectl-stash_cp_backupconfig.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ kubectl-stash cp backupconfig [flags]
4040
--cluster string The name of the kubeconfig cluster to use
4141
--context string The name of the kubeconfig context to use
4242
--enable-analytics Send analytical events to Google Analytics (default true)
43-
--enable-status-subresource If true, uses sub resource for crds.
4443
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
4544
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
4645
--log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0)

docs/kubectl-stash_cp_repository.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ kubectl-stash cp repository [flags]
4040
--cluster string The name of the kubeconfig cluster to use
4141
--context string The name of the kubeconfig context to use
4242
--enable-analytics Send analytical events to Google Analytics (default true)
43-
--enable-status-subresource If true, uses sub resource for crds.
4443
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
4544
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
4645
--log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0)

0 commit comments

Comments
 (0)