Build process customization

During each build pipeline the project dependencies need to be fetched and the project needs to be compiled. These steps work without any manual adjustments because the build tools use reasonable default configurations.

However, there might be cases when these settings need to be adjusted e.g. to provide access credentials to a private package/dependency registry. This can be done by creating a k5-build-settings secret in the namespace the pipelines are running in.

A minimal example looks like this:

apiVersion: v1
kind: Secret
metadata:
  name: k5-build-settings
type: Opaque
data:
  mvnSettings: ""
  npmSettings: ""

These entries can be specified in the secret:

mvnSettings

This key stores the base64-encoded content of a maven specific settings.xml file. These settings are then used in the build step of all Java pipelines in the secret's namespace.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <mirrors>
        <mirror>
            <id>my-private-artifact-server</id>
            <url>https://my-private-artifact-server.com/repository/maven-public/</url>
        </mirror>
    </mirrors>
    <servers>
        <server>
            <id>my-private-artifact-server</id>
            <username>my-username</username>
            <password>my-password</password>
        </server>
    </servers>
</settings>

npmSettings

This key stores the base64-encoded content of a npm specific .npmrc file. These settings are then used in the build step of all TypeScript pipelines in the secret's namespace.

Example:

//my-private-artifact-server.com/repository/npm-private/:_authToken=NpmToken.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Note: Please note that mvnSettings and npmSettings support all features described in their corresponding documentations and are not limited to the provided examples.