Merge pull request #9 from sonatype/NEXUS-34129-single-jenkins-job-for-resiliency-and-non-resiliency-helm-charts
NEXUS-34129 - Combined Jenkins job to publish AWS resilient and non resilient helm charts
This commit is contained in:
51 files changed
+312
-88
No files matched your search
@@ -0,0 +1,6 @@
|
||||
.vs/**
|
||||
.idea/**
|
||||
|
||||
**/test-output.xml
|
||||
|
||||
.DS_Store
|
||||
+14
-11
@@ -1,17 +1,20 @@
|
||||
#
|
||||
# Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
||||
# Includes the third-party code listed at http://links.sonatype.com/products/clm/attributions.
|
||||
# "Sonatype" is a trademark of Sonatype, Inc.
|
||||
# Sonatype Nexus (TM) Open Source Version
|
||||
# Copyright (c) 2008-present Sonatype, Inc.
|
||||
# All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
#
|
||||
# This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
# which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
#
|
||||
# Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
# of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
# Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
#
|
||||
|
||||
# FROM docker-all.repo.sonatype.com/alpine:latest
|
||||
# LABEL maintainer="operations-group@sontype.com"
|
||||
FROM docker-all.repo.sonatype.com/alpine/helm:3.9.3
|
||||
|
||||
# RUN apk update
|
||||
RUN apk update && apk upgrade && \
|
||||
apk add --no-cache bash git openssh
|
||||
|
||||
# WORKDIR /app
|
||||
# COPY ./src ./
|
||||
RUN mkdir /.local /.cache && chmod 777 /.local /.cache
|
||||
|
||||
# EXPOSE 8080
|
||||
|
||||
# CMD ["./runit"]
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Sonatype Nexus (TM) Open Source Version
|
||||
* Copyright (c) 2008-present Sonatype, Inc.
|
||||
* All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
* which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
*
|
||||
* Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
* Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
*/
|
||||
@Library(['private-pipeline-library', 'jenkins-shared', 'nxrm-jenkins-shared']) _
|
||||
|
||||
dockerizedBuildPipeline(
|
||||
prepare: {
|
||||
githubStatusUpdate('pending')
|
||||
},
|
||||
buildAndTest: {
|
||||
sh './build.sh'
|
||||
},
|
||||
skipVulnerabilityScan: true,
|
||||
archiveArtifacts: 'docs/*',
|
||||
testResults: ['**/test-output.xml'],
|
||||
onSuccess: {
|
||||
nxrmBuildNotifications(currentBuild, env)
|
||||
},
|
||||
onFailure: {
|
||||
nxrmBuildNotifications(currentBuild, env)
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright (c) 2020-present Sonatype, Inc. All rights reserved.
|
||||
*
|
||||
* This program is licensed to you under the Apache License Version 2.0,
|
||||
* and you may not use this file except in compliance with the Apache License Version 2.0.
|
||||
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Apache License Version 2.0 is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
|
||||
*/
|
||||
@Library(['private-pipeline-library', 'jenkins-shared', 'nxrm-jenkins-shared']) _
|
||||
|
||||
final jira = [
|
||||
versionPrefix: '', project: 'NEXUS', projectId: '12410',
|
||||
credentialId : 'jenkins-jira', autoRelease: true, failOnError: true
|
||||
]
|
||||
|
||||
final jiraVersionMappings = [
|
||||
'nexus-repository-manager': 'helm-nxrm',
|
||||
'nxrm-aws-resiliency': 'helm-nxrm-aws-resiliency'
|
||||
]
|
||||
|
||||
final chartLocation = [
|
||||
'nexus-repository-manager': 'nexus-repository-manager',
|
||||
'nxrm-aws-resiliency': 'nxrm-aws-resiliency'
|
||||
]
|
||||
|
||||
properties([
|
||||
parameters([
|
||||
string(
|
||||
name: 'appVersion',
|
||||
description: 'Version of the application image, like "3.41.0"',
|
||||
),
|
||||
string(
|
||||
name: 'chartVersion',
|
||||
description: '(Optional) Version of the Chart, like "41.0.0". If omitted, it will be calculated from the appVersion.',
|
||||
),
|
||||
])
|
||||
])
|
||||
|
||||
final chartVersion = calculateChartVersion(params.chartVersion, params.appVersion)
|
||||
|
||||
dockerizedBuildPipeline(
|
||||
prepare: {
|
||||
if (! params.appVersion) {
|
||||
error('The appVersion is required.')
|
||||
}
|
||||
githubStatusUpdate('pending')
|
||||
},
|
||||
buildAndTest: {
|
||||
sonatypeZionGitConfig()
|
||||
runSafely "git checkout ${gitBranch(env)}"
|
||||
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 nexus-repository-manager'
|
||||
},
|
||||
skipVulnerabilityScan: true,
|
||||
archiveArtifacts: 'docs/*',
|
||||
testResults: [],
|
||||
deployCondition: { true },
|
||||
deploy: {
|
||||
runSafely 'git add docs'
|
||||
runSafely "git commit -m 'Release Update for ${chartVersion}'"
|
||||
|
||||
sshagent(credentials: [sonatypeZionCredentialsId()]) {
|
||||
runSafely 'git push'
|
||||
}
|
||||
},
|
||||
postDeploy: {
|
||||
// Create tags
|
||||
String tagName = "${chartVersion}"
|
||||
runSafely "git tag -a ${tagName} -m 'Release Update: ${chartVersion}'"
|
||||
sshagent(credentials: [sonatypeZionCredentialsId()]) {
|
||||
runSafely "git push origin ${tagName}"
|
||||
}
|
||||
},
|
||||
onSuccess: {
|
||||
nxrmBuildNotifications(currentBuild, env)
|
||||
},
|
||||
onFailure: {
|
||||
nxrmBuildNotifications(currentBuild, env)
|
||||
}
|
||||
)
|
||||
|
||||
String calculateChartVersion(final String chartVersion, final String appVersion) {
|
||||
if (chartVersion) {
|
||||
return chartVersion
|
||||
}
|
||||
|
||||
if (! appVersion) {
|
||||
error 'Failed to calculate chartVersion with no appVersion.'
|
||||
}
|
||||
|
||||
final versionParts = parseVersionString(appVersion)
|
||||
final chartMajor = versionParts[1]
|
||||
final chartMinor = versionParts[2]
|
||||
|
||||
if (! chartMajor || ! chartMinor) {
|
||||
error "Failed to calculate chartVersion from appVersion: ${appVersion}"
|
||||
}
|
||||
|
||||
return [chartMajor, chartMinor, '0'].join('.')
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
||||
Includes the third-party code listed at http://links.sonatype.com/products/clm/attributions.
|
||||
"Sonatype" is a trademark of Sonatype, Inc.
|
||||
-->
|
||||
|
||||
## Overview
|
||||
Overview of the service: what is it, why do we have it, who are the primary
|
||||
contacts, how to report bugs, links to design docs and other relevant
|
||||
information.
|
||||
|
||||
### Public Facing Endpoints
|
||||
The URLs (or IPs) and ports used by the service and what they are used for
|
||||
(ALB? SSH? FTP?) and notes about any certificates and their location.
|
||||
|
||||
## Monitoring
|
||||
|
||||
Monitoring dashboards / logging / introspection & obseverbility info.
|
||||
|
||||
### Runbooks
|
||||
|
||||
A list of every alert your monitoring system may generate for this service and
|
||||
a step-by-step "what do to when..." for each of them.
|
||||
|
||||
### SLO
|
||||
Service Level Objectives in a succinct format: a target value or range of
|
||||
values for a service level that is measured by an SLI. A natural structure for
|
||||
SLOs is thus SLI ≤ target, or lower bound ≤ SLI ≤ upper bound. For example, we
|
||||
might decide that we will return Shakespeare search results "quickly," adopting
|
||||
an SLO that our average search request latency should be less than 100
|
||||
milliseconds.
|
||||
|
||||
For more detailed information, please check out the Service Level Objectives
|
||||
doc. If you're still unsure of what your SLOs should be, please reach out to
|
||||
the SREs at #ops-sre-chat.
|
||||
|
||||
Optionally but recommended, have a section of monitoring and dashboards for SLO
|
||||
tracking (see the auth-service OpsDoc for examples of dashboards).
|
||||
|
||||
## Build
|
||||
|
||||
How to build the software that makes the service. Where to download it from,
|
||||
where the source code repository is, steps for building and making a package or
|
||||
other distribution mechanisms. If it is software that you modify in any way
|
||||
(open source project you contribute to or a local project) include instructions
|
||||
for how a new developer gets started. Ideally the end result is a package that
|
||||
can be copied to other machines for installation.
|
||||
|
||||
## Deploy
|
||||
|
||||
How to deploy the service. How to build something from scratch: RAM/disk
|
||||
requirements, OS version and configuration, what packages to install, and so
|
||||
on. If this is automated with a configuration management tool like ansible/etc,
|
||||
then say so.
|
||||
|
||||
## Common Tasks
|
||||
|
||||
Step-by-step instructions for common things like provisioning
|
||||
(add/change/delete), common problems and their solutions, and so on.
|
||||
|
||||
## DR
|
||||
Where are backups of data stored? What are disaster / data recovery
|
||||
procedures?
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
<!--
|
||||
|
||||
Sonatype Nexus (TM) Open Source Version
|
||||
Copyright (c) 2008-present Sonatype, Inc.
|
||||
All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
|
||||
This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
|
||||
Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
|
||||
-->
|
||||
|
||||
## Helm Charts for Sonatype Nexus Repository Manager 3
|
||||
|
||||
We provide Helm charts for two different deployment scenarios:
|
||||
|
||||
+10
-4
@@ -1,11 +1,17 @@
|
||||
<!--
|
||||
|
||||
Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
||||
Includes the third-party code listed at http://links.sonatype.com/products/clm/attributions.
|
||||
"Sonatype" is a trademark of Sonatype, Inc.
|
||||
Sonatype Nexus (TM) Open Source Version
|
||||
Copyright (c) 2008-present Sonatype, Inc.
|
||||
All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
|
||||
This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
|
||||
Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
|
||||
-->
|
||||
|
||||
# Reporting Security Vulnerabilities
|
||||
|
||||
## When to report
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Sonatype Nexus (TM) Open Source Version
|
||||
# Copyright (c) 2008-present Sonatype, Inc.
|
||||
# All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
#
|
||||
# This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
# which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
#
|
||||
# Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
# of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
# Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
#
|
||||
|
||||
helm plugin install https://github.com/quintush/helm-unittest
|
||||
|
||||
set -e
|
||||
|
||||
# lint yaml of charts
|
||||
helm lint ./nxrm-aws-resiliency
|
||||
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
|
||||
Binary file not shown.
Binary file not shown.
+10
-3
@@ -1,3 +1,10 @@
|
||||
Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
||||
Includes the third-party code listed at http://links.sonatype.com/products/clm/attributions.
|
||||
"Sonatype" is a trademark of Sonatype, Inc.
|
||||
Sonatype Nexus (TM) Open Source Version
|
||||
Copyright (c) 2008-present Sonatype, Inc.
|
||||
All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
|
||||
This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
|
||||
Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
File renamed without changes.
@@ -3,10 +3,10 @@ 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: 38.1.0
|
||||
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.38.1
|
||||
appVersion: 3.41.1
|
||||
|
||||
description: Sonatype Nexus Repository Manager - Universal Binary repository
|
||||
|
||||
File renamed without changes.
@@ -1,3 +1,18 @@
|
||||
<!--
|
||||
|
||||
Sonatype Nexus (TM) Open Source Version
|
||||
Copyright (c) 2008-present Sonatype, Inc.
|
||||
All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
|
||||
This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
|
||||
Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
|
||||
-->
|
||||
|
||||
# Nexus Repository
|
||||
|
||||
[Nexus Repository OSS](https://www.sonatype.com/nexus-repository-oss) provides universal support for all major build tools.
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -7,7 +7,7 @@ deploymentStrategy: Recreate
|
||||
image:
|
||||
# Sonatype Official Public Image
|
||||
repository: sonatype/nexus3
|
||||
tag: 3.38.1
|
||||
tag: 3.41.1
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
nexus:
|
||||
@@ -1,6 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: nxrm-aws-resiliency
|
||||
description: Helm chart for a Resilient Nexus Repository deployment in AWS
|
||||
description: Resilient AWS Deployment of Sonatype Nexus Repository Manager - Universal Binary repository
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
@@ -21,4 +21,21 @@ version: 41.1.0
|
||||
# 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: "3.41.1"
|
||||
appVersion: 3.41.1
|
||||
|
||||
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
|
||||
maintainers:
|
||||
- name: Sonatype
|
||||
|
||||
File renamed without changes.
@@ -1,3 +1,18 @@
|
||||
<!--
|
||||
|
||||
Sonatype Nexus (TM) Open Source Version
|
||||
Copyright (c) 2008-present Sonatype, Inc.
|
||||
All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
|
||||
This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
|
||||
Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
|
||||
-->
|
||||
|
||||
# Helm Chart for a Resilient Nexus Repository Deployment in AWS
|
||||
|
||||
This Helm chart configures the Kubernetes resources that are needed for a resilient Nexus Repository deployment on AWS as described in our documented [single-node cloud resilient deployment example using AWS](https://help.sonatype.com/repomanager3/planning-your-implementation/resiliency-and-high-availability/single-node-cloud-resilient-deployment-example-using-aws).
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Sonatype Nexus (TM) Open Source Version
|
||||
# Copyright (c) 2008-present Sonatype, Inc.
|
||||
# All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
#
|
||||
# This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
# which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
#
|
||||
# Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
# of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
# Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
#
|
||||
|
||||
if [ $# != 3 ]; then
|
||||
echo "Usage: $0 <dir> <chart-version> <app-version>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DIR="$1"
|
||||
CHART_VERSION="$2"
|
||||
APP_VERSION="$3"
|
||||
|
||||
OUTPUT_FILE=$(mktemp)
|
||||
|
||||
cat "$DIR/Chart.yaml" \
|
||||
| sed -E "s/version: .+/version: $CHART_VERSION/" \
|
||||
| sed -E "s/appVersion: .+/appVersion: $APP_VERSION/" \
|
||||
> "$OUTPUT_FILE"
|
||||
|
||||
mv "$OUTPUT_FILE" "$DIR/Chart.yaml"
|
||||
|
||||
cat "$DIR/values.yaml" \
|
||||
| sed -E "s/^ tag: .+$/ tag: $APP_VERSION/" \
|
||||
> "$OUTPUT_FILE"
|
||||
|
||||
mv "$OUTPUT_FILE" "$DIR/values.yaml"
|
||||
|
||||
git diff "$DIR"
|
||||
Reference in new issue
Block a user