Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
Public export of Nexus Repository - Helm Plugin:
Browse files Browse the repository at this point in the history
  - c82bf96ddebfbd6afe465449ae5dd54d12e4d212 by Jeffry Hesse <jhesse@sonatype.com>

GitOrigin-RevId: c82bf96ddebfbd6afe465449ae5dd54d12e4d212
  • Loading branch information
DarthHater committed Sep 21, 2018
1 parent 6c334d8 commit ab646d9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ RUN cd /nexus-repository-helm/; sed -i "s/3.13.0-01/${NEXUS_VERSION}-${NEXUS_BUI
FROM sonatype/nexus3:$NEXUS_VERSION
ARG NEXUS_VERSION=3.13.0
ARG NEXUS_BUILD=01
ARG HELM_VERSION=0.0.3
ARG HELM_VERSION=0.0.4
ARG TARGET_DIR=/opt/sonatype/nexus/system/org/sonatype/nexus/plugins/nexus-repository-helm/${HELM_VERSION}/
USER root
RUN mkdir -p ${TARGET_DIR}; \
sed -i 's@nexus-repository-maven</feature>@nexus-repository-maven</feature>\n <feature prerequisite="false" dependency="false">nexus-repository-helm</feature>@g' /opt/sonatype/nexus/system/org/sonatype/nexus/assemblies/nexus-core-feature/${NEXUS_VERSION}-${NEXUS_BUILD}/nexus-core-feature-${NEXUS_VERSION}-${NEXUS_BUILD}-features.xml; \
sed -i 's@<feature name="nexus-repository-maven"@<feature name="nexus-repository-helm" description="org.sonatype.nexus.plugins:nexus-repository-helm" version="0.0.3">\n <details>org.sonatype.nexus.plugins:nexus-repository-helm</details>\n <bundle>mvn:org.sonatype.nexus.plugins/nexus-repository-helm/0.0.3</bundle>\n <bundle>mvn:org.apache.commons/commons-compress/1.16.1</bundle>\n </feature>\n <feature name="nexus-repository-maven"@g' /opt/sonatype/nexus/system/org/sonatype/nexus/assemblies/nexus-core-feature/${NEXUS_VERSION}-${NEXUS_BUILD}/nexus-core-feature-${NEXUS_VERSION}-${NEXUS_BUILD}-features.xml;
sed -i 's@<feature name="nexus-repository-maven"@<feature name="nexus-repository-helm" description="org.sonatype.nexus.plugins:nexus-repository-helm" version="0.0.4">\n <details>org.sonatype.nexus.plugins:nexus-repository-helm</details>\n <bundle>mvn:org.sonatype.nexus.plugins/nexus-repository-helm/0.0.4</bundle>\n <bundle>mvn:org.apache.commons/commons-compress/1.11</bundle>\n </feature>\n <feature name="nexus-repository-maven"@g' /opt/sonatype/nexus/system/org/sonatype/nexus/assemblies/nexus-core-feature/${NEXUS_VERSION}-${NEXUS_BUILD}/nexus-core-feature-${NEXUS_VERSION}-${NEXUS_BUILD}-features.xml;
COPY --from=build /nexus-repository-helm/target/nexus-repository-helm-${HELM_VERSION}.jar ${TARGET_DIR}
USER nexus
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ If everything checks out, the bundle for Helm should be available in the `target

#### Build with Docker

`docker build -t nexus-repository-helm:0.0.3 .`
`docker build -t nexus-repository-helm:0.0.4 .`

#### Run as a Docker container

`docker run -d -p 8081:8081 --name nexus nexus-repository-helm:0.0.3`
`docker run -d -p 8081:8081 --name nexus nexus-repository-helm:0.0.4`

For further information like how to persist volumes check out [the GitHub repo for our official image](https://github.com/sonatype/docker-nexus3).

Expand Down Expand Up @@ -81,7 +81,7 @@ good installation path if you are just testing or doing development on the plugi
# sudo su - nexus
$ cd <nexus_dir>/bin
$ ./nexus run
> bundle:install file:///tmp/nexus-repository-helm-0.0.3.jar
> bundle:install file:///tmp/nexus-repository-helm-0.0.4.jar
> bundle:list
```
(look for org.sonatype.nexus.plugins:nexus-repository-helm ID, should be the last one)
Expand All @@ -93,7 +93,7 @@ good installation path if you are just testing or doing development on the plugi

For more permanent installs of the nexus-repository-helm plugin, follow these instructions:

* Copy the bundle (nexus-repository-helm-0.0.3.jar) into <nexus_dir>/deploy
* Copy the bundle (nexus-repository-helm-0.0.4.jar) into <nexus_dir>/deploy

This will cause the plugin to be loaded with each restart of Nexus Repository. As well, this folder is monitored
by Nexus Repository and the plugin should load within 60 seconds of being copied there if Nexus Repository
Expand All @@ -103,7 +103,7 @@ is running. You will still need to start the bundle using the karaf commands men

If you are trying to use the Helm plugin permanently, it likely makes more sense to do the following:

* Copy the bundle into `<nexus_dir>/system/org/sonatype/nexus/plugins/nexus-repository-helm/0.0.3/nexus-repository-helm-0.0.3.jar`
* Copy the bundle into `<nexus_dir>/system/org/sonatype/nexus/plugins/nexus-repository-helm/0.0.4/nexus-repository-helm-0.0.4.jar`
* Make the following additions marked with + to `<nexus_dir>/system/org/sonatype/nexus/assemblies/nexus-core-feature/3.x.y/nexus-core-feature-3.x.y-features.xml`

```
Expand All @@ -114,9 +114,9 @@ If you are trying to use the Helm plugin permanently, it likely makes more sense
```
And
```
+ <feature name="nexus-repository-helm" description="org.sonatype.nexus.plugins:nexus-repository-helm" version="0.0.3">
+ <feature name="nexus-repository-helm" description="org.sonatype.nexus.plugins:nexus-repository-helm" version="0.0.4">
+ <details>org.sonatype.nexus.plugins:nexus-repository-helm</details>
+ <bundle>mvn:org.sonatype.nexus.plugins/nexus-repository-helm/0.0.3</bundle>
+ <bundle>mvn:org.sonatype.nexus.plugins/nexus-repository-helm/0.0.4</bundle>
+ </feature>
</features>
```
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<groupId>org.sonatype.repository</groupId>
<artifactId>nexus-repository-helm</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
<version>0.0.3</version>
<version>0.0.4</version>
<inceptionYear>2018</inceptionYear>
<packaging>bundle</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ abstract class HelmRecipeSupport
@Inject
Provider<PurgeUnusedFacet> purgeUnusedFacet

@Inject
Provider<NegativeCacheFacet> negativeCacheFacet

@Inject
NegativeCacheHandler negativeCacheHandler

protected HelmRecipeSupport(final Type type, final Format format) {
super(type, format)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class HelmHostedRecipe
repository.attach(configure(viewFacet.get()))
repository.attach(httpClientFacet.get())
repository.attach(componentMaintenanceFacet.get())
repository.attach(negativeCacheFacet.get())
repository.attach(storageFacet.get())
repository.attach(hostedFacet.get())
repository.attach(createIndexFacet.get())
Expand All @@ -93,7 +92,6 @@ class HelmHostedRecipe
.handler(securityHandler)
.handler(exceptionHandler)
.handler(handlerContributor)
.handler(negativeCacheHandler)
.handler(partialFetchHandler)
.handler(contentHeadersHandler)
.handler(unitOfWorkHandler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import javax.inject.Singleton
import org.sonatype.nexus.repository.Format
import org.sonatype.nexus.repository.Repository
import org.sonatype.nexus.repository.Type
import org.sonatype.nexus.repository.cache.NegativeCacheFacet
import org.sonatype.nexus.repository.cache.NegativeCacheHandler
import org.sonatype.nexus.repository.http.HttpHandlers
import org.sonatype.nexus.repository.proxy.ProxyHandler
import org.sonatype.nexus.repository.types.ProxyType
Expand Down Expand Up @@ -50,6 +52,12 @@ class HelmProxyRecipe
@Inject
ProxyHandler proxyHandler

@Inject
NegativeCacheHandler negativeCacheHandler

@Inject
Provider<NegativeCacheFacet> negativeCacheFacet

@Inject
HelmProxyRecipe(@Named(ProxyType.NAME) final Type type,
@Named(HelmFormat.NAME) final Format format) {
Expand Down

0 comments on commit ab646d9

Please sign in to comment.