mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-03 15:02:35 +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:
parent
a73951909b
commit
ed0359899f
@ -137,26 +137,30 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:/
|
|||||||
<servers>
|
<servers>
|
||||||
<server>
|
<server>
|
||||||
<id>private.repo.id</id>
|
<id>private.repo.id</id>
|
||||||
<username>${env.PIPER_CREDENTIAL_USERNAME}</username>
|
<username>${env.PIPER_VAULTCREDENTIAL_USERNAME}</username>
|
||||||
<password>${env.PIPER_CREDENTIAL_PASSWORD}</password>
|
<password>${env.PIPER_VAULTCREDENTIAL_PASSWORD}</password>
|
||||||
</server>
|
</server>
|
||||||
</servers>
|
</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>
|
<repository>
|
||||||
<id>private.repo.id</id>
|
<id>private.repo.id</id>
|
||||||
<url>https://private.repo.com/</url>
|
<url>https://private.repo.com/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</settings>
|
|
||||||
` + "`" + `` + "`" + `` + "`" + `
|
` + "`" + `` + "`" + `` + "`" + `
|
||||||
` + "`" + `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
|
` + "`" + `` + "`" + `` + "`" + `yaml
|
||||||
mavenBuild:
|
general:
|
||||||
projectSettingsFile: <path to the above settings.xml>
|
projectSettingsFile: <path to the above settings.xml>
|
||||||
` + "`" + `` + "`" + `` + "`" + ``,
|
` + "`" + `` + "`" + `` + "`" + ``,
|
||||||
PreRunE: func(cmd *cobra.Command, _ []string) error {
|
PreRunE: func(cmd *cobra.Command, _ []string) error {
|
||||||
|
@ -129,12 +129,12 @@ repository as below (replace the ` + "`" + `@privateScope:registry` + "`" + ` va
|
|||||||
|
|
||||||
` + "`" + `` + "`" + `` + "`" + `
|
` + "`" + `` + "`" + `` + "`" + `
|
||||||
@privateScope:registry=https://private.repository.com/
|
@privateScope:registry=https://private.repository.com/
|
||||||
//private.repository.com/:username=${PIPER_CREDENTIAL_USER}
|
//private.repository.com/:username=${PIPER_VAULTCREDENTIAL_USER}
|
||||||
//private.repository.com/:_password=${PIPER_CREDENTIAL_PASSWORD_BASE64}
|
//private.repository.com/:_password=${PIPER_VAULTCREDENTIAL_PASSWORD_BASE64}
|
||||||
//private.repository.com/:always-auth=true
|
//private.repository.com/:always-auth=true
|
||||||
registry=https://registry.npmjs.org
|
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 :
|
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)`,
|
[vault general purpose credentials](../infrastructure/vault.md#using-vault-for-general-purpose-and-test-credentials)`,
|
||||||
PreRunE: func(cmd *cobra.Command, _ []string) error {
|
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.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.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().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")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,26 +19,30 @@ metadata:
|
|||||||
<servers>
|
<servers>
|
||||||
<server>
|
<server>
|
||||||
<id>private.repo.id</id>
|
<id>private.repo.id</id>
|
||||||
<username>${env.PIPER_CREDENTIAL_USERNAME}</username>
|
<username>${env.PIPER_VAULTCREDENTIAL_USERNAME}</username>
|
||||||
<password>${env.PIPER_CREDENTIAL_PASSWORD}</password>
|
<password>${env.PIPER_VAULTCREDENTIAL_PASSWORD}</password>
|
||||||
</server>
|
</server>
|
||||||
</servers>
|
</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>
|
<repository>
|
||||||
<id>private.repo.id</id>
|
<id>private.repo.id</id>
|
||||||
<url>https://private.repo.com/</url>
|
<url>https://private.repo.com/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</settings>
|
|
||||||
```
|
```
|
||||||
`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
|
```yaml
|
||||||
mavenBuild:
|
general:
|
||||||
projectSettingsFile: <path to the above settings.xml>
|
projectSettingsFile: <path to the above settings.xml>
|
||||||
```
|
```
|
||||||
spec:
|
spec:
|
||||||
|
@ -12,12 +12,12 @@ metadata:
|
|||||||
|
|
||||||
```
|
```
|
||||||
@privateScope:registry=https://private.repository.com/
|
@privateScope:registry=https://private.repository.com/
|
||||||
//private.repository.com/:username=${PIPER_CREDENTIAL_USER}
|
//private.repository.com/:username=${PIPER_VAULTCREDENTIAL_USER}
|
||||||
//private.repository.com/:_password=${PIPER_CREDENTIAL_PASSWORD_BASE64}
|
//private.repository.com/:_password=${PIPER_VAULTCREDENTIAL_PASSWORD_BASE64}
|
||||||
//private.repository.com/:always-auth=true
|
//private.repository.com/:always-auth=true
|
||||||
registry=https://registry.npmjs.org
|
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 :
|
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)
|
[vault general purpose credentials](../infrastructure/vault.md#using-vault-for-general-purpose-and-test-credentials)
|
||||||
spec:
|
spec:
|
||||||
@ -144,7 +144,7 @@ spec:
|
|||||||
- name: packBeforePublish
|
- name: packBeforePublish
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
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:
|
scope:
|
||||||
- STEPS
|
- STEPS
|
||||||
- STAGES
|
- STAGES
|
||||||
|
Loading…
x
Reference in New Issue
Block a user