Skip to content

Commit 2806781

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

File tree

104 files changed

+10
-8865
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
-8865
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,6 @@ jobs:
3131
- name: Set up Docker Buildx
3232
uses: docker/setup-buildx-action@v1
3333

34-
- name: Prepare Host
35-
run: |
36-
sudo apt-get -qq update || true
37-
sudo apt-get install -y bzr
38-
# install yq
39-
curl -fsSL -o yq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64
40-
chmod +x yq
41-
sudo mv yq /usr/local/bin/yq
42-
# install kubectl
43-
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.17.0/bin/linux/amd64/kubectl
44-
chmod +x ./kubectl
45-
sudo mv ./kubectl /usr/local/bin/kubectl
46-
# install codespan schema checker
47-
curl -fsSL -o codespan-schema-checker https://github.com/kmodules/codespan-schema-checker/releases/download/v0.0.1/codespan-schema-checker-linux-amd64
48-
chmod +x codespan-schema-checker
49-
sudo mv codespan-schema-checker /usr/local/bin/codespan-schema-checker
50-
5134
- name: Run checks
5235
run: |
5336
make ci
@@ -60,36 +43,3 @@ jobs:
6043
run: |
6144
docker login --username ${USERNAME} --password ${DOCKER_TOKEN}
6245
make push
63-
64-
- name: Create Kubernetes cluster
65-
id: kind
66-
uses: engineerd/setup-kind@v0.5.0
67-
with:
68-
version: v0.10.0
69-
config: hack/kubernetes/kind.yaml
70-
71-
- name: Prepare cluster for testing
72-
id: local-path
73-
run: |
74-
echo "waiting for nodes to be ready ..."
75-
kubectl wait --for=condition=Ready nodes --all --timeout=5m
76-
kubectl get nodes
77-
echo
78-
echo "install helm 3"
79-
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
80-
echo "install stash-crds chart"
81-
helm repo add appscode https://charts.appscode.com/stable/
82-
helm repo update
83-
helm install stash-crds appscode/stash-crds
84-
helm install kubedb-crds appscode/kubedb-crds
85-
helm install kmodules-crds appscode/kmodules-crds
86-
kubectl wait --for=condition=NamesAccepted crds --all --timeout=5m
87-
88-
- name: Test charts
89-
run: |
90-
export KUBECONFIG=$HOME/.kube/config
91-
make ct
92-
93-
- name: Check codespan schema
94-
run: |
95-
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: |
@@ -55,29 +51,3 @@ jobs:
5551
run: |
5652
docker login --username ${USERNAME} --password ${DOCKER_TOKEN}
5753
make release
58-
59-
- name: Clone charts repository
60-
env:
61-
GITHUB_USER: 1gtm
62-
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
63-
CHART_REPOSITORY: ${{ secrets.CHART_REPOSITORY }}
64-
run: |
65-
url="https://${GITHUB_USER}:${GITHUB_TOKEN}@${CHART_REPOSITORY}.git"
66-
cd $RUNNER_WORKSPACE
67-
git clone $url
68-
cd $(basename $CHART_REPOSITORY)
69-
git config user.name "${GITHUB_USER}"
70-
git config user.email "${GITHUB_USER}@appscode.com"
71-
72-
- name: Package
73-
env:
74-
GITHUB_USER: 1gtm
75-
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
76-
CHART_REPOSITORY: ${{ secrets.CHART_REPOSITORY }}
77-
run: |
78-
cd $RUNNER_WORKSPACE/$(basename $CHART_REPOSITORY)
79-
GIT_TAG=${GITHUB_REF#"refs/tags/"}
80-
if [[ $GIT_TAG =~ "-alpha." ]] || [[ $GIT_TAG =~ "-beta." ]]; then
81-
export REPO_DIR=testing
82-
fi
83-
./hack/scripts/upload-charts.sh $GITHUB_WORKSPACE

Makefile

Lines changed: 3 additions & 221 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ REPO := $(notdir $(shell pwd))
1919
BIN := stash-mongodb
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
27-
2822
# Where to push the docker image.
2923
REGISTRY ?= stashed
3024

@@ -54,7 +48,7 @@ RESTIC_VER := 0.12.0
5448
### These variables should not need tweaking.
5549
###
5650

57-
SRC_PKGS := apis cmd pkg
51+
SRC_PKGS := cmd pkg
5852
SRC_DIRS := $(SRC_PKGS) # directories which hold app source (not vendored)
5953

6054
DOCKER_PLATFORMS := linux/amd64 linux/arm64
@@ -76,7 +70,6 @@ TAG_DBG := $(VERSION)-dbg_$(OS)_$(ARCH)
7670

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

8174
OUTBIN = bin/$(OS)_$(ARCH)/$(BIN)
8275
ifeq ($(OS),windows)
@@ -137,194 +130,9 @@ version:
137130
@echo ::set-output name=commit_hash::$(commit_hash)
138131
@echo ::set-output name=commit_timestamp::$(commit_timestamp)
139132

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_stashmongodbs.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/mongodb/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-mongodb
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-
292133
.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-
yq w -i ./docs/examples/backup/replicaset/backupconfiguration-replicaset.yaml spec.task.name --tag '!!str' mongodb-backup-$(CHART_VERSION); \
314-
yq w -i -d2 ./docs/examples/backup/replicaset/standalone-backup.yaml spec.task.name --tag '!!str' mongodb-backup-$(CHART_VERSION); \
315-
yq w -i ./docs/examples/backup/sharding/backupconfiguration-sharding.yaml spec.task.name --tag '!!str' mongodb-backup-$(CHART_VERSION); \
316-
yq w -i -d2 ./docs/examples/backup/sharding/standalone-backup.yaml spec.task.name --tag '!!str' mongodb-backup-$(CHART_VERSION); \
317-
yq w -i ./docs/examples/backup/standalone/backupconfiguration.yaml spec.task.name --tag '!!str' mongodb-backup-$(CHART_VERSION); \
318-
yq w -i ./docs/examples/restore/replicaset/restoresession-replicaset.yaml spec.task.name --tag '!!str' mongodb-restore-$(CHART_VERSION); \
319-
yq w -i ./docs/examples/restore/replicaset/restoresession-standalone.yaml spec.task.name --tag '!!str' mongodb-restore-$(CHART_VERSION); \
320-
yq w -i ./docs/examples/restore/sharding/restoresession-sharding.yaml spec.task.name --tag '!!str' mongodb-restore-$(CHART_VERSION); \
321-
yq w -i ./docs/examples/restore/sharding/restoresession-standalone.yaml spec.task.name --tag '!!str' mongodb-restore-$(CHART_VERSION); \
322-
yq w -i ./docs/examples/restore/standalone/restoresession.yaml spec.task.name --tag '!!str' mongodb-restore-$(CHART_VERSION); \
323-
fi
324-
@if [ ! -z "$(APP_VERSION)" ]; then \
325-
yq w -i ./charts/$*/Chart.yaml appVersion --tag '!!str' $(APP_VERSION); \
326-
yq w -i ./charts/$*/values.yaml image.tag --tag '!!str' $(APP_VERSION); \
327-
fi
134+
gen:
135+
@true
328136

329137
fmt: $(BUILD_DIRS)
330138
@docker run \
@@ -454,32 +262,6 @@ unit-tests: $(BUILD_DIRS)
454262
./hack/test.sh $(SRC_PKGS) \
455263
"
456264

457-
.PHONY: ct
458-
ct: $(BUILD_DIRS)
459-
@docker run \
460-
-i \
461-
--rm \
462-
-v $$(pwd):/src \
463-
-w /src \
464-
--net=host \
465-
-v $(HOME)/.kube:/.kube \
466-
-v $(HOME)/.minikube:$(HOME)/.minikube \
467-
-v $(HOME)/.credentials:$(HOME)/.credentials \
468-
-v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \
469-
-v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \
470-
-v $$(pwd)/.go/cache:/.cache \
471-
--env HTTP_PROXY=$(HTTP_PROXY) \
472-
--env HTTPS_PROXY=$(HTTPS_PROXY) \
473-
--env KUBECONFIG=$(subst $(HOME),,$(KUBECONFIG)) \
474-
$(CHART_TEST_IMAGE) \
475-
/bin/sh -c " \
476-
kubectl -n kube-system create sa tiller; \
477-
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller; \
478-
helm init --service-account tiller; \
479-
kubectl wait --for=condition=Ready pods -n kube-system --all --timeout=5m; \
480-
ct lint-and-install --all; \
481-
"
482-
483265
ADDTL_LINTERS := goconst,gofmt,goimports,unparam
484266

485267
.PHONY: lint

README.md

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

99
MongoDB backup and restore plugin for [Stash by AppsCode](https://appscode.com/products/stash).
1010

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

1314
Install MongoDB 4.2.3 backup or restore plugin for Stash as below.
@@ -28,12 +29,14 @@ Uninstall MongoDB 4.2.3 backup or restore plugin for Stash as below.
2829
helm delete stash-mongodb--4.1.13 --namespace=kube-system
2930
```
3031

32+
=======
33+
>>>>>>> bd146366... Move docs into stashed/docs repo + Cleanup (#855)
3134
## Support
3235

3336
We use Slack for public discussions. To chit chat with us or the rest of the 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/).
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)