diff --git a/helmfile.d/sonatype-nexus.yaml.gotmpl b/helmfile.d/sonatype-nexus.yaml.gotmpl new file mode 100644 index 00000000..7e92523b --- /dev/null +++ b/helmfile.d/sonatype-nexus.yaml.gotmpl @@ -0,0 +1,42 @@ +bases: + - ../envs/environments.yaml.gotmpl + +repositories: + - name: sonatype-nexus + url: git+https://github.com/sonatype/helm3-charts@deploy?ref=master + +commonLabels: + tier: system + +releases: +- name: sonatype-nexus + namespace: sonatype-nexus + chart: sonatype-nexus/sonatype-nexus + condition: sonatype-nexus.enabled + values: + - ../values/sonatype-nexus/values/values.yaml + - ../values/sonatype-nexus/values/values-{{ .Environment.Name }}.yaml.gotmpl + postRenderer: ../bin/kustomizer + postRendererArgs: + - ../values/sonatype-nexus/kustomize/{{ .Environment.Name }} + missingFileHandler: Info +- name: manifests + namespace: sonatype-nexus + chart: manifests + condition: nsonatype-nexus.enabled + missingFileHandler: Info + values: + - ../values/env.yaml + - ../values/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml + - ../values/sonatype-nexus/env.yaml.gotmpl + - ../values/sonatype-nexus/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl + hooks: + - events: [ prepare, cleanup ] + showlogs: true + command: ../bin/helmify + args: + - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' + - '{{`{{ .Release.Chart }}`}}' + - '{{`{{ .Environment.Name }}`}}' + - ../values/sonatype-nexus/manifests + - manifests diff --git a/values/sonatype-nexus/env.yaml.gotmpl b/values/sonatype-nexus/env.yaml.gotmpl new file mode 100644 index 00000000..97051746 --- /dev/null +++ b/values/sonatype-nexus/env.yaml.gotmpl @@ -0,0 +1,3 @@ +sonatype-nexus: + enabled: true + autosync: true diff --git a/values/sonatype-nexus/manifests/sonatype-nexus.yaml b/values/sonatype-nexus/manifests/sonatype-nexus.yaml new file mode 100644 index 00000000..e217fb13 --- /dev/null +++ b/values/sonatype-nexus/manifests/sonatype-nexus.yaml @@ -0,0 +1,45 @@ +{{- if .Values.clusterConfig.argo.enabled }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: sonatype-nexus + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: cert-manager + server: 'https://kubernetes.default.svc' + sources: + - repoURL: {{ .Values.clusterConfig.manifests }} + targetRevision: HEAD + path: helmfile.d + plugin: + name: helmfile-cmp + env: + - name: CLUSTER_NAME + value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: sonatype-nexus.yaml.gotmpl + project: sys + ignoreDifferences: + - group: cert-manager.io + kind: Certificate + jqPathExpressions: + - '.spec.duration' + syncPolicy: + managedNamespaceMetadata: + labels: + component: sys + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true + - ServerSideApply=true + {{- if .Values.sonatype-nexus.autosync }} + automated: + prune: true + # selfHeal: false + {{- end }} +{{- end }} diff --git a/values/sonatype-nexus/values/values.yaml b/values/sonatype-nexus/values/values.yaml new file mode 100644 index 00000000..e69de29b