From 8d0a04b484840f8942fa57751f57e462a1a67505 Mon Sep 17 00:00:00 2001 From: pat-s Date: Thu, 9 Mar 2023 17:30:58 +0100 Subject: [PATCH 1/4] format all files with prettier --- .drone.yml | 149 +++++++++++++++---------------- .markdownlint.yaml | 16 ++-- Chart.lock | 24 ++--- Chart.yaml | 36 ++++---- unittests/statefulset/basic.yaml | 2 +- values.yaml | 16 ++-- 6 files changed, 123 insertions(+), 120 deletions(-) diff --git a/.drone.yml b/.drone.yml index 40fc93e..4b29a48 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,51 +8,50 @@ platform: arch: arm64 steps: -- name: helm lint - pull: always - image: alpine:3.17 - commands: - - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm - - helm lint + - name: helm lint + pull: always + image: alpine:3.17 + commands: + - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm + - helm lint -- name: helm template - pull: always - image: alpine:3.17 - commands: - - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm - - helm dependency update - - helm template --debug gitea-helm . + - name: helm template + pull: always + image: alpine:3.17 + commands: + - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm + - helm dependency update + - helm template --debug gitea-helm . -- name: helm unittests - pull: always - image: alpine:3.17 - commands: - - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make helm git bash - - helm plugin install https://github.com/heyhabito/helm-unittest - - helm dependency update - - make unittests + - name: helm unittests + pull: always + image: alpine:3.17 + commands: + - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make helm git bash + - helm plugin install https://github.com/heyhabito/helm-unittest + - helm dependency update + - make unittests -- name: verify readme - pull: always - image: alpine:3.17 - commands: - - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make npm git - - make readme - - git diff --exit-code --name-only README.md - -- name: discord - pull: always - image: appleboy/drone-discord:1.2.4 - environment: - DISCORD_WEBHOOK_ID: - from_secret: discord_webhook_id - DISCORD_WEBHOOK_TOKEN: - from_secret: discord_webhook_token - when: - status: - - changed - - failure + - name: verify readme + pull: always + image: alpine:3.17 + commands: + - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make npm git + - make readme + - git diff --exit-code --name-only README.md + - name: discord + pull: always + image: appleboy/drone-discord:1.2.4 + environment: + DISCORD_WEBHOOK_ID: + from_secret: discord_webhook_id + DISCORD_WEBHOOK_TOKEN: + from_secret: discord_webhook_token + when: + status: + - changed + - failure --- kind: pipeline @@ -65,40 +64,40 @@ platform: trigger: event: - - tag + - tag steps: -- name: generate-chart - pull: always - image: alpine:3.17 - commands: - - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm - - apk add --no-cache curl - - helm dependency update - - helm package --version "${DRONE_TAG##v}" ./ - - mkdir gitea - - mv gitea*.tgz gitea/ - - curl -L -o gitea/index.yaml https://dl.gitea.io/charts/index.yaml - - helm repo index gitea/ --url https://dl.gitea.io/charts --merge gitea/index.yaml + - name: generate-chart + pull: always + image: alpine:3.17 + commands: + - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm + - apk add --no-cache curl + - helm dependency update + - helm package --version "${DRONE_TAG##v}" ./ + - mkdir gitea + - mv gitea*.tgz gitea/ + - curl -L -o gitea/index.yaml https://dl.gitea.io/charts/index.yaml + - helm repo index gitea/ --url https://dl.gitea.io/charts --merge gitea/index.yaml -- name: upload-chart - pull: always - image: plugins/s3:latest - settings: - acl: - from_secret: aws_s3_acl - region: - from_secret: aws_s3_region - bucket: - from_secret: aws_s3_bucket - endpoint: - from_secret: aws_s3_endpoint - path_style: - from_secret: aws_s3_path_style - access_key: - from_secret: aws_access_key_id - secret_key: - from_secret: aws_secret_access_key - source: gitea/* - target: /charts - strip_prefix: gitea/ + - name: upload-chart + pull: always + image: plugins/s3:latest + settings: + acl: + from_secret: aws_s3_acl + region: + from_secret: aws_s3_region + bucket: + from_secret: aws_s3_bucket + endpoint: + from_secret: aws_s3_endpoint + path_style: + from_secret: aws_s3_path_style + access_key: + from_secret: aws_access_key_id + secret_key: + from_secret: aws_secret_access_key + source: gitea/* + target: /charts + strip_prefix: gitea/ diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 6320f35..5f3886c 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -129,14 +129,14 @@ MD041: MD044: # List of proper names names: - - Gitea - - PostgreSQL - - MariaDB - - MySQL - - Memcached - - Prometheus - - Git - - GitOps + - Gitea + - PostgreSQL + - MariaDB + - MySQL + - Memcached + - Prometheus + - Git + - GitOps # Include code blocks code_blocks: false diff --git a/Chart.lock b/Chart.lock index bf9e60f..ede5ee7 100644 --- a/Chart.lock +++ b/Chart.lock @@ -1,15 +1,15 @@ dependencies: -- name: memcached - repository: oci://registry-1.docker.io/bitnamicharts - version: 6.3.7 -- name: mysql - repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami - version: 6.14.10 -- name: postgresql - repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami - version: 10.3.17 -- name: mariadb - repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami - version: 9.3.6 + - name: memcached + repository: oci://registry-1.docker.io/bitnamicharts + version: 6.3.7 + - name: mysql + repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami + version: 6.14.10 + - name: postgresql + repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami + version: 10.3.17 + - name: mariadb + repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami + version: 9.3.6 digest: sha256:eb786e862718ddd8c66d66b0a7d3501bd7fbb3c8edef12a406c9544159971965 generated: "2023-02-26T13:51:59.1429398+01:00" diff --git a/Chart.yaml b/Chart.yaml index 4f0bc4c..1fcb7be 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -31,21 +31,21 @@ maintainers: # Bitnami charts are served from GitHub CDN - See https://github.com/bitnami/charts/issues/10539 for details dependencies: -# OCI registry: https://blog.bitnami.com/2023/01/bitnami-helm-charts-available-as-oci.html (2023-01) -# Chart release date: 2023-02 -- name: memcached - repository: oci://registry-1.docker.io/bitnamicharts - version: 6.3.7 - condition: memcached.enabled -- name: mysql - repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami - version: 6.14.10 - condition: mysql.enabled -- name: postgresql - repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami - version: 10.3.17 - condition: postgresql.enabled -- name: mariadb - repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami - version: 9.3.6 - condition: mariadb.enabled + # OCI registry: https://blog.bitnami.com/2023/01/bitnami-helm-charts-available-as-oci.html (2023-01) + # Chart release date: 2023-02 + - name: memcached + repository: oci://registry-1.docker.io/bitnamicharts + version: 6.3.7 + condition: memcached.enabled + - name: mysql + repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami + version: 6.14.10 + condition: mysql.enabled + - name: postgresql + repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami + version: 10.3.17 + condition: postgresql.enabled + - name: mariadb + repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami + version: 9.3.6 + condition: mariadb.enabled diff --git a/unittests/statefulset/basic.yaml b/unittests/statefulset/basic.yaml index 00fb684..047067b 100644 --- a/unittests/statefulset/basic.yaml +++ b/unittests/statefulset/basic.yaml @@ -12,6 +12,6 @@ tests: - hasDocuments: count: 1 - containsDocument: - kind: StatefulSet + kind: StatefulSet apiVersion: apps/v1 name: gitea-unittests diff --git a/values.yaml b/values.yaml index 1d25a82..0f78c11 100644 --- a/values.yaml +++ b/values.yaml @@ -125,7 +125,6 @@ service: loadBalancerSourceRanges: [] annotations: {} - ## @section Ingress ## @param ingress.enabled Enable ingress ## @param ingress.className Ingress class name @@ -139,7 +138,8 @@ ingress: enabled: false # className: nginx className: - annotations: {} + annotations: + {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: @@ -158,7 +158,8 @@ ingress: ## @section StatefulSet # ## @param resources Kubernetes resources -resources: {} +resources: + {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following @@ -193,7 +194,8 @@ dnsConfig: {} ## @param statefulset.labels Labels for the statefulset ## @param statefulset.annotations Annotations for the Gitea StatefulSet to be created statefulset: - env: [] + env: + [] # - name: VARIABLE # value: my-value terminationGracePeriodSeconds: 60 @@ -294,7 +296,8 @@ gitea: # prometheus-release: prom1 ## @param gitea.ldap LDAP configuration - ldap: [] + ldap: + [] # - name: "LDAP 1" # existingSecret: # securityProtocol: @@ -311,7 +314,8 @@ gitea: # Either specify inline `key` and `secret` or refer to them via `existingSecret` ## @param gitea.oauth OAuth configuration - oauth: [] + oauth: + [] # - name: 'OAuth 1' # provider: # key: -- 2.40.1 From 66fc2fe7a99cf1439b12e1c6d2cb0a43a812c299 Mon Sep 17 00:00:00 2001 From: pat-s Date: Tue, 21 Mar 2023 09:59:46 +0100 Subject: [PATCH 2/4] yamllint --- .drone.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.drone.yml b/.drone.yml index 4b29a48..780fa9c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -40,6 +40,12 @@ steps: - make readme - git diff --exit-code --name-only README.md + - name: yaml lint + pull: always + image: cytopia/yamllint:alpine-1 + commands: + - yamllint -f colored . + - name: discord pull: always image: appleboy/drone-discord:1.2.4 -- 2.40.1 From 913acc827253fca3eccaea29c260c6a55225ed42 Mon Sep 17 00:00:00 2001 From: pat-s Date: Tue, 21 Mar 2023 10:09:43 +0100 Subject: [PATCH 3/4] yamllint --- .yamllint | 20 ++++++++++++++++++++ values.yaml | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .yamllint diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..90128be --- /dev/null +++ b/.yamllint @@ -0,0 +1,20 @@ +--- +extends: default + +ignore: | + .yamllint + node_modules + templates + + +rules: + truthy: + allowed-values: ['true', 'false'] + check-keys: False + level: error + line-length: disable + document-start: disable + comments: + min-spaces-from-content: 1 + braces: + max-spaces-inside: 2 \ No newline at end of file diff --git a/values.yaml b/values.yaml index 0f78c11..2591fb3 100644 --- a/values.yaml +++ b/values.yaml @@ -280,7 +280,7 @@ gitea: ## @param gitea.admin.password Password for the Gitea admin user ## @param gitea.admin.email Email for the Gitea admin user admin: - #existingSecret: gitea-admin-secret + # existingSecret: gitea-admin-secret existingSecret: username: gitea_admin password: r8sA8CPHD9!bt6d -- 2.40.1 From 1855cfd214e7f116f9a79d4796f8caf1c7ac6bf1 Mon Sep 17 00:00:00 2001 From: pat-s Date: Tue, 21 Mar 2023 10:14:38 +0100 Subject: [PATCH 4/4] trailing space --- unittests/init/basic.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/init/basic.yaml b/unittests/init/basic.yaml index f2b746e..25027f5 100644 --- a/unittests/init/basic.yaml +++ b/unittests/init/basic.yaml @@ -10,6 +10,6 @@ tests: - hasDocuments: count: 1 - containsDocument: - kind: Secret + kind: Secret apiVersion: v1 name: gitea-unittests-init -- 2.40.1