1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

fix (documentation) : mavenBuild and npmExecuteScripts (#3589)

* build depdencies docu fix

* fix trailing spaces

Co-authored-by: anilkeshav27 <you@example.com>
This commit is contained in:
Anil Keshav 2022-02-28 15:08:49 +01:00 committed by GitHub
parent a73951909b
commit ed0359899f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 28 deletions

View File

@ -137,26 +137,30 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:/
<servers>
<server>
<id>private.repo.id</id>
<username>${env.PIPER_CREDENTIAL_USERNAME}</username>
<password>${env.PIPER_CREDENTIAL_PASSWORD}</password>
<username>${env.PIPER_VAULTCREDENTIAL_USERNAME}</username>
<password>${env.PIPER_VAULTCREDENTIAL_PASSWORD}</password>
</server>
</servers>
<repositories>
</settings>
` + "`" + `` + "`" + `` + "`" + `
` + "`" + `PIPER_VAULTCREDENTIAL_USERNAME` + "`" + ` and ` + "`" + `PIPER_VAULTCREDENTIAL_PASSWORD` + "`" + ` are the username and password for the private repository and are exposed as environment variables that must be present
in the environment where the Piper step runs or alternatively can be created using :
[vault general purpose credentials](../infrastructure/vault.md#using-vault-for-general-purpose-and-test-credentials)
include the below ` + "`" + `<repositories>` + "`" + ` tag in your ` + "`" + `pom.xml` + "`" + ` to reference the ` + "`" + `<server>` + "`" + ` and make sure the values in the ` + "`" + `<id>` + "`" + ` tags match
` + "`" + `` + "`" + `` + "`" + `xml
<repositories>
<repository>
<id>private.repo.id</id>
<url>https://private.repo.com/</url>
</repository>
</repositories>
</settings>
</repositories>
` + "`" + `` + "`" + `` + "`" + `
` + "`" + `PIPER_CREDENTIAL_USERNAME` + "`" + ` and ` + "`" + `PIPER_CREDENTIAL_PASSWORD` + "`" + ` are the username and password for the private repository and are exposed as environment variables that must be present
in the environment where the Piper step runs or alternatively can be created using :
[vault general purpose credentials](../infrastructure/vault.md#using-vault-for-general-purpose-and-test-credentials)
Ensure the following configuration in the Piper config yaml to ensure the above settings xml is included during mavenBuild:
Ensure the following configuration in the Piper ` + "`" + `config.yaml` + "`" + ` to ensure the above settings xml is included and all steps can consume this parameter:
` + "`" + `` + "`" + `` + "`" + `yaml
mavenBuild:
general:
projectSettingsFile: <path to the above settings.xml>
` + "`" + `` + "`" + `` + "`" + ``,
PreRunE: func(cmd *cobra.Command, _ []string) error {

View File

@ -129,12 +129,12 @@ repository as below (replace the ` + "`" + `@privateScope:registry` + "`" + ` va
` + "`" + `` + "`" + `` + "`" + `
@privateScope:registry=https://private.repository.com/
//private.repository.com/:username=${PIPER_CREDENTIAL_USER}
//private.repository.com/:_password=${PIPER_CREDENTIAL_PASSWORD_BASE64}
//private.repository.com/:username=${PIPER_VAULTCREDENTIAL_USER}
//private.repository.com/:_password=${PIPER_VAULTCREDENTIAL_PASSWORD_BASE64}
//private.repository.com/:always-auth=true
registry=https://registry.npmjs.org
` + "`" + `` + "`" + `` + "`" + `
` + "`" + `PIPER_CREDENTIAL_USER` + "`" + ` and ` + "`" + `PIPER_CREDENTIAL_PASSWORD_BASE64` + "`" + ` (Base64 encoded password) are the username and password for the private repository
` + "`" + `PIPER_VAULTCREDENTIAL_USER` + "`" + ` and ` + "`" + `PIPER_VAULTCREDENTIAL_PASSWORD_BASE64` + "`" + ` (Base64 encoded password) are the username and password for the private repository
and are exposed are environment variables that must be present in the environment where the Piper step runs or alternatively can be created using :
[vault general purpose credentials](../infrastructure/vault.md#using-vault-for-general-purpose-and-test-credentials)`,
PreRunE: func(cmd *cobra.Command, _ []string) error {
@ -228,7 +228,7 @@ func addNpmExecuteScriptsFlags(cmd *cobra.Command, stepConfig *npmExecuteScripts
cmd.Flags().StringVar(&stepConfig.RepositoryPassword, "repositoryPassword", os.Getenv("PIPER_repositoryPassword"), "Password for the repository to which the project artifacts should be published.")
cmd.Flags().StringVar(&stepConfig.RepositoryUsername, "repositoryUsername", os.Getenv("PIPER_repositoryUsername"), "Username for the repository to which the project artifacts should be published.")
cmd.Flags().StringVar(&stepConfig.BuildSettingsInfo, "buildSettingsInfo", os.Getenv("PIPER_buildSettingsInfo"), "build settings info is typically filled by the step automatically to create information about the build settings that were used during the npm build . This information is typically used for compliance related processes.")
cmd.Flags().BoolVar(&stepConfig.PackBeforePublish, "packBeforePublish", false, "used for pack")
cmd.Flags().BoolVar(&stepConfig.PackBeforePublish, "packBeforePublish", false, "used for executing npm pack first, followed by npm publish. This two step maybe required when you are building a scoped packages and have npm dependencies from the same scope")
}

View File

@ -19,26 +19,30 @@ metadata:
<servers>
<server>
<id>private.repo.id</id>
<username>${env.PIPER_CREDENTIAL_USERNAME}</username>
<password>${env.PIPER_CREDENTIAL_PASSWORD}</password>
<username>${env.PIPER_VAULTCREDENTIAL_USERNAME}</username>
<password>${env.PIPER_VAULTCREDENTIAL_PASSWORD}</password>
</server>
</servers>
<repositories>
</settings>
```
`PIPER_VAULTCREDENTIAL_USERNAME` and `PIPER_VAULTCREDENTIAL_PASSWORD` are the username and password for the private repository and are exposed as environment variables that must be present
in the environment where the Piper step runs or alternatively can be created using :
[vault general purpose credentials](../infrastructure/vault.md#using-vault-for-general-purpose-and-test-credentials)
include the below `<repositories>` tag in your `pom.xml` to reference the `<server>` and make sure the values in the `<id>` tags match
```xml
<repositories>
<repository>
<id>private.repo.id</id>
<url>https://private.repo.com/</url>
</repository>
</repositories>
</settings>
</repositories>
```
`PIPER_CREDENTIAL_USERNAME` and `PIPER_CREDENTIAL_PASSWORD` are the username and password for the private repository and are exposed as environment variables that must be present
in the environment where the Piper step runs or alternatively can be created using :
[vault general purpose credentials](../infrastructure/vault.md#using-vault-for-general-purpose-and-test-credentials)
Ensure the following configuration in the Piper config yaml to ensure the above settings xml is included during mavenBuild:
Ensure the following configuration in the Piper `config.yaml` to ensure the above settings xml is included and all steps can consume this parameter:
```yaml
mavenBuild:
general:
projectSettingsFile: <path to the above settings.xml>
```
spec:

View File

@ -12,12 +12,12 @@ metadata:
```
@privateScope:registry=https://private.repository.com/
//private.repository.com/:username=${PIPER_CREDENTIAL_USER}
//private.repository.com/:_password=${PIPER_CREDENTIAL_PASSWORD_BASE64}
//private.repository.com/:username=${PIPER_VAULTCREDENTIAL_USER}
//private.repository.com/:_password=${PIPER_VAULTCREDENTIAL_PASSWORD_BASE64}
//private.repository.com/:always-auth=true
registry=https://registry.npmjs.org
```
`PIPER_CREDENTIAL_USER` and `PIPER_CREDENTIAL_PASSWORD_BASE64` (Base64 encoded password) are the username and password for the private repository
`PIPER_VAULTCREDENTIAL_USER` and `PIPER_VAULTCREDENTIAL_PASSWORD_BASE64` (Base64 encoded password) are the username and password for the private repository
and are exposed are environment variables that must be present in the environment where the Piper step runs or alternatively can be created using :
[vault general purpose credentials](../infrastructure/vault.md#using-vault-for-general-purpose-and-test-credentials)
spec:
@ -144,7 +144,7 @@ spec:
- name: packBeforePublish
type: bool
default: false
description: used for pack
description: used for executing npm pack first, followed by npm publish. This two step maybe required when you are building a scoped packages and have npm dependencies from the same scope
scope:
- STEPS
- STAGES