Skip to content

Commit

Permalink
Merge pull request #27 from sboschman/task-helm-lifecycle
Browse files Browse the repository at this point in the history
Custom packaging for helm
  • Loading branch information
axdotl authored Dec 17, 2018
2 parents 36ea377 + c8fceef commit cc82c60
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,30 @@ Parameter | Type | User Property | Required | Description
`<uploadRepoSnapshot>`| [HelmRepository](./src/main/java/com/kiwigrid/helm/maven/plugin/HelmRepository.java) | helm.uploadRepo.snapshot | false | Upload repository for snapshot charts (determined by version postfix 'SNAPSHOT')
`<skipRefresh>` | boolean | helm.init.skipRefresh | false | do not refresh (download) the local repository cache while init
`<security>` | string | helm.security | false | path to your [settings-security.xml](https://maven.apache.org/guides/mini/guide-encryption.html) (default: `~/.m2/settings-security.xml`)

## Packaging with the helm lifecycle

To keep your pom files small you can use 'helm' packaging. This binds `helm:init` to the initialize phase, `helm:lint` to the test phase, `helm:package` to the package phase and `helm:upload` to the deploy phase.

```xml
<pom>
<artifactId>my-helm-charts</artifactId>
<version>0.0.1</version>
<packaging>helm</packaging>
...
<build>
<plugins>
<plugin>
<groupId>com.kiwigrid</groupId>
<artifactId>helm-maven-plugin</artifactId>
<!-- Mandatory when you use a custom lifecycle -->
<extensions>true</extensions>
<configuration>
...
</configuration>
</plugin>
</plugins>
....
</build>
</pom>
```
23 changes: 23 additions & 0 deletions src/main/resources/META-INF/plexus/components.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<component-set>
<components>
<component>
<role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
<role-hint>helm</role-hint>
<implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
</implementation>
<configuration>
<lifecycles>
<lifecycle>
<id>default</id>
<phases>
<initialize>com.kiwigrid:helm-maven-plugin:init</initialize>
<test>com.kiwigrid:helm-maven-plugin:lint</test>
<package>com.kiwigrid:helm-maven-plugin:package</package>
<deploy>com.kiwigrid:helm-maven-plugin:upload</deploy>
</phases>
</lifecycle>
</lifecycles>
</configuration>
</component>
</components>
</component-set>

0 comments on commit cc82c60

Please sign in to comment.