Authorize in Space Packages
Space Packages is a package repository manager built into Space. You can use it to store packages produced by your Automation build scripts.
For authorization in Packages and other Space modules, Automation uses a separate Automation Service account. To authorize your build script, use the access token issued to the Automation Service. In a container, the ID and secret are available as the JB_SPACE_CLIENT_TOKEN
environment variable. As an alternative to the token, you can authorize the script with a client ID and secret: JB_SPACE_CLIENT_ID
and JB_SPACE_CLIENT_SECRET
.
For example, to authorize a script in a NuGet feed:
job("Authorize in NuGet feed") {
container(image = "mcr.microsoft.com/dotnet/core/sdk:3.1"){
env["FEED_URL"] = "https://nuget.pkg.jetbrains.space/mycompany/p/pkey/mynuget/v3/index.json"
shellScript {
content = """
dotnet nuget add source ${'$'}FEED_URL -n space -u "${'$'}JB_SPACE_CLIENT_ID" -p "${'$'}JB_SPACE_CLIENT_SECRET" --store-password-in-clear-text
"""
}
}
}
Last modified: 15 December 2023