Skip to content

Commit 372ed37

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

File tree

95 files changed

+16
-7443
lines changed

Some content is hidden

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

95 files changed

+16
-7443
lines changed

.github/workflows/ci.yml

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

34+
<<<<<<< HEAD
3435
- name: Prepare Host
3536
run: |
3637
sudo apt-get -qq update || true
@@ -44,6 +45,8 @@ jobs:
4445
chmod +x ./kubectl
4546
sudo mv ./kubectl /usr/local/bin/kubectl
4647
48+
=======
49+
>>>>>>> eb1b3a0d... Move docs into stashed/docs repo + Cleanup (#723)
4750
- name: Run checks
4851
run: |
4952
make ci
@@ -56,6 +59,7 @@ jobs:
5659
run: |
5760
docker login --username ${USERNAME} --password ${DOCKER_TOKEN}
5861
make push
62+
<<<<<<< HEAD
5963

6064
- name: Create Kubernetes cluster
6165
id: kind
@@ -89,3 +93,5 @@ jobs:
8993
run: |
9094
export KUBECONFIG=$HOME/.kube/config
9195
make ct
96+
=======
97+
>>>>>>> eb1b3a0d... Move docs into stashed/docs repo + Cleanup (#723)

.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 & 211 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ REPO := $(notdir $(shell pwd))
1919
BIN := stash-postgres
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/arm 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,184 +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_stashpostgreses.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/postgres/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-postgres
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-
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
134+
gen:
135+
@true
318136

319137
fmt: $(BUILD_DIRS)
320138
@docker run \
@@ -444,32 +262,6 @@ unit-tests: $(BUILD_DIRS)
444262
./hack/test.sh $(SRC_PKGS) \
445263
"
446264

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-
"
472-
473265
ADDTL_LINTERS := goconst,gofmt,goimports,unparam
474266

475267
.PHONY: lint

README.md

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

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

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

1314
Install PostgreSQL 9.6 backup or restore plugin for Stash as below.
@@ -28,12 +29,14 @@ Uninstall PostgreSQL 9.6 backup or restore plugin for Stash as below.
2829
helm uninstall stash-postgres-11.2-v1 --namespace=kube-system
2930
```
3031

32+
=======
33+
>>>>>>> eb1b3a0d... Move docs into stashed/docs repo + Cleanup (#723)
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).

apis/installer/fuzzer/fuzzer.go

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

0 commit comments

Comments
 (0)