Skip to content

Commit

Permalink
INT-4170 publish helm repo (#47)
Browse files Browse the repository at this point in the history
* move site into /docs for easier deploy
* move all chart archives into /docs
* regenerate index.yaml
* doc updates
* align license headers: 2020, apache2

Co-authored-by: Kelly <[email protected]>
  • Loading branch information
jflinchbaugh and kellyrob99 authored Jan 28, 2021
1 parent cd18f9c commit 16d26fb
Show file tree
Hide file tree
Showing 54 changed files with 1,343 additions and 18 deletions.
32 changes: 32 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* 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', 'int-jenkins-shared']) _

dockerizedBuildPipeline(
prepare: {
githubStatusUpdate('pending')
},
buildImageId: 'docker-all.repo.sonatype.com/alpine/helm:3.5.0',
buildAndTest: {
sh './build.sh'
},
skipVulnerabilityScan: true,
archiveArtifacts: 'docs/*',
testResults: [],
onSuccess: {
buildNotifications(currentBuild, env, 'master')
},
onFailure: {
buildNotifications(currentBuild, env, 'master')
}
)
45 changes: 45 additions & 0 deletions Jenkinsfile-Release
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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', 'int-jenkins-shared']) _

dockerizedBuildPipeline(
prepare: {
githubStatusUpdate('pending')
},
buildImageId: 'docker-all.repo.sonatype.com/alpine/helm',
buildAndTest: {
sh './build.sh'
},
skipVulnerabilityScan: true,
archiveArtifacts: 'docs/*',
testResults: [],
deployCondition: { true },
deploy: {
final branch = gitBranch(env)

sh """
git config --global user.email '[email protected]'
git config --global user.name 'Sonatype CI'

git checkout ${branch}
git commit -a -m 'Release Update'
git push
"""
},
onSuccess: {
buildNotifications(currentBuild, env, 'master')
},
onFailure: {
buildNotifications(currentBuild, env, 'master')
}
)
58 changes: 42 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,47 @@ These charts are designed to work out of the box with minikube using both ingess

The current releases have been tested on minikube v1.12.3 running k8s v1.18.3

### To Add as a Helm Repo
### User Documentation

```helm repo add sonatype https://sonatype.github.io/helm3-charts/ ```
See docs/index.md which is also https://sonatype.github.io/helm3-charts/

### To install
### Updating Charts

NXRM
```helm install nexus-repo sonatype/nexus-repository-manager```
Charts for Nexus IQ and for NXRM can be updated in `charts/` directories.
The most common updates will be to use new application images and to bump
chart versions for release.

Nexus IQ
``` helm install nexus-iq sonatype/nexus-iq-server```
There should likely be no reason to update anything in `docs/` by hand.

### Resolver file and Ingress-DNS
Test a chart in a local k8s cluster (like minikube) by installing the local copy
from within each charts directory:
```
helm install ./
```

### Packaging and Indexing

*Sonatype CI build will package, commit, and publish to the official helm repository.*

Upon update of the `charts/`, run `build.sh` from here in the project root to
create `tgz` packages of the latest chart changes and regenerate the `index.yaml`
file to the `docs/` directory which is the root of the
[repo site](https://sonatype.github.io/helm3-charts/).

The build process requires Helm 3.

``` helm install nexus-iq sonatype/nexus-iq-server -f iq-values.yaml```
...or...
```helm install nexus-repo sonatype/nexus-repository-manager -f repo-values.yaml```
### Further Notes on Usage

If you want to use the custom values file for the demo environment that expose the apps on a local domain of *.demo which is done by creating a resolver file. On my Mac ghat is at /etc/resolver/minikube-minikube-demo with the following entries:
#### Resolver File and Ingress-DNS

Use the sample values files provided here.

- `helm install nexus-iq sonatype/nexus-iq-server -f iq-values.yaml`
- `helm install nexus-repo sonatype/nexus-repository-manager -f repo-values.yaml`

If you want to use the custom values file for the demo environment that expose
the apps on a local domain of *.demo which is done by creating a resolver file.
On a Mac it's `/etc/resolver/minikube-minikube-demo` with the following entries:
```
domain demo
nameserver 192.168.64.8
Expand All @@ -33,11 +55,15 @@ timeout 5
```

You'll need to update the IP address to match the running instance's IP address.
Use ```minikube ip`` to get the address
Use `minikube ip` to get the address

Docs for Ingress-dns are here
https://github.com/kubernetes/minikube/tree/master/deploy/addons/ingress-dns

### 413 Errors
The default setting for Nginx allows for very small upload sizes. Add this annotation to the ingress for each product to remove teh limit:
```nginx.ingress.kubernetes.io/proxy-body-size: "0"```
#### 413 Errors with Nginx

The default setting for Nginx allows for very small upload sizes. Add this annotation to the ingress
for each product to remove the limit:
```
nginx.ingress.kubernetes.io/proxy-body-size: "0"
```
27 changes: 27 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh
#
# 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.
#

set -e

# lint yaml of charts
helm lint charts/nexus-iq
helm lint charts/nexus-repository-manager

# package the charts into tgz archives
helm package charts/nexus-iq --destination docs
helm package charts/nexus-repository-manager --destination docs

# index the existing tgz archives
cd docs
helm repo index . --url https://sonatype.github.io/helm3-charts
2 changes: 1 addition & 1 deletion charts/nexus-iq/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-present Sonatype, Inc.
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.
Expand Down
2 changes: 1 addition & 1 deletion charts/nexus-repository-manager/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-present Sonatype, Inc.
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.
Expand Down
19 changes: 19 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Helm3 Charts for Sonatype Products

These charts are designed to work out of the box with minikube using both Ingress
and Ingress DNS addons.

The current releases have been tested on minikube v1.12.3 running k8s v1.18.3

### Add as a Helm Repo

`helm repo add sonatype https://sonatype.github.io/helm3-charts/`

### Install a Server

- NXRM: `helm install nexus-repo sonatype/nexus-repository-manager`
- Nexus IQ: `helm install nexus-iq sonatype/nexus-iq-server`

### Source

Visit https://github.com/sonatype/helm3-charts.
Loading

0 comments on commit 16d26fb

Please sign in to comment.