Jenkins shared library and CDK constructs for AWS infrastructure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
47 lines
1.1 KiB
Markdown
47 lines
1.1 KiB
Markdown
# Example Jenkinsfile for NPM Package Publishing
|
|
|
|
## Basic Usage
|
|
|
|
Create a `Jenkinsfile` in your repository root:
|
|
|
|
```groovy
|
|
@Library(["spicy-automation@main"]) _
|
|
|
|
publishNpmPackage()
|
|
```
|
|
|
|
## With Scoped Package
|
|
|
|
```groovy
|
|
@Library(["spicy-automation@main"]) _
|
|
|
|
publishNpmPackage(
|
|
packageName: '@kodeniks/my-package',
|
|
)
|
|
```
|
|
|
|
## With Custom Options
|
|
|
|
```groovy
|
|
@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
|
|
|
|
1. **No comments at the top** - Jenkinsfiles should start directly with `@Library` or the function call
|
|
2. **Package name is optional** - It will be read from `package.json` if not provided
|
|
3. **Scoped packages are supported** - Use format `@scope/package-name`
|
|
4. **Requires Docker agent** - The agent must have Docker available to run Node containers
|
|
|