Jenkins shared library and CDK constructs for AWS infrastructure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.1 KiB
1.1 KiB
Example Jenkinsfile for NPM Package Publishing
Basic Usage
Create a Jenkinsfile in your repository root:
@Library(["spicy-automation@main"]) _
publishNpmPackage()
With Scoped Package
@Library(["spicy-automation@main"]) _
publishNpmPackage(
packageName: '@kodeniks/my-package',
)
With Custom Options
@Library(["spicy-automation@main"]) _
publishNpmPackage(
packageName: '@kodeniks/my-package',
buildScript: 'build.sh',
versionScript: './scripts/docker-ensure-version.sh',
registry: 'nexus.kodeniks.com',
repository: 'npm-hosted',
credentialsId: 'kodeniks-nexus-repository',
agentLabel: 'docker',
nodeImage: 'node:24-alpine',
)
Important Notes
- No comments at the top - Jenkinsfiles should start directly with
@Libraryor the function call - Package name is optional - It will be read from
package.jsonif not provided - Scoped packages are supported - Use format
@scope/package-name - Requires Docker agent - The agent must have Docker available to run Node containers