Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
NEXUS-34974 Publish nxrm helm charts to Sonatype helm repo and Artifa…
Browse files Browse the repository at this point in the history
…ct Hub
  • Loading branch information
userSeprid committed Sep 13, 2022
1 parent 595206f commit 8123c3d
Show file tree
Hide file tree
Showing 24 changed files with 1,444 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile-Release
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ dockerizedBuildPipeline(
buildAndTest: {
sonatypeZionGitConfig()
runSafely "git checkout ${gitBranch(env)}"
//runSafely "./upgrade.sh ./nexus-repository-manager ${chartVersion} ${params.appVersion}"
runSafely "./upgrade.sh ./nexus-repository-manager ${chartVersion} ${params.appVersion}"
runSafely "./upgrade.sh ./nxrm-aws-resiliency ${chartVersion} ${params.appVersion}"
runSafely './build.sh'
runSafely 'git add nxrm-aws-resiliency'
//runSafely 'git add nexus-repository-manager'
runSafely 'git add nexus-repository-manager'
},
skipVulnerabilityScan: true,
archiveArtifacts: 'docs/*',
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ set -e

# lint yaml of charts
helm lint ./nxrm-aws-resiliency
#helm lint ./nexus-repository-manager
helm lint ./nexus-repository-manager

# unit test
#(cd ./nxrm-aws-resiliency; helm unittest -3 -t junit -o test-output.xml .)
#(cd ./nexus-repository-manager; helm unittest -3 -t junit -o test-output.xml .)

# package the charts into tgz archives
helm package ./nxrm-aws-resiliency --destination docs
#helm package ./nexus-repository-manager --destination docs
helm package ./nexus-repository-manager --destination docs
24 changes: 24 additions & 0 deletions nexus-repository-manager/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
# OWNERS file for Kubernetes
OWNERS
*.tar
40 changes: 40 additions & 0 deletions nexus-repository-manager/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: v2
name: nexus-repository-manager

# 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.
version: 41.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 3.41.1

description: Sonatype Nexus Repository Manager - Universal Binary repository

# 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

keywords:
- artifacts
- dependency
- management
- sonatype
- nexus
- repository
- quickstart
- ci
- repository-manager
- nexus3
home: https://www.sonatype.com/nexus-repository-oss
icon: https://sonatype.github.io/helm3-charts/NexusRepo_Vertical.svg
sources:
- https://github.com/sonatype/nexus-public
maintainers:
- email: support@sonatype.com
name: Sonatype
13 changes: 13 additions & 0 deletions nexus-repository-manager/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2020-present Sonatype, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
212 changes: 212 additions & 0 deletions nexus-repository-manager/README.md

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions nexus-repository-manager/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.ingress.enabled }}
1. Your ingresses are available here:
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $.Values.ingress.hostRepo }}{{ $.Values.ingress.hostPath }}
{{- if $.Values.nexus.docker.enabled }}
{{- range $registry := .Values.nexus.docker.registries }}
https://{{ $registry.host }}/
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
1. Get the application URL by running these commands:
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "nexus.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
Your application is available at http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
1. Get the application URL by running these commands:
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "nexus.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "nexus.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
{{- range $index, $port := .Values.service.ports }}
Your application is available at http://$SERVICE_IP:{{ $port }}
{{- end }}
{{- else if contains "ClusterIP" .Values.service.type }}
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "nexus.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8081:80
Your application is available at http://127.0.0.1
{{- end }}
63 changes: 63 additions & 0 deletions nexus-repository-manager/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "nexus.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "nexus.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "nexus.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "nexus.labels" -}}
helm.sh/chart: {{ include "nexus.chart" . }}
{{ include "nexus.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Selector labels
*/}}
{{- define "nexus.selectorLabels" -}}
app.kubernetes.io/name: {{ include "nexus.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "nexus.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "nexus.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
17 changes: 17 additions & 0 deletions nexus-repository-manager/templates/configmap-properties.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.nexus.properties.override -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "nexus.name" . }}-properties
labels: {{- include "nexus.labels" . | nindent 4 }}
{{- if .Values.nexus.extraLabels }}
{{- with .Values.nexus.extraLabels }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
data:
nexus.properties: |
{{- range $k, $v := .Values.nexus.properties.data }}
{{ $k }}={{ $v }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions nexus-repository-manager/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.config.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "nexus.name" . }}-conf
labels:
{{ include "nexus.labels" . | indent 4 }}
{{- if .Values.nexus.extraLabels }}
{{- with .Values.nexus.extraLabels }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
data:
{{ toYaml .Values.config.data | indent 2 }}
{{- end }}
Loading

0 comments on commit 8123c3d

Please # to comment.