Skip to content

Commit f12778e

Browse files
Emruz Hossaintamalsaha
authored andcommitted
Move docs into stashed/docs repo + Cleanup (#718)
/cherry-pick Signed-off-by: Emruz Hossain <emruz@appscode.com> Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent e44bce9 commit f12778e

File tree

104 files changed

+10
-8781
lines changed

Some content is hidden

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

104 files changed

+10
-8781
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,6 @@ jobs:
3232
run: |
3333
sudo apt-get -qq update || true
3434
sudo apt-get install -y bzr
35-
# install yq
36-
curl -fsSL -o yq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64
37-
chmod +x yq
38-
sudo mv yq /usr/local/bin/yq
39-
# install kubectl
40-
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.17.0/bin/linux/amd64/kubectl
41-
chmod +x ./kubectl
42-
sudo mv ./kubectl /usr/local/bin/kubectl
43-
# install codespan schema checker
44-
curl -fsSL -o codespan-schema-checker https://github.com/kmodules/codespan-schema-checker/releases/download/v0.0.1/codespan-schema-checker-linux-amd64
45-
chmod +x codespan-schema-checker
46-
sudo mv codespan-schema-checker /usr/local/bin/codespan-schema-checker
4735
4836
- name: Run checks
4937
run: |
@@ -57,36 +45,3 @@ jobs:
5745
run: |
5846
docker login --username ${USERNAME} --password ${DOCKER_TOKEN}
5947
make push
60-
61-
- name: Create Kubernetes cluster
62-
id: kind
63-
uses: engineerd/setup-kind@v0.5.0
64-
with:
65-
version: v0.10.0
66-
config: hack/kubernetes/kind.yaml
67-
68-
- name: Prepare cluster for testing
69-
id: local-path
70-
run: |
71-
echo "waiting for nodes to be ready ..."
72-
kubectl wait --for=condition=Ready nodes --all --timeout=5m
73-
kubectl get nodes
74-
echo
75-
echo "install helm 3"
76-
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
77-
echo "install stash-crds chart"
78-
helm repo add appscode https://charts.appscode.com/stable/
79-
helm repo update
80-
helm install stash-crds appscode/stash-crds
81-
helm install kubedb-crds appscode/kubedb-crds
82-
helm install kmodules-crds appscode/kmodules-crds
83-
kubectl wait --for=condition=NamesAccepted crds --all --timeout=5m
84-
85-
- name: Test charts
86-
run: |
87-
export KUBECONFIG=$HOME/.kube/config
88-
make ct
89-
90-
- name: Check codespan schema
91-
run: |
92-
codespan-schema-checker --content=./docs

.github/workflows/release.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ jobs:
1818
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
1919
sudo mv bin/hub /usr/local/bin
2020
21-
- name: Install Helm 3
22-
run: |
23-
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
24-
2521
- name: Print version info
2622
id: semver
2723
run: |
@@ -52,29 +48,3 @@ jobs:
5248
run: |
5349
docker login --username ${USERNAME} --password ${DOCKER_TOKEN}
5450
make release
55-
56-
- name: Clone charts repository
57-
env:
58-
GITHUB_USER: 1gtm
59-
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
60-
CHART_REPOSITORY: ${{ secrets.CHART_REPOSITORY }}
61-
run: |
62-
url="https://${GITHUB_USER}:${GITHUB_TOKEN}@${CHART_REPOSITORY}.git"
63-
cd $RUNNER_WORKSPACE
64-
git clone $url
65-
cd $(basename $CHART_REPOSITORY)
66-
git config user.name "${GITHUB_USER}"
67-
git config user.email "${GITHUB_USER}@appscode.com"
68-
69-
- name: Package
70-
env:
71-
GITHUB_USER: 1gtm
72-
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
73-
CHART_REPOSITORY: ${{ secrets.CHART_REPOSITORY }}
74-
run: |
75-
cd $RUNNER_WORKSPACE/$(basename $CHART_REPOSITORY)
76-
GIT_TAG=${GITHUB_REF#"refs/tags/"}
77-
if [[ $GIT_TAG =~ "-alpha." ]] || [[ $GIT_TAG =~ "-beta." ]]; then
78-
export REPO_DIR=testing
79-
fi
80-
./hack/scripts/upload-charts.sh $GITHUB_WORKSPACE

Makefile

Lines changed: 3 additions & 209 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ REPO := $(notdir $(shell pwd))
1919
BIN := stash-elasticsearch
2020
COMPRESS ?= no
2121

22-
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
23-
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false,crdVersions={v1}"
24-
# https://github.com/appscodelabs/gengo-builder
25-
CODE_GENERATOR_IMAGE ?= appscode/gengo:release-1.18
26-
API_GROUPS ?= installer:v1alpha1
2722

2823
# Where to push the docker image.
2924
REGISTRY ?= stashed
@@ -54,7 +49,7 @@ RESTIC_VER := 0.12.0
5449
### These variables should not need tweaking.
5550
###
5651

57-
SRC_PKGS := apis cmd pkg
52+
SRC_PKGS := cmd pkg
5853
SRC_DIRS := $(SRC_PKGS) # directories which hold app source (not vendored)
5954

6055
DOCKER_PLATFORMS := linux/amd64
@@ -76,7 +71,6 @@ TAG_DBG := $(VERSION)-dbg_$(OS)_$(ARCH)
7671

7772
GO_VERSION ?= 1.16
7873
BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION)
79-
CHART_TEST_IMAGE ?= quay.io/helmpack/chart-testing:v3.0.0
8074

8175
OUTBIN = bin/$(OS)_$(ARCH)/$(BIN)
8276
ifeq ($(OS),windows)
@@ -137,184 +131,9 @@ version:
137131
@echo ::set-output name=commit_hash::$(commit_hash)
138132
@echo ::set-output name=commit_timestamp::$(commit_timestamp)
139133

140-
.PHONY: clientset
141-
clientset:
142-
@docker run --rm \
143-
-u $$(id -u):$$(id -g) \
144-
-v /tmp:/.cache \
145-
-v $$(pwd):$(DOCKER_REPO_ROOT) \
146-
-w $(DOCKER_REPO_ROOT) \
147-
--env HTTP_PROXY=$(HTTP_PROXY) \
148-
--env HTTPS_PROXY=$(HTTPS_PROXY) \
149-
$(CODE_GENERATOR_IMAGE) \
150-
/go/src/k8s.io/code-generator/generate-groups.sh \
151-
"deepcopy" \
152-
$(GO_PKG)/$(REPO)/client \
153-
$(GO_PKG)/$(REPO)/apis \
154-
"$(API_GROUPS)" \
155-
--go-header-file "./hack/license/go.txt"
156-
157-
# Generate openapi schema
158-
.PHONY: openapi
159-
openapi: $(addprefix openapi-, $(subst :,_, $(API_GROUPS)))
160-
@echo "Generating api/openapi-spec/swagger.json"
161-
@docker run --rm \
162-
-u $$(id -u):$$(id -g) \
163-
-v /tmp:/.cache \
164-
-v $$(pwd):$(DOCKER_REPO_ROOT) \
165-
-w $(DOCKER_REPO_ROOT) \
166-
--env HTTP_PROXY=$(HTTP_PROXY) \
167-
--env HTTPS_PROXY=$(HTTPS_PROXY) \
168-
--env GO111MODULE=on \
169-
--env GOFLAGS="-mod=vendor" \
170-
$(BUILD_IMAGE) \
171-
go run hack/gencrd/main.go
172-
173-
openapi-%:
174-
@echo "Generating openapi schema for $(subst _,/,$*)"
175-
@docker run --rm \
176-
-u $$(id -u):$$(id -g) \
177-
-v /tmp:/.cache \
178-
-v $$(pwd):$(DOCKER_REPO_ROOT) \
179-
-w $(DOCKER_REPO_ROOT) \
180-
--env HTTP_PROXY=$(HTTP_PROXY) \
181-
--env HTTPS_PROXY=$(HTTPS_PROXY) \
182-
$(CODE_GENERATOR_IMAGE) \
183-
openapi-gen \
184-
--v 1 --logtostderr \
185-
--go-header-file "./hack/license/go.txt" \
186-
--input-dirs "$(GO_PKG)/$(REPO)/apis/$(subst _,/,$*),k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/util/intstr,k8s.io/apimachinery/pkg/version,k8s.io/api/core/v1,k8s.io/api/apps/v1,k8s.io/api/rbac/v1" \
187-
--output-package "$(GO_PKG)/$(REPO)/apis/$(subst _,/,$*)" \
188-
--report-filename /tmp/violation_exceptions.list
189-
190-
# Generate CRD manifests
191-
.PHONY: gen-crds
192-
gen-crds:
193-
@echo "Generating CRD manifests"
194-
@docker run --rm \
195-
-u $$(id -u):$$(id -g) \
196-
-v /tmp:/.cache \
197-
-v $$(pwd):$(DOCKER_REPO_ROOT) \
198-
-w $(DOCKER_REPO_ROOT) \
199-
--env HTTP_PROXY=$(HTTP_PROXY) \
200-
--env HTTPS_PROXY=$(HTTPS_PROXY) \
201-
$(CODE_GENERATOR_IMAGE) \
202-
controller-gen \
203-
$(CRD_OPTIONS) \
204-
paths="./apis/..." \
205-
output:crd:artifacts:config=crds
206-
207-
crds_to_patch := installer.stash.appscode.com_stashelasticsearches.yaml
208-
209-
.PHONY: patch-crds
210-
patch-crds: $(addprefix patch-crd-, $(crds_to_patch))
211-
patch-crd-%: $(BUILD_DIRS)
212-
@echo "patching $*"
213-
@kubectl patch -f crds/$* -p "$$(cat hack/crd-patch.json)" --type=json --local=true -o yaml > bin/$*
214-
@mv bin/$* crds/$*
215-
216-
.PHONY: label-crds
217-
label-crds: $(BUILD_DIRS)
218-
@for f in crds/*.yaml; do \
219-
echo "applying app=stash label to $$f"; \
220-
kubectl label --overwrite -f $$f --local=true -o yaml app=stash > bin/crd.yaml; \
221-
mv bin/crd.yaml $$f; \
222-
done
223-
224-
.PHONY: gen-crd-protos
225-
gen-crd-protos: $(addprefix gen-crd-protos-, $(subst :,_, $(API_GROUPS)))
226-
227-
gen-crd-protos-%:
228-
@echo "Generating protobuf for $(subst _,/,$*)"
229-
@docker run --rm \
230-
-u $$(id -u):$$(id -g) \
231-
-v /tmp:/.cache \
232-
-v $$(pwd):$(DOCKER_REPO_ROOT) \
233-
-w $(DOCKER_REPO_ROOT) \
234-
--env HTTP_PROXY=$(HTTP_PROXY) \
235-
--env HTTPS_PROXY=$(HTTPS_PROXY) \
236-
$(CODE_GENERATOR_IMAGE) \
237-
go-to-protobuf \
238-
--go-header-file "./hack/license/go.txt" \
239-
--proto-import=$(DOCKER_REPO_ROOT)/vendor \
240-
--proto-import=$(DOCKER_REPO_ROOT)/third_party/protobuf \
241-
--apimachinery-packages=-k8s.io/apimachinery/pkg/api/resource,-k8s.io/apimachinery/pkg/apis/meta/v1,-k8s.io/apimachinery/pkg/apis/meta/v1beta1,-k8s.io/apimachinery/pkg/runtime,-k8s.io/apimachinery/pkg/runtime/schema,-k8s.io/apimachinery/pkg/util/intstr \
242-
--packages=-k8s.io/api/core/v1,stash.appscode.dev/elasticsearch/apis/$(subst _,/,$*)
243-
244-
.PHONY: gen-bindata
245-
gen-bindata:
246-
@docker run \
247-
-i \
248-
--rm \
249-
-u $$(id -u):$$(id -g) \
250-
-v $$(pwd):/src \
251-
-w /src/crds \
252-
-v /tmp:/.cache \
253-
--env HTTP_PROXY=$(HTTP_PROXY) \
254-
--env HTTPS_PROXY=$(HTTPS_PROXY) \
255-
$(BUILD_IMAGE) \
256-
go-bindata -ignore=\\.go -ignore=\\.DS_Store -mode=0644 -modtime=1573722179 -o bindata.go -pkg crds ./...
257-
258-
.PHONY: gen-values-schema
259-
gen-values-schema: $(BUILD_DIRS)
260-
@for dir in charts/*/; do \
261-
dir=$${dir%*/}; \
262-
dir=$${dir##*/}; \
263-
crd=$$(echo $$dir | tr -d '-'); \
264-
yq r crds/installer.stash.appscode.com_$${crd}s.yaml spec.versions[0].schema.openAPIV3Schema.properties.spec > bin/values.openapiv3_schema.yaml; \
265-
yq d bin/values.openapiv3_schema.yaml description > charts/$${dir}/values.openapiv3_schema.yaml; \
266-
rm -rf bin/values.openapiv3_schema.yaml; \
267-
done
268-
269-
.PHONY: gen-readme
270-
gen-readme:
271-
@jq -n -c --arg v "$(CHART_VERSION)" '{"version":$$v}' > /tmp/data.json
272-
@render-gotpl --template=hack/templates/readme.txt --data=/tmp/data.json > README.md
273-
274-
.PHONY: gen-chart-doc
275-
gen-chart-doc: gen-chart-doc-stash-elasticsearch
276-
277-
gen-chart-doc-%:
278-
@echo "Generate $* chart docs"
279-
@docker run --rm \
280-
-u $$(id -u):$$(id -g) \
281-
-v /tmp:/.cache \
282-
-v $$(pwd):$(DOCKER_REPO_ROOT) \
283-
-w $(DOCKER_REPO_ROOT) \
284-
--env HTTP_PROXY=$(HTTP_PROXY) \
285-
--env HTTPS_PROXY=$(HTTPS_PROXY) \
286-
$(BUILD_IMAGE) \
287-
chart-doc-gen -d ./charts/$*/doc.yaml -v ./charts/$*/values.yaml > ./charts/$*/README.md
288-
289-
.PHONY: manifests
290-
manifests: gen-crds gen-values-schema gen-chart-doc
291-
292134
.PHONY: gen
293-
gen: clientset manifests
294-
295-
CHART_REGISTRY ?= appscode
296-
CHART_REGISTRY_URL ?= https://charts.appscode.com/stable/
297-
CHART_VERSION ?=
298-
APP_VERSION ?= $(CHART_VERSION)
299-
300-
.PHONY: update-charts
301-
update-charts: $(shell find $$(pwd)/charts -maxdepth 1 -mindepth 1 -type d -printf 'chart-%f ')
302-
303-
chart-%:
304-
@$(MAKE) chart-contents-$* gen-chart-doc-$* --no-print-directory
305-
306-
chart-contents-%:
307-
@yq w -i ./charts/$*/doc.yaml repository.name --tag '!!str' $(CHART_REGISTRY)
308-
@yq w -i ./charts/$*/doc.yaml repository.url --tag '!!str' $(CHART_REGISTRY_URL)
309-
@if [ ! -z "$(CHART_VERSION)" ]; then \
310-
yq w -i ./charts/$*/Chart.yaml version --tag '!!str' $(CHART_VERSION); \
311-
yq w -i ./charts/$*/doc.yaml chart.version --tag '!!str' $(CHART_VERSION); \
312-
yq w -i ./charts/$*/doc.yaml release.name --tag '!!str' $(BIN)-$(CHART_VERSION); \
313-
fi
314-
@if [ ! -z "$(APP_VERSION)" ]; then \
315-
yq w -i ./charts/$*/Chart.yaml appVersion --tag '!!str' $(APP_VERSION); \
316-
yq w -i ./charts/$*/values.yaml image.tag --tag '!!str' $(APP_VERSION); \
317-
fi
135+
gen:
136+
@true
318137

319138
fmt: $(BUILD_DIRS)
320139
@docker run \
@@ -444,31 +263,6 @@ unit-tests: $(BUILD_DIRS)
444263
./hack/test.sh $(SRC_PKGS) \
445264
"
446265

447-
.PHONY: ct
448-
ct: $(BUILD_DIRS)
449-
@docker run \
450-
-i \
451-
--rm \
452-
-v $$(pwd):/src \
453-
-w /src \
454-
--net=host \
455-
-v $(HOME)/.kube:/.kube \
456-
-v $(HOME)/.minikube:$(HOME)/.minikube \
457-
-v $(HOME)/.credentials:$(HOME)/.credentials \
458-
-v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \
459-
-v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \
460-
-v $$(pwd)/.go/cache:/.cache \
461-
--env HTTP_PROXY=$(HTTP_PROXY) \
462-
--env HTTPS_PROXY=$(HTTPS_PROXY) \
463-
--env KUBECONFIG=$(subst $(HOME),,$(KUBECONFIG)) \
464-
$(CHART_TEST_IMAGE) \
465-
/bin/sh -c " \
466-
kubectl -n kube-system create sa tiller; \
467-
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller; \
468-
helm init --service-account tiller; \
469-
kubectl wait --for=condition=Ready pods -n kube-system --all --timeout=5m; \
470-
ct lint-and-install --all; \
471-
"
472266

473267
ADDTL_LINTERS := goconst,gofmt,goimports,unparam
474268

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
Elasticsearch backup and restore plugin for [Stash by AppsCode](https://stash.run).
1010

11+
<<<<<<< HEAD
1112
## Install
1213

1314
Install Elasticsearch 6.5.3 backup or restore plugin for Stash as below.
@@ -28,12 +29,14 @@ Uninstall Elasticsearch 6.5.3 backup or restore plugin for Stash as below.
2829
helm uninstall stash-elasticsearch-7.3.2 --namespace=kube-system
2930
```
3031

32+
=======
33+
>>>>>>> 5472c017... Move docs into stashed/docs repo + Cleanup (#718)
3134
## Support
3235

3336
To speak with us, please leave a message on [our website](https://appscode.com/contact/).
3437

3538
To join public discussions with the Stash community, join us in the [AppsCode Slack team](https://appscode.slack.com/messages/C8NCX6N23/details/) channel `#stash`. To sign up, use our [Slack inviter](https://slack.appscode.com/).
3639

37-
To receive product annoucements, follow us on [Twitter](https://twitter.com/KubeStash).
40+
To receive product announcements, follow us on [Twitter](https://twitter.com/KubeStash).
3841

3942
If you have found a bug with Stash or want to request new features, please [file an issue](https://github.com/stashed/project/issues/new).

0 commit comments

Comments
 (0)