diff --git a/.github/workflows/release-pullrequest.yaml b/.github/workflows/release-pullrequest.yaml index 2e09487..76509d5 100644 --- a/.github/workflows/release-pullrequest.yaml +++ b/.github/workflows/release-pullrequest.yaml @@ -59,17 +59,23 @@ jobs: echo APP_VERSION:${{steps.app_version.outputs.tag}} echo CHART_VERSION:${{steps.chart_version.outputs.tag}} - - name: Replace Version in Chart.yaml + - name: Replace CHART_VERSION in chart/Chart.yaml run: sed -i 's/CHART_VERSION/${{ steps.chart_version.outputs.tag }}/g' ./chart/Chart.yaml + - name: Replace CHART_VERSION in crd-chart/Chart.yaml + run: sed -i 's/CHART_VERSION/${{ steps.chart_version.outputs.tag }}/g' ./crd-chart/Chart.yaml + - name: Print latest App Version run: echo ${{ steps.app_version.outputs.tag }} - - name: Replace App Version in Chart.yaml + - name: Replace APP_VERSION in Chart.yaml run: sed -i 's/APP_VERSION/${{ steps.app_version.outputs.tag }}/g' ./chart/Chart.yaml - name: Set up Helm uses: azure/setup-helm@v4.1.0 + - name: Helm Dependency Update + run: helm dependency update ./chart + - name: Helm lint run: helm lint ./chart \ No newline at end of file diff --git a/chart/.helmignore b/chart/.helmignore deleted file mode 100644 index 056055d..0000000 --- a/chart/.helmignore +++ /dev/null @@ -1,4 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -samples/ diff --git a/chart/Chart.yaml b/chart/Chart.yaml index db6364d..b1ccfcf 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,8 +1,35 @@ apiVersion: v2 name: git-provider description: Krateo PlatformOps Git Provider + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application -icon: "https://github.com/projectkerberus/kerberus-dashboard/blob/main/docs/media/square_black_logo.png" +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) version: CHART_VERSION + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. appVersion: APP_VERSION + +home: https://krateo.io +icon: "https://github.com/krateoplatformops/krateo/blob/main/docs/media/logo.svg" + +sources: + - https://github.com/krateoplatformops/git-provider-chart + +dependencies: + - name: git-provider-crd + version: CHART_VERSION + repository: file://../crd-chart \ No newline at end of file diff --git a/chart/samples/claim.yaml b/chart/samples/claim.yaml deleted file mode 100644 index 00200ac..0000000 --- a/chart/samples/claim.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: git-provider-demo-claim - namespace: default -data: - json: | - { - "values": { - "api": "https://api-demo.krateo.io", - "destination": { - "owner": "aowner", - "repo": "arepo" - }, - "component_id": "app-id", - "description": "app-description", - "dbUsername": "dbUsername", - "owner": "owner", - "appUrl": "https://app-demo.krateo.io", - "apiUrl": "https://api-demo.krateo.io", - "subnetGroupName": "subnetGroupName", - "vpcSecurityGroup": "vpcSecurityGroup", - "repoUrl": "https://github.com/?owner=krateoplatformops&repo=sample-repo" - } - } \ No newline at end of file diff --git a/chart/samples/issue-1-branch-ignored.yaml b/chart/samples/issue-1-branch-ignored.yaml deleted file mode 100644 index b228f92..0000000 --- a/chart/samples/issue-1-branch-ignored.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: v1 -data: - organizationName: krateo -kind: ConfigMap -metadata: - name: test-diego-cm - namespace: default ---- -apiVersion: git.krateo.io/v1alpha1 -kind: Repo -metadata: - name: test-diego -spec: - configMapKeyRef: - key: data - name: test-diego-cm - namespace: default - fromRepo: - authMethod: basic - branch: krateo - path: src - secretRef: - key: token - name: github-auth - namespace: default - url: https://github.com/matteogastaldello/fromRepo - toRepo: - authMethod: basic - branch: main - path: src - secretRef: - key: token - name: github-auth - namespace: default - url: https://github.com/matteogastaldello/toRepo - unsupportedCapabilities: true \ No newline at end of file diff --git a/chart/samples/issue-refs-not-found.yaml b/chart/samples/issue-refs-not-found.yaml deleted file mode 100644 index 5e194c7..0000000 --- a/chart/samples/issue-refs-not-found.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: git.krateo.io/v1alpha1 -kind: Repo -metadata: - labels: - deploymentId: 70cd7df0-c350-4859-8354-3236f7c61af4 - name: test-issue-not-push -spec: - configMapKeyRef: - key: json - name: git-provider-demo-claim - namespace: default - fromRepo: - authMethod: basic - path: skeleton/spring01-pipeline - secretRef: - key: token - name: azuredevops-endpoint - namespace: default - url: https://Kiratech-BancaSella@dev.azure.com/Kiratech-BancaSella/Test-Sella/_git/krateo-template-microservice - toRepo: - authMethod: basic - branch: master - path: test-diego-12 - secretRef: - key: token - name: azuredevops-endpoint - namespace: default - url: https://Kiratech-BancaSella@dev.azure.com/Kiratech-BancaSella/Test-Sella/_git/pipeline - unsupportedCapabilities: true diff --git a/chart/samples/repo-gitcookies.yaml b/chart/samples/repo-gitcookies.yaml deleted file mode 100644 index 9e03ec8..0000000 --- a/chart/samples/repo-gitcookies.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: git.krateo.io/v1alpha1 -kind: Repo -metadata: - name: git-gcp -spec: - configMapKeyRef: - key: values - name: fw-replace-values - namespace: default - deletionPolicy: Orphan - enableUpdate: true - fromRepo: - authMethod: cookiefile - branch: main - cloneFromBranch: main - path: / - secretRef: - key: gitcookies - name: git-gcp-cookie - namespace: default - url: https://source.developers.google.com/p/buoyant-arcanum-425315-q1/r/git-auth - toRepo: - authMethod: generic - branch: main - path: / - usernameRef: - key: username - name: git-provider-username - namespace: default - secretRef: - key: token - name: git-provider - namespace: default - url: https://github.com/matteogastaldello/toRepo.git - - unsupportedCapabilities: true diff --git a/chart/samples/repo.yaml b/chart/samples/repo.yaml deleted file mode 100644 index e2ae072..0000000 --- a/chart/samples/repo.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: git.krateo.io/v1alpha1 -kind: Repo -metadata: - name: git-user -spec: - configMapKeyRef: - key: values - name: test-push-cm - namespace: default - deletionPolicy: Orphan - fromRepo: - authMethod: generic - branch: main - path: / - usernameRef: - key: username - name: github-username - namespace: default - secretRef: - key: token - name: github-auth - namespace: default - url: https://github.com/matteogastaldello/fromRepo - toRepo: - authMethod: generic - branch: main - cloneFromBranch: main - path: / - secretRef: - key: token - name: github-auth - namespace: default - usernameRef: - key: username - name: github-username - namespace: default - url: https://github.com/matteogastaldello/toRepo - unsupportedCapabilities: true diff --git a/chart/samples/template-microservice.yaml b/chart/samples/template-microservice.yaml deleted file mode 100644 index 98b74eb..0000000 --- a/chart/samples/template-microservice.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: git.krateo.io/v1alpha1 -kind: Repo -metadata: - name: template-microservice -spec: - unsupportedCapabilities: true - configMapKeyRef: - name: git-provider-demo-claim - namespace: default - key: json - fromRepo: - url: https://Kiratech-BancaSella@dev.azure.com/Kiratech-BancaSella/Test-Sella/_git/krateo-template-microservice - authMethod: basic - path: skeleton/spring01 - secretRef: - name: azuredevops-endpoint - namespace: default - key: token - toRepo: - url: https://Kiratech-BancaSella@dev.azure.com/Kiratech-BancaSella/Krateo%20Provider%20Project%20n.1/_git/template-microservice-test-1 - branch: master - authMethod: basic - secretRef: - name: azuredevops-endpoint - namespace: default - key: token diff --git a/chart/templates/configmap.yaml b/chart/templates/configmap.yaml index d379e3f..9a445a6 100644 --- a/chart/templates/configmap.yaml +++ b/chart/templates/configmap.yaml @@ -5,6 +5,6 @@ metadata: labels: {{- include "git-provider.labels" . | nindent 4 }} data: - GIT_PROVIDER_DEBUG: "{{ .Values.env.GIT_PROVIDER_DEBUG }}" - GIT_PROVIDER_POLL_INTERVAL: "{{ .Values.env.GIT_PROVIDER_POLL_INTERVAL }}" - GIT_PROVIDER_SERVICE_PORT_HACK: "{{ .Values.env.GIT_PROVIDER_SERVICE_PORT_HACK }}" + {{- range $key, $value := .Values.env }} + {{ $key }}: {{ $value | quote }} + {{- end }} \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml index 8ba5d70..6bf3558 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -81,3 +81,4 @@ env: GIT_PROVIDER_DEBUG: "false" GIT_PROVIDER_POLL_INTERVAL: "3m" GIT_PROVIDER_SERVICE_PORT_HACK: "false" + HOME: "/tmp" diff --git a/crd-chart/Chart.yaml b/crd-chart/Chart.yaml new file mode 100644 index 0000000..5fe33ff --- /dev/null +++ b/crd-chart/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: git-provider-crd +description: Krateo PlatformOps Git Provider CRDs + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: CHART_VERSION + +home: https://krateo.io +icon: "https://github.com/krateoplatformops/krateo/blob/main/docs/media/logo.svg" + +sources: + - https://github.com/krateoplatformops/git-provider-chart \ No newline at end of file diff --git a/chart/crds/git.krateo.io_repoes.yaml b/crd-chart/templates/git.krateo.io_repoes.yaml similarity index 99% rename from chart/crds/git.krateo.io_repoes.yaml rename to crd-chart/templates/git.krateo.io_repoes.yaml index 81cf0ef..31ce4f5 100644 --- a/chart/crds/git.krateo.io_repoes.yaml +++ b/crd-chart/templates/git.krateo.io_repoes.yaml @@ -328,4 +328,4 @@ spec: served: true storage: true subresources: - status: {} + status: {} \ No newline at end of file diff --git a/crd-chart/values.yaml b/crd-chart/values.yaml new file mode 100644 index 0000000..a5fe4ab --- /dev/null +++ b/crd-chart/values.yaml @@ -0,0 +1,3 @@ +# Default values for crd-chart. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. \ No newline at end of file