projen-pipelines 0.2.15 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +243 -7
- package/API.md +184 -0
- package/README.md +67 -0
- package/lib/assign-approver/base.js +1 -1
- package/lib/assign-approver/github.js +3 -3
- package/lib/awscdk/base.js +1 -1
- package/lib/awscdk/bash.js +1 -1
- package/lib/awscdk/github.js +12 -9
- package/lib/awscdk/gitlab.js +1 -1
- package/lib/drift/base.js +1 -1
- package/lib/drift/bash.js +1 -1
- package/lib/drift/github.js +6 -6
- package/lib/drift/gitlab.js +1 -1
- package/lib/drift/step.js +1 -1
- package/lib/steps/amplify-deploy.step.d.ts +40 -0
- package/lib/steps/amplify-deploy.step.js +148 -0
- package/lib/steps/artifact-steps.js +5 -5
- package/lib/steps/aws-assume-role.step.js +3 -3
- package/lib/steps/index.d.ts +1 -0
- package/lib/steps/index.js +2 -1
- package/lib/steps/registries.js +3 -3
- package/lib/steps/step.js +4 -4
- package/lib/versioning/computation.js +3 -3
- package/lib/versioning/config.js +2 -2
- package/lib/versioning/outputs.js +5 -5
- package/lib/versioning/setup.js +1 -1
- package/lib/versioning/strategy.js +1 -1
- package/lib/versioning/version-info.js +2 -2
- package/llm.md +69 -0
- package/package.json +3 -3
package/.jsii
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"constructs": "^10.4.2",
|
|
19
|
-
"projen": ">=0.
|
|
19
|
+
"projen": ">=0.96.3 <1.0.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencyClosure": {
|
|
22
22
|
"constructs": {
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"projen.gitlab": {},
|
|
58
58
|
"projen.java": {},
|
|
59
59
|
"projen.javascript": {},
|
|
60
|
+
"projen.javascript.biome_config": {},
|
|
60
61
|
"projen.python": {},
|
|
61
62
|
"projen.release": {},
|
|
62
63
|
"projen.typescript": {},
|
|
@@ -106,7 +107,7 @@
|
|
|
106
107
|
},
|
|
107
108
|
"name": "projen-pipelines",
|
|
108
109
|
"readme": {
|
|
109
|
-
"markdown": "# Projen Pipelines\n\n[](https://www.npmjs.com/package/projen-pipelines)\n\nProjen Pipelines is an open-source project that automates the generation of CI/CD pipelines using Projen,\na project configuration tool created by the inventor of AWS CDK.\nIt provides high-level abstractions for defining continuous delivery (CD) pipelines for applications,\nspecifically designed to work with the projen project configuration engine.\n\n### Key Features\n\n* Automates code generation for CI/CD pipelines\n* Supports multiple CI/CD platforms (currently GitHub Actions and GitLab CI, with more in development)\n* Provides baked-in proven defaults for pipeline configurations\n* Enables compliance-as-code integration\n* Allows easy switching between different CI/CD platforms without rewriting pipeline configurations\n* Handles complex deployment scenarios with less code\n* Manages AWS infrastructure more efficiently and straightforwardly\n* Automated drift detection for CloudFormation/CDK stacks with scheduled checks and issue creation\n* Automatic versioning with flexible strategies and multiple output targets\n\n### Benefits\n\n* Reduces repetitive work in writing and maintaining pipeline configurations\n* Ensures consistency across projects by using proven defaults\n* Simplifies compliance management by integrating it directly into pipeline definitions\n* Facilitates platform migrations (e.g., from GitHub to GitLab) by abstracting pipeline definitions\n* Provides automatic version tracking and exposure through CloudFormation and SSM Parameter Store\n\n## Beyond AWS CDK: A Vision for Universal CI/CD Pipeline Generation\n\nWhile Projen Pipelines currently focuses on AWS CDK applications, our vision extends far beyond this initial scope.\nWe aim to evolve into a universal CI/CD pipeline generator capable of supporting a wide variety of application types and deployment targets.\n\n### Future Direction:\n\n1. Diverse Application Support: We plan to expand our capabilities to generate pipelines for various application types, including but not limited to:\n * Traditional web applications\n * Terraform / OpenTOFU projects\n * Winglang applications\n1. Multi-Cloud Deployment: While we started with AWS, we aim to support deployments to other major cloud providers like Azure, Google Cloud Platform, and others.\n1. On-Premises and Hybrid Scenarios: We recognize the importance of on-premises and hybrid cloud setups and plan to cater to these deployment models.\n1. Framework Agnostic: Our goal is to make Projen Pipelines adaptable to work with various development frameworks and tools, not just those related to AWS or cloud deployments.\n1. Extensibility: We're designing the system to be easily extensible, allowing the community to contribute modules for new application types, deployment targets, or CI/CD platforms.\n\nBy broadening our scope, we aim to create a tool that can standardize and simplify CI/CD pipeline creation across the entire spectrum of modern application development and deployment scenarios.\nWe invite the community to join us in this journey, contributing ideas, use cases, and code to help realize this vision.\n\n## How Projen Pipelines work\n\n\nUnder the hood, after you define the pipeline and select the target engine you want to work on, we use code generation methods to create the required CI/CD pipeline in your project.\n\nWe are considering allowing the selection of multiple engines going forward - please let us know if this is a feature you would use!\n\n## Getting Started\n\n### Installation\n\nTo install the package, add the package `projen-pipelines` to your projects devDeps in your projen configuration file.\n\nAfter installing the package, you can import and use the constructs to define your CDK Pipelines.\n\nYou will also have to setup an IAM role that can be used by GitHub Actions. For example, create a role named `GithubDeploymentRole` in your deployment account (`123456789012`) with a policy like this to assume the CDK roles of the pipeline stages (AWS account IDs `123456789013` and `123456789014`):\n```json\n{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"Statement1\",\n \"Effect\": \"Allow\",\n \"Action\": \"sts:AssumeRole\",\n \"Resource\": [\n \"arn:aws:iam::123456789013:role/cdk-*-123456789013-*\",\n \"arn:aws:iam::123456789014:role/cdk-*-123456789014-*\"\n ]\n }\n ]\n}\n```\n\nAdd a trust policy to this role as described in this tutorial: [Configuring OpenID Connect in Amazon Web Services](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services)\n\n### Usage with AWS CDK\n\nYou can start using the constructs provided by Projen Pipelines in your AWS CDK applications. Here's a brief example:\n\n```typescript\nimport { awscdk } from 'projen';\nimport { GithubCDKPipeline } from 'projen-pipelines';\n\n// Define your AWS CDK TypeScript App\nconst app = new awscdk.AwsCdkTypeScriptApp({\n cdkVersion: '2.150.0',\n name: 'my-awesome-app',\n defaultReleaseBranch: 'main',\n devDeps: [\n 'projen-pipelines',\n ],\n});\n\n// Create the pipeline\nnew GithubCDKPipeline(app, {\n stackPrefix: 'MyApp',\n iamRoleArns: {\n default: 'arn:aws:iam::123456789012:role/GithubDeploymentRole',\n },\n pkgNamespace: '@company-assemblies',\n useGithubPackagesForAssembly: true,\n stages: [\n {\n name: 'dev',\n env: { account: '123456789013', region: 'eu-central-1' },\n }, {\n name: 'prod',\n manualApproval: true,\n env: { account: '123456789014', region: 'eu-central-1' },\n }],\n});\n```\n\nAfter running projen (`npx projen`) a new file called `src/app.ts` will be created and contain a specialized CDK App class for your project.\n\nYou can then use this in your `main.ts` to configure your deployment.\n\n```typescript\nimport { PipelineApp } from './app';\nimport { BackendStack } from './stack';\n\nconst app = new PipelineApp({\n provideDevStack: (scope, id, props) => {\n return new BackendStack(scope, id, {\n ...props,\n apiHostname: 'api-dev',\n myConfigSetting: 'value-for-dev',\n });\n },\n provideProdStack: (scope, id, props) => {\n return new BackendStack(scope, id, {\n ...props,\n apiHostname: 'api',\n myConfigSetting: 'value-for-prod',\n });\n },\n providePersonalStack: (scope, id, props) => {\n return new BackendStack(scope, id, {\n ...props,\n apiHostname: `api-${props.stageName}`,\n myConfigSetting: 'value-for-personal-stage',\n });\n },\n});\n\napp.synth();\n```\n\n### Drift Detection\n\nProjen Pipelines includes built-in support for automated drift detection of your CloudFormation/CDK stacks. This feature helps you identify when your deployed infrastructure has diverged from your code definitions.\n\n```typescript\nimport { GitHubDriftDetectionWorkflow } from 'projen-pipelines';\n\nnew GitHubDriftDetectionWorkflow(app, {\n schedule: '0 0 * * *', // Daily at midnight\n createIssues: true, // Automatically create GitHub issues\n stages: [\n {\n name: 'production',\n region: 'us-east-1',\n roleArn: 'arn:aws:iam::123456789012:role/DriftDetectionRole',\n failOnDrift: true,\n },\n ],\n});\n```\n\nSee the [drift detection documentation](docs/drift-detection.md) for detailed configuration options and examples.\n\n### Setting Up Trust Relationships Between Accounts\n\nWhen planning to manage multiple staging environments, you will need to establish trust relationships. This process centralizes deployment control, improving operational efficiency and security by consolidating deployment management through a singular, monitored channel. Here is a simplified diagram for the setup:\n\n\n\n#### Step 1: Bootstrapping Each Account\n\nBootstrapping initializes the AWS CDK environment in each account. It prepares the account to work with AWS CDK apps deployed from other accounts. Use the `cdk bootstrap` command for this purpose. Replace `<deployment_account_id>` with the actual AWS account ID of your deployment account.\n\nYou can use the [CloudShell](https://aws.amazon.com/cloudshell/) to bootstrap each staging account:\n\n```bash\ncdk bootstrap --trust <deployment_account_id> --cloudformation-execution-policies \"arn:aws:iam::aws:policy/AdministratorAccess\"\n```\n\n**Note:**\n\nWhile `AdministratorAccess` grants full access to all AWS services and resources, it's not recommended for production environments due to security risks. Instead, create custom IAM policies that grant only the necessary permissions required for deployment operations.\n\n### Deployment\n\nThe `<Engine>CDKPipeline` class creates and adds several tasks to the projen project that then can be used in your pipeline to deploy your application to AWS.\n\nHere's a brief description of each one:\n\n1. **deploy:personal** - This task deploys the application's personal stage, which is a distinct, isolated deployment of the application. The personal stage is intended for personal use, such as testing and development.\n\n2. **watch:personal** - This task deploys the personal stage of the application in watch mode. In this mode, the AWS CDK monitors your application source files for changes, automatically re-synthesizing and deploying when it detects any changes.\n\n3. **diff:personal** - This task compares the deployed personal stage with the current state of the application code. It's used to understand what changes would be made if the application were deployed.\n\n4. **destroy:personal** - This task destroys the resources created for the personal stage of the application.\n\n5. **deploy:feature** - This task deploys the application's feature stage. The feature stage is used for new features testing before these are merged into the main branch.\n\n6. **diff:feature** - This task is similar to `diff:personal`, but for the feature stage.\n\n7. **destroy:feature** - This task destroys the resources created for the feature stage of the application.\n\n8. **deploy:<stageName>** - This task deploys a specific stage of the application (like 'dev' or 'prod').\n\n9. **diff:<stageName>** - This task compares the specified application stage with the current state of the application code.\n\n10. **publish:assets** - This task publishes the CDK assets to all accounts. This is useful when the CDK application uses assets like Docker images or files from the S3 bucket.\n\n11. **bump** - This task bumps the version based on the latest git tag and pushes the updated tag to the git repository.\n\n12. **release:push-assembly** - This task creates a manifest, bumps the version without creating a git tag, and publishes the cloud assembly to your registry.\n\nRemember that these tasks are created and managed automatically by the `CDKPipeline` class. You can run these tasks using the `npx projen TASK_NAME` command.\n\n## Versioning\n\nProjen Pipelines includes a comprehensive versioning system that automatically tracks and exposes deployment versions through various AWS services. This feature enables deployment traceability, automated rollback decisions, and comprehensive audit trails.\n\n### Basic Versioning Configuration\n\nTo enable versioning in your pipeline, add the `versioning` configuration:\n\n```typescript\nimport { awscdk } from 'projen';\nimport { GithubCDKPipeline, VersioningStrategy, VersioningOutputs } from 'projen-pipelines';\n\nconst app = new awscdk.AwsCdkTypeScriptApp({\n // ... other config\n});\n\nnew GithubCDKPipeline(app, {\n // ... other pipeline config\n\n versioning: {\n enabled: true,\n strategy: VersioningStrategy.commitCount(),\n outputs: VersioningOutputs.standard()\n }\n});\n```\n\n### Versioning Strategies\n\nProjen Pipelines provides several built-in versioning strategies:\n\n#### Git Tag Strategy\nUses git tags as the version source, with optional prefix stripping:\n\n```typescript\n// Basic git tag strategy\nconst strategy = VersioningStrategy.gitTag();\n\n// With custom configuration\nconst strategy = VersioningStrategy.gitTag({\n stripPrefix: 'v', // Strip 'v' from tags (v1.2.3 → 1.2.3)\n annotatedOnly: true, // Only use annotated tags\n includeSinceTag: true // Include commits since tag\n});\n```\n\n#### Package.json Strategy\nUses the version from your package.json file:\n\n```typescript\n// Basic package.json strategy\nconst strategy = VersioningStrategy.packageJson();\n\n// With custom configuration\nconst strategy = VersioningStrategy.packageJson({\n path: './package.json',\n includePrerelease: true,\n appendCommitInfo: true\n});\n```\n\n#### Commit Count Strategy\nUses the number of commits as the version:\n\n```typescript\n// Basic commit count strategy\nconst strategy = VersioningStrategy.commitCount();\n\n// With custom configuration\nconst strategy = VersioningStrategy.commitCount({\n countFrom: 'all', // 'all' | 'since-tag'\n includeBranch: true, // Include branch name\n padding: 5 // Zero-pad count (00001)\n});\n```\n\n#### Build Number Strategy\nCreates a version from build metadata:\n\n```typescript\n// Basic build number strategy\nconst strategy = VersioningStrategy.buildNumber();\n\n// With custom configuration\nconst strategy = VersioningStrategy.buildNumber({\n prefix: 'release',\n commitCount: { countFrom: 'all', padding: 5 }\n});\n// Output: release-01234-3a4b5c6d\n```\n\n#### Custom Composite Strategy\nCreate your own version format using template variables:\n\n```typescript\nconst strategy = VersioningStrategy.create(\n '{git-tag}+{commit-count}-{commit-hash:8}',\n {\n gitTag: { stripPrefix: 'v' },\n commitCount: { countFrom: 'since-tag' }\n }\n);\n// Output: 1.2.3+45-3a4b5c6d\n```\n\n### Version Output Configurations\n\nControl how and where version information is exposed:\n\n#### CloudFormation Outputs\nExport version information as CloudFormation stack outputs:\n\n```typescript\n// Basic CloudFormation output\nconst outputs = VersioningOutputs.cloudFormationOnly();\n\n// With custom configuration\nconst outputs = VersioningOutputs.cloudFormationOnly({\n exportName: 'MyApp-{stage}-Version'\n});\n```\n\n#### SSM Parameter Store\nStore version information in AWS Systems Manager Parameter Store:\n\n```typescript\n// Basic parameter store\nconst outputs = VersioningOutputs.parameterStoreOnly('/myapp/{stage}/version');\n\n// Hierarchical parameters\nconst outputs = VersioningOutputs.hierarchicalParameters('/myapp/{stage}/version', {\n includeCloudFormation: true\n});\n```\n\nThis creates parameters like:\n- `/myapp/prod/version` → Full version JSON\n- `/myapp/prod/version/commit` → Commit hash\n- `/myapp/prod/version/tag` → Git tag\n- `/myapp/prod/version/count` → Commit count\n\n#### Standard Configuration\nThe recommended configuration that uses CloudFormation outputs with optional Parameter Store:\n\n```typescript\nconst outputs = VersioningOutputs.standard({\n parameterName: '/myapp/{stage}/version',\n});\n```\n\n### Output Formats\n\nVersion information can be output in two formats:\n\n**Plain Format:** Simple string values in CloudFormation\n```yaml\nOutputs:\n AppVersion:\n Value: \"1.2.3+45-3a4b5c6d\"\n Description: \"Application version\"\n AppCommitHash:\n Value: \"3a4b5c6def1234567890\"\n Description: \"Git commit hash\"\n```\n\n**Structured Format:** JSON object with comprehensive metadata in SSM\n```json\n{\n \"version\": \"1.2.3\",\n \"commitHash\": \"3a4b5c6def1234567890\",\n \"commitCount\": 1234,\n \"commitsSinceTag\": 45,\n \"branch\": \"main\",\n \"tag\": \"v1.2.3\",\n \"deployedAt\": \"2024-01-15T10:30:00Z\",\n \"deployedBy\": \"github-actions\",\n \"buildNumber\": \"456\",\n \"environment\": \"production\"\n}\n```\n\n### Stage-Specific Overrides\n\nConfigure different versioning strategies for different stages:\n\n```typescript\nnew GithubCDKPipeline(app, {\n versioning: {\n enabled: true,\n strategy: VersioningStrategy.gitTag(),\n outputs: VersioningOutputs.standard(),\n stageOverrides: {\n dev: {\n strategy: VersioningStrategy.commitCount(),\n outputs: VersioningOutputs.minimal()\n },\n prod: {\n validation: {\n requireTag: true,\n tagPattern: /^v\\d+\\.\\d+\\.\\d+$/\n }\n }\n }\n }\n});\n```\n\n### Template Variables\n\nAll strategies support these template variables:\n- `{git-tag}` - Git tag (with optional prefix stripping)\n- `{package-version}` - Version from package.json\n- `{commit-count}` - Number of commits\n- `{commit-hash}` - Full commit hash\n- `{commit-hash:8}` - Short commit hash (8 characters)\n- `{branch}` - Git branch name\n- `{build-number}` - CI/CD build number\n\n### Benefits of Versioning\n\n1. **Deployment Traceability**: Always know exactly which code version is deployed\n2. **Automated Rollback**: Use version information for automated rollback decisions\n3. **Audit Trail**: Comprehensive deployment history with metadata\n4. **Multi-Stage Support**: Different versioning strategies per environment\n5. **Zero Configuration**: Works out-of-the-box with sensible defaults\n6. **CI/CD Integration**: Automatically detects version info from CI/CD environments\n\n### Feature Branch Deployments\n\nProjen Pipelines supports automated feature branch deployments for GitHub Actions. This allows you to deploy and test your changes in isolated environments before merging to the main branch. Gitlab support is currently missing.\n\n#### Configuration\n\nTo enable feature branch deployments, add the `featureStages` configuration to your pipeline:\n\n```typescript\nnew GithubCDKPipeline(app, {\n stackPrefix: 'MyApp',\n iamRoleArns: {\n default: 'arn:aws:iam::123456789012:role/GithubDeploymentRole',\n },\n featureStages: {\n env: { account: '123456789013', region: 'eu-central-1' },\n },\n stages: [\n // ... your regular stages\n ],\n});\n```\n\n#### How It Works\n\nWhen feature stages are configured, two GitHub workflows are created:\n\n1. **deploy-feature** - Automatically deploys your feature branch when a pull request is labeled with `feature-deployment`\n2. **destroy-feature** - Automatically destroys the feature deployment when:\n - The pull request is closed\n - The `feature-deployment` label is removed from the pull request\n\n#### Using Feature Deployments\n\n1. Create a pull request with your changes\n2. Add the `feature-deployment` label to trigger deployment\n3. The feature environment will be deployed with a stack name including your branch name\n4. Remove the label or close the PR to destroy the feature environment\n\nThe feature deployment uses the `--force` flag when destroying to ensure cleanup without manual confirmation.\n\n## Current Status\n\nProjen-Pipelines is currently in version 0.x, awaiting Projen's 1.0 release. Despite its pre-1.0 status, it's being used in several production environments.\n\n## Contributing\n\n### By raising feature requests or issues\n\nUse the Github integrated \"[Issues](https://github.com/taimos/projen-pipelines/issues/new)\" view to create an item that you would love to have added to our open source project.\n\n***No request is too big or too small*** - get your thoughts created and we'll get back to you if we have questions!\n\n### By committing code\n\nWe welcome all contributions to Projen Pipelines! Here's how you can get started:\n\n1. **Fork the Repository**: Click the 'Fork' button at the top right of this page to duplicate this repository in your GitHub account.\n\n2. **Clone your Fork**: Clone the forked repository to your local machine.\n\n```bash\ngit clone https://github.com/<your_username>/projen-pipelines.git\n```\n\n3. **Create a Branch**: To keep your work organized, create a branch for your contribution.\n\n```bash\ngit checkout -b my-branch\n```\n\n4. **Make your Changes**: Make your changes, additions, or fixes to the codebase. Remember to follow the existing code style.\n\n5. **Test your Changes**: Before committing your changes, make sure to test them to ensure they work as expected and do not introduce bugs.\n\n6. **Commit your Changes**: Commit your changes with a descriptive commit message using conventional commit messages.\n\n```bash\ngit commit -m \"feat: Your descriptive commit message\"\n```\n\n7. **Push to your Fork**: Push your commits to the branch in your forked repository.\n\n```bash\ngit push -u origin my-branch\n```\n\n8. **Submit a Pull Request**: Once your changes are ready to be reviewed, create a pull request from your forked repository's branch into the `main` branch of this repository.\n\nYour pull request will be reviewed and hopefully merged quickly. Thanks for contributing!\n\n### How to test changes?\nThe best way currently is to test things locally or - if you have a working stall of all supported CI/CD tools - manually test the functionalities there in diferent projects.\n\n_For local testing:_\nUsing `yalc push` you can install the project locally to your local yalc package manager. You can also use `npm run local-push` instead of this.\n\nWith `yalc add projen-pipelines` you can then use it in a local project.\n\n\n## Future Plans\n\n* Move the project to the Open Construct Foundation for broader community involvement\n* Continue expanding support for different CI/CD platforms and project types\n\nJoin us in elevating CI/CD pipeline discussions from implementation details to fundamental building blocks, and help create a more efficient, standardized approach to pipeline development!\n\n## Known issues\n\n### Environment variable not recognized during `npx projen`\n\nWhen attempting to run `npx projen`, users may encounter an error related to environment variable substitution within configuration files. Specifically, the `${GITHUB_TOKEN}` placeholder fails to be replaced.\n\n#### Solution\n\nTo resolve this issue, prefix the `npx projen` command with the `GITHUB_TOKEN=` environment variable:\n\n```bash\nGITHUB_TOKEN= npx projen\n```\n"
|
|
110
|
+
"markdown": "# Projen Pipelines\n\n[](https://www.npmjs.com/package/projen-pipelines)\n\nProjen Pipelines is an open-source project that automates the generation of CI/CD pipelines using Projen,\na project configuration tool created by the inventor of AWS CDK.\nIt provides high-level abstractions for defining continuous delivery (CD) pipelines for applications,\nspecifically designed to work with the projen project configuration engine.\n\n### Key Features\n\n* Automates code generation for CI/CD pipelines\n* Supports multiple CI/CD platforms (currently GitHub Actions and GitLab CI, with more in development)\n* Provides baked-in proven defaults for pipeline configurations\n* Enables compliance-as-code integration\n* Allows easy switching between different CI/CD platforms without rewriting pipeline configurations\n* Handles complex deployment scenarios with less code\n* Manages AWS infrastructure more efficiently and straightforwardly\n* Automated drift detection for CloudFormation/CDK stacks with scheduled checks and issue creation\n* Automatic versioning with flexible strategies and multiple output targets\n\n### Benefits\n\n* Reduces repetitive work in writing and maintaining pipeline configurations\n* Ensures consistency across projects by using proven defaults\n* Simplifies compliance management by integrating it directly into pipeline definitions\n* Facilitates platform migrations (e.g., from GitHub to GitLab) by abstracting pipeline definitions\n* Provides automatic version tracking and exposure through CloudFormation and SSM Parameter Store\n\n## Beyond AWS CDK: A Vision for Universal CI/CD Pipeline Generation\n\nWhile Projen Pipelines currently focuses on AWS CDK applications, our vision extends far beyond this initial scope.\nWe aim to evolve into a universal CI/CD pipeline generator capable of supporting a wide variety of application types and deployment targets.\n\n### Future Direction:\n\n1. Diverse Application Support: We plan to expand our capabilities to generate pipelines for various application types, including but not limited to:\n * Traditional web applications\n * Terraform / OpenTOFU projects\n * Winglang applications\n * Static websites and single-page applications\n1. Multi-Cloud Deployment: While we started with AWS, we aim to support deployments to other major cloud providers like Azure, Google Cloud Platform, and others.\n1. On-Premises and Hybrid Scenarios: We recognize the importance of on-premises and hybrid cloud setups and plan to cater to these deployment models.\n1. Framework Agnostic: Our goal is to make Projen Pipelines adaptable to work with various development frameworks and tools, not just those related to AWS or cloud deployments.\n1. Extensibility: We're designing the system to be easily extensible, allowing the community to contribute modules for new application types, deployment targets, or CI/CD platforms.\n\nBy broadening our scope, we aim to create a tool that can standardize and simplify CI/CD pipeline creation across the entire spectrum of modern application development and deployment scenarios.\nWe invite the community to join us in this journey, contributing ideas, use cases, and code to help realize this vision.\n\n## How Projen Pipelines work\n\n\nUnder the hood, after you define the pipeline and select the target engine you want to work on, we use code generation methods to create the required CI/CD pipeline in your project.\n\nWe are considering allowing the selection of multiple engines going forward - please let us know if this is a feature you would use!\n\n## Getting Started\n\n### Installation\n\nTo install the package, add the package `projen-pipelines` to your projects devDeps in your projen configuration file.\n\nAfter installing the package, you can import and use the constructs to define your CDK Pipelines.\n\nYou will also have to setup an IAM role that can be used by GitHub Actions. For example, create a role named `GithubDeploymentRole` in your deployment account (`123456789012`) with a policy like this to assume the CDK roles of the pipeline stages (AWS account IDs `123456789013` and `123456789014`):\n```json\n{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"Statement1\",\n \"Effect\": \"Allow\",\n \"Action\": \"sts:AssumeRole\",\n \"Resource\": [\n \"arn:aws:iam::123456789013:role/cdk-*-123456789013-*\",\n \"arn:aws:iam::123456789014:role/cdk-*-123456789014-*\"\n ]\n }\n ]\n}\n```\n\nAdd a trust policy to this role as described in this tutorial: [Configuring OpenID Connect in Amazon Web Services](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services)\n\n### Usage with AWS CDK\n\nYou can start using the constructs provided by Projen Pipelines in your AWS CDK applications. Here's a brief example:\n\n```typescript\nimport { awscdk } from 'projen';\nimport { GithubCDKPipeline } from 'projen-pipelines';\n\n// Define your AWS CDK TypeScript App\nconst app = new awscdk.AwsCdkTypeScriptApp({\n cdkVersion: '2.150.0',\n name: 'my-awesome-app',\n defaultReleaseBranch: 'main',\n devDeps: [\n 'projen-pipelines',\n ],\n});\n\n// Create the pipeline\nnew GithubCDKPipeline(app, {\n stackPrefix: 'MyApp',\n iamRoleArns: {\n default: 'arn:aws:iam::123456789012:role/GithubDeploymentRole',\n },\n pkgNamespace: '@company-assemblies',\n useGithubPackagesForAssembly: true,\n stages: [\n {\n name: 'dev',\n env: { account: '123456789013', region: 'eu-central-1' },\n }, {\n name: 'prod',\n manualApproval: true,\n env: { account: '123456789014', region: 'eu-central-1' },\n }],\n});\n```\n\nAfter running projen (`npx projen`) a new file called `src/app.ts` will be created and contain a specialized CDK App class for your project.\n\nYou can then use this in your `main.ts` to configure your deployment.\n\n```typescript\nimport { PipelineApp } from './app';\nimport { BackendStack } from './stack';\n\nconst app = new PipelineApp({\n provideDevStack: (scope, id, props) => {\n return new BackendStack(scope, id, {\n ...props,\n apiHostname: 'api-dev',\n myConfigSetting: 'value-for-dev',\n });\n },\n provideProdStack: (scope, id, props) => {\n return new BackendStack(scope, id, {\n ...props,\n apiHostname: 'api',\n myConfigSetting: 'value-for-prod',\n });\n },\n providePersonalStack: (scope, id, props) => {\n return new BackendStack(scope, id, {\n ...props,\n apiHostname: `api-${props.stageName}`,\n myConfigSetting: 'value-for-personal-stage',\n });\n },\n});\n\napp.synth();\n```\n\n### Drift Detection\n\nProjen Pipelines includes built-in support for automated drift detection of your CloudFormation/CDK stacks. This feature helps you identify when your deployed infrastructure has diverged from your code definitions.\n\n```typescript\nimport { GitHubDriftDetectionWorkflow } from 'projen-pipelines';\n\nnew GitHubDriftDetectionWorkflow(app, {\n schedule: '0 0 * * *', // Daily at midnight\n createIssues: true, // Automatically create GitHub issues\n stages: [\n {\n name: 'production',\n region: 'us-east-1',\n roleArn: 'arn:aws:iam::123456789012:role/DriftDetectionRole',\n failOnDrift: true,\n },\n ],\n});\n```\n\nSee the [drift detection documentation](docs/drift-detection.md) for detailed configuration options and examples.\n\n### Setting Up Trust Relationships Between Accounts\n\nWhen planning to manage multiple staging environments, you will need to establish trust relationships. This process centralizes deployment control, improving operational efficiency and security by consolidating deployment management through a singular, monitored channel. Here is a simplified diagram for the setup:\n\n\n\n#### Step 1: Bootstrapping Each Account\n\nBootstrapping initializes the AWS CDK environment in each account. It prepares the account to work with AWS CDK apps deployed from other accounts. Use the `cdk bootstrap` command for this purpose. Replace `<deployment_account_id>` with the actual AWS account ID of your deployment account.\n\nYou can use the [CloudShell](https://aws.amazon.com/cloudshell/) to bootstrap each staging account:\n\n```bash\ncdk bootstrap --trust <deployment_account_id> --cloudformation-execution-policies \"arn:aws:iam::aws:policy/AdministratorAccess\"\n```\n\n**Note:**\n\nWhile `AdministratorAccess` grants full access to all AWS services and resources, it's not recommended for production environments due to security risks. Instead, create custom IAM policies that grant only the necessary permissions required for deployment operations.\n\n### Deployment\n\nThe `<Engine>CDKPipeline` class creates and adds several tasks to the projen project that then can be used in your pipeline to deploy your application to AWS.\n\nHere's a brief description of each one:\n\n1. **deploy:personal** - This task deploys the application's personal stage, which is a distinct, isolated deployment of the application. The personal stage is intended for personal use, such as testing and development.\n\n2. **watch:personal** - This task deploys the personal stage of the application in watch mode. In this mode, the AWS CDK monitors your application source files for changes, automatically re-synthesizing and deploying when it detects any changes.\n\n3. **diff:personal** - This task compares the deployed personal stage with the current state of the application code. It's used to understand what changes would be made if the application were deployed.\n\n4. **destroy:personal** - This task destroys the resources created for the personal stage of the application.\n\n5. **deploy:feature** - This task deploys the application's feature stage. The feature stage is used for new features testing before these are merged into the main branch.\n\n6. **diff:feature** - This task is similar to `diff:personal`, but for the feature stage.\n\n7. **destroy:feature** - This task destroys the resources created for the feature stage of the application.\n\n8. **deploy:<stageName>** - This task deploys a specific stage of the application (like 'dev' or 'prod').\n\n9. **diff:<stageName>** - This task compares the specified application stage with the current state of the application code.\n\n10. **publish:assets** - This task publishes the CDK assets to all accounts. This is useful when the CDK application uses assets like Docker images or files from the S3 bucket.\n\n11. **bump** - This task bumps the version based on the latest git tag and pushes the updated tag to the git repository.\n\n12. **release:push-assembly** - This task creates a manifest, bumps the version without creating a git tag, and publishes the cloud assembly to your registry.\n\nRemember that these tasks are created and managed automatically by the `CDKPipeline` class. You can run these tasks using the `npx projen TASK_NAME` command.\n\n## Versioning\n\nProjen Pipelines includes a comprehensive versioning system that automatically tracks and exposes deployment versions through various AWS services. This feature enables deployment traceability, automated rollback decisions, and comprehensive audit trails.\n\n### Basic Versioning Configuration\n\nTo enable versioning in your pipeline, add the `versioning` configuration:\n\n```typescript\nimport { awscdk } from 'projen';\nimport { GithubCDKPipeline, VersioningStrategy, VersioningOutputs } from 'projen-pipelines';\n\nconst app = new awscdk.AwsCdkTypeScriptApp({\n // ... other config\n});\n\nnew GithubCDKPipeline(app, {\n // ... other pipeline config\n\n versioning: {\n enabled: true,\n strategy: VersioningStrategy.commitCount(),\n outputs: VersioningOutputs.standard()\n }\n});\n```\n\n### Versioning Strategies\n\nProjen Pipelines provides several built-in versioning strategies:\n\n#### Git Tag Strategy\nUses git tags as the version source, with optional prefix stripping:\n\n```typescript\n// Basic git tag strategy\nconst strategy = VersioningStrategy.gitTag();\n\n// With custom configuration\nconst strategy = VersioningStrategy.gitTag({\n stripPrefix: 'v', // Strip 'v' from tags (v1.2.3 → 1.2.3)\n annotatedOnly: true, // Only use annotated tags\n includeSinceTag: true // Include commits since tag\n});\n```\n\n#### Package.json Strategy\nUses the version from your package.json file:\n\n```typescript\n// Basic package.json strategy\nconst strategy = VersioningStrategy.packageJson();\n\n// With custom configuration\nconst strategy = VersioningStrategy.packageJson({\n path: './package.json',\n includePrerelease: true,\n appendCommitInfo: true\n});\n```\n\n#### Commit Count Strategy\nUses the number of commits as the version:\n\n```typescript\n// Basic commit count strategy\nconst strategy = VersioningStrategy.commitCount();\n\n// With custom configuration\nconst strategy = VersioningStrategy.commitCount({\n countFrom: 'all', // 'all' | 'since-tag'\n includeBranch: true, // Include branch name\n padding: 5 // Zero-pad count (00001)\n});\n```\n\n#### Build Number Strategy\nCreates a version from build metadata:\n\n```typescript\n// Basic build number strategy\nconst strategy = VersioningStrategy.buildNumber();\n\n// With custom configuration\nconst strategy = VersioningStrategy.buildNumber({\n prefix: 'release',\n commitCount: { countFrom: 'all', padding: 5 }\n});\n// Output: release-01234-3a4b5c6d\n```\n\n#### Custom Composite Strategy\nCreate your own version format using template variables:\n\n```typescript\nconst strategy = VersioningStrategy.create(\n '{git-tag}+{commit-count}-{commit-hash:8}',\n {\n gitTag: { stripPrefix: 'v' },\n commitCount: { countFrom: 'since-tag' }\n }\n);\n// Output: 1.2.3+45-3a4b5c6d\n```\n\n### Version Output Configurations\n\nControl how and where version information is exposed:\n\n#### CloudFormation Outputs\nExport version information as CloudFormation stack outputs:\n\n```typescript\n// Basic CloudFormation output\nconst outputs = VersioningOutputs.cloudFormationOnly();\n\n// With custom configuration\nconst outputs = VersioningOutputs.cloudFormationOnly({\n exportName: 'MyApp-{stage}-Version'\n});\n```\n\n#### SSM Parameter Store\nStore version information in AWS Systems Manager Parameter Store:\n\n```typescript\n// Basic parameter store\nconst outputs = VersioningOutputs.parameterStoreOnly('/myapp/{stage}/version');\n\n// Hierarchical parameters\nconst outputs = VersioningOutputs.hierarchicalParameters('/myapp/{stage}/version', {\n includeCloudFormation: true\n});\n```\n\nThis creates parameters like:\n- `/myapp/prod/version` → Full version JSON\n- `/myapp/prod/version/commit` → Commit hash\n- `/myapp/prod/version/tag` → Git tag\n- `/myapp/prod/version/count` → Commit count\n\n#### Standard Configuration\nThe recommended configuration that uses CloudFormation outputs with optional Parameter Store:\n\n```typescript\nconst outputs = VersioningOutputs.standard({\n parameterName: '/myapp/{stage}/version',\n});\n```\n\n### Output Formats\n\nVersion information can be output in two formats:\n\n**Plain Format:** Simple string values in CloudFormation\n```yaml\nOutputs:\n AppVersion:\n Value: \"1.2.3+45-3a4b5c6d\"\n Description: \"Application version\"\n AppCommitHash:\n Value: \"3a4b5c6def1234567890\"\n Description: \"Git commit hash\"\n```\n\n**Structured Format:** JSON object with comprehensive metadata in SSM\n```json\n{\n \"version\": \"1.2.3\",\n \"commitHash\": \"3a4b5c6def1234567890\",\n \"commitCount\": 1234,\n \"commitsSinceTag\": 45,\n \"branch\": \"main\",\n \"tag\": \"v1.2.3\",\n \"deployedAt\": \"2024-01-15T10:30:00Z\",\n \"deployedBy\": \"github-actions\",\n \"buildNumber\": \"456\",\n \"environment\": \"production\"\n}\n```\n\n### Stage-Specific Overrides\n\nConfigure different versioning strategies for different stages:\n\n```typescript\nnew GithubCDKPipeline(app, {\n versioning: {\n enabled: true,\n strategy: VersioningStrategy.gitTag(),\n outputs: VersioningOutputs.standard(),\n stageOverrides: {\n dev: {\n strategy: VersioningStrategy.commitCount(),\n outputs: VersioningOutputs.minimal()\n },\n prod: {\n validation: {\n requireTag: true,\n tagPattern: /^v\\d+\\.\\d+\\.\\d+$/\n }\n }\n }\n }\n});\n```\n\n### Template Variables\n\nAll strategies support these template variables:\n- `{git-tag}` - Git tag (with optional prefix stripping)\n- `{package-version}` - Version from package.json\n- `{commit-count}` - Number of commits\n- `{commit-hash}` - Full commit hash\n- `{commit-hash:8}` - Short commit hash (8 characters)\n- `{branch}` - Git branch name\n- `{build-number}` - CI/CD build number\n\n### Benefits of Versioning\n\n1. **Deployment Traceability**: Always know exactly which code version is deployed\n2. **Automated Rollback**: Use version information for automated rollback decisions\n3. **Audit Trail**: Comprehensive deployment history with metadata\n4. **Multi-Stage Support**: Different versioning strategies per environment\n5. **Zero Configuration**: Works out-of-the-box with sensible defaults\n6. **CI/CD Integration**: Automatically detects version info from CI/CD environments\n\n### Feature Branch Deployments\n\nProjen Pipelines supports automated feature branch deployments for GitHub Actions. This allows you to deploy and test your changes in isolated environments before merging to the main branch. Gitlab support is currently missing.\n\n#### Configuration\n\nTo enable feature branch deployments, add the `featureStages` configuration to your pipeline:\n\n```typescript\nnew GithubCDKPipeline(app, {\n stackPrefix: 'MyApp',\n iamRoleArns: {\n default: 'arn:aws:iam::123456789012:role/GithubDeploymentRole',\n },\n featureStages: {\n env: { account: '123456789013', region: 'eu-central-1' },\n },\n stages: [\n // ... your regular stages\n ],\n});\n```\n\n#### How It Works\n\nWhen feature stages are configured, two GitHub workflows are created:\n\n1. **deploy-feature** - Automatically deploys your feature branch when a pull request is labeled with `feature-deployment`\n2. **destroy-feature** - Automatically destroys the feature deployment when:\n - The pull request is closed\n - The `feature-deployment` label is removed from the pull request\n\n#### Using Feature Deployments\n\n1. Create a pull request with your changes\n2. Add the `feature-deployment` label to trigger deployment\n3. The feature environment will be deployed with a stack name including your branch name\n4. Remove the label or close the PR to destroy the feature environment\n\nThe feature deployment uses the `--force` flag when destroying to ensure cleanup without manual confirmation.\n\n### AWS Amplify Deployment\n\nProjen Pipelines includes support for deploying static websites and single-page applications to AWS Amplify Hosting. This feature provides automated deployment of build artifacts to Amplify, with built-in support for multiple environments and branch-based deployments.\n\n#### Configuration\n\nTo add Amplify deployment to your pipeline, use the `AmplifyDeployStep`:\n\n```typescript\nimport { AmplifyDeployStep } from 'projen-pipelines';\n\n// Using a static Amplify app ID\nconst deployStep = new AmplifyDeployStep(project, {\n appId: 'd123gtgt770s1x',\n artifactFile: 'dist.zip',\n branchName: 'main', // optional, defaults to 'main'\n region: 'us-east-1', // optional, defaults to 'eu-central-1'\n});\n\n// Using dynamic app ID extraction from CDK outputs\nconst deployStep = new AmplifyDeployStep(project, {\n appIdCommand: 'jq -r \\'.MyStack.AmplifyAppId\\' cdk-outputs.json',\n artifactFile: 'build.zip',\n environment: 'production', // optional, for environment-specific deployments\n});\n```\n\n#### How It Works\n\nThe Amplify deployment step:\n1. Checks for any pending Amplify deployments and cancels them if needed\n2. Creates a new deployment with the Amplify service\n3. Uploads your build artifact (zip file) to Amplify\n4. Starts the deployment and monitors its progress\n5. Validates the deployment succeeded\n\n#### Build Artifact Preparation\n\nBefore using the Amplify deployment step, ensure your build process creates a zip file containing your static website assets:\n\n```bash\n# Example: Creating a deployment artifact\nnpm run build\ncd dist && zip -r ../dist.zip . && cd ..\n```\n\n#### Multi-Stage Deployments\n\nFor multi-stage deployments with different Amplify apps per environment:\n\n```typescript\n// In your CDK stack, output the Amplify app ID\nnew CfnOutput(this, 'AmplifyAppId', {\n key: 'AmplifyAppId',\n value: amplifyApp.appId,\n});\n\n// In your pipeline configuration\nconst deployStep = new AmplifyDeployStep(project, {\n appIdCommand: `jq -r '.${stackName}.AmplifyAppId' cdk-outputs-${stage}.json`,\n artifactFile: 'website.zip',\n environment: stage,\n branchName: stage === 'prod' ? 'main' : stage,\n});\n```\n\n## Current Status\n\nProjen-Pipelines is currently in version 0.x, awaiting Projen's 1.0 release. Despite its pre-1.0 status, it's being used in several production environments.\n\n## Contributing\n\n### By raising feature requests or issues\n\nUse the Github integrated \"[Issues](https://github.com/taimos/projen-pipelines/issues/new)\" view to create an item that you would love to have added to our open source project.\n\n***No request is too big or too small*** - get your thoughts created and we'll get back to you if we have questions!\n\n### By committing code\n\nWe welcome all contributions to Projen Pipelines! Here's how you can get started:\n\n1. **Fork the Repository**: Click the 'Fork' button at the top right of this page to duplicate this repository in your GitHub account.\n\n2. **Clone your Fork**: Clone the forked repository to your local machine.\n\n```bash\ngit clone https://github.com/<your_username>/projen-pipelines.git\n```\n\n3. **Create a Branch**: To keep your work organized, create a branch for your contribution.\n\n```bash\ngit checkout -b my-branch\n```\n\n4. **Make your Changes**: Make your changes, additions, or fixes to the codebase. Remember to follow the existing code style.\n\n5. **Test your Changes**: Before committing your changes, make sure to test them to ensure they work as expected and do not introduce bugs.\n\n6. **Commit your Changes**: Commit your changes with a descriptive commit message using conventional commit messages.\n\n```bash\ngit commit -m \"feat: Your descriptive commit message\"\n```\n\n7. **Push to your Fork**: Push your commits to the branch in your forked repository.\n\n```bash\ngit push -u origin my-branch\n```\n\n8. **Submit a Pull Request**: Once your changes are ready to be reviewed, create a pull request from your forked repository's branch into the `main` branch of this repository.\n\nYour pull request will be reviewed and hopefully merged quickly. Thanks for contributing!\n\n### How to test changes?\nThe best way currently is to test things locally or - if you have a working stall of all supported CI/CD tools - manually test the functionalities there in diferent projects.\n\n_For local testing:_\nUsing `yalc push` you can install the project locally to your local yalc package manager. You can also use `npm run local-push` instead of this.\n\nWith `yalc add projen-pipelines` you can then use it in a local project.\n\n\n## Future Plans\n\n* Move the project to the Open Construct Foundation for broader community involvement\n* Continue expanding support for different CI/CD platforms and project types\n\nJoin us in elevating CI/CD pipeline discussions from implementation details to fundamental building blocks, and help create a more efficient, standardized approach to pipeline development!\n\n## Known issues\n\n### Environment variable not recognized during `npx projen`\n\nWhen attempting to run `npx projen`, users may encounter an error related to environment variable substitution within configuration files. Specifically, the `${GITHUB_TOKEN}` placeholder fails to be replaced.\n\n#### Solution\n\nTo resolve this issue, prefix the `npx projen` command with the `GITHUB_TOKEN=` environment variable:\n\n```bash\nGITHUB_TOKEN= npx projen\n```\n"
|
|
110
111
|
},
|
|
111
112
|
"repository": {
|
|
112
113
|
"type": "git",
|
|
@@ -119,6 +120,241 @@
|
|
|
119
120
|
}
|
|
120
121
|
},
|
|
121
122
|
"types": {
|
|
123
|
+
"projen-pipelines.AmplifyDeployStep": {
|
|
124
|
+
"assembly": "projen-pipelines",
|
|
125
|
+
"base": "projen-pipelines.PipelineStep",
|
|
126
|
+
"docs": {
|
|
127
|
+
"stability": "stable",
|
|
128
|
+
"summary": "A step that deploys a web application to AWS Amplify."
|
|
129
|
+
},
|
|
130
|
+
"fqn": "projen-pipelines.AmplifyDeployStep",
|
|
131
|
+
"initializer": {
|
|
132
|
+
"docs": {
|
|
133
|
+
"stability": "stable"
|
|
134
|
+
},
|
|
135
|
+
"locationInModule": {
|
|
136
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
137
|
+
"line": 30
|
|
138
|
+
},
|
|
139
|
+
"parameters": [
|
|
140
|
+
{
|
|
141
|
+
"docs": {
|
|
142
|
+
"summary": "- The projen project reference."
|
|
143
|
+
},
|
|
144
|
+
"name": "project",
|
|
145
|
+
"type": {
|
|
146
|
+
"fqn": "projen.Project"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "config",
|
|
151
|
+
"type": {
|
|
152
|
+
"fqn": "projen-pipelines.AmplifyDeployStepConfig"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
"kind": "class",
|
|
158
|
+
"locationInModule": {
|
|
159
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
160
|
+
"line": 25
|
|
161
|
+
},
|
|
162
|
+
"methods": [
|
|
163
|
+
{
|
|
164
|
+
"docs": {
|
|
165
|
+
"remarks": "Should be implemented by subclasses.",
|
|
166
|
+
"stability": "stable",
|
|
167
|
+
"summary": "Generates a configuration for a bash script step."
|
|
168
|
+
},
|
|
169
|
+
"locationInModule": {
|
|
170
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
171
|
+
"line": 165
|
|
172
|
+
},
|
|
173
|
+
"name": "toBash",
|
|
174
|
+
"overrides": "projen-pipelines.PipelineStep",
|
|
175
|
+
"returns": {
|
|
176
|
+
"type": {
|
|
177
|
+
"fqn": "projen-pipelines.BashStepConfig"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"docs": {
|
|
183
|
+
"remarks": "Should be implemented by subclasses.",
|
|
184
|
+
"stability": "stable",
|
|
185
|
+
"summary": "Generates a configuration for a CodeCatalyst Actions step."
|
|
186
|
+
},
|
|
187
|
+
"locationInModule": {
|
|
188
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
189
|
+
"line": 181
|
|
190
|
+
},
|
|
191
|
+
"name": "toCodeCatalyst",
|
|
192
|
+
"overrides": "projen-pipelines.PipelineStep",
|
|
193
|
+
"returns": {
|
|
194
|
+
"type": {
|
|
195
|
+
"fqn": "projen-pipelines.CodeCatalystStepConfig"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"docs": {
|
|
201
|
+
"remarks": "Should be implemented by subclasses.",
|
|
202
|
+
"stability": "stable",
|
|
203
|
+
"summary": "Generates a configuration for a GitHub Actions step."
|
|
204
|
+
},
|
|
205
|
+
"locationInModule": {
|
|
206
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
207
|
+
"line": 124
|
|
208
|
+
},
|
|
209
|
+
"name": "toGithub",
|
|
210
|
+
"overrides": "projen-pipelines.PipelineStep",
|
|
211
|
+
"returns": {
|
|
212
|
+
"type": {
|
|
213
|
+
"fqn": "projen-pipelines.GithubStepConfig"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"docs": {
|
|
219
|
+
"remarks": "Should be implemented by subclasses.",
|
|
220
|
+
"stability": "stable",
|
|
221
|
+
"summary": "Generates a configuration for a GitLab CI step."
|
|
222
|
+
},
|
|
223
|
+
"locationInModule": {
|
|
224
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
225
|
+
"line": 104
|
|
226
|
+
},
|
|
227
|
+
"name": "toGitlab",
|
|
228
|
+
"overrides": "projen-pipelines.PipelineStep",
|
|
229
|
+
"returns": {
|
|
230
|
+
"type": {
|
|
231
|
+
"fqn": "projen-pipelines.GitlabStepConfig"
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
"name": "AmplifyDeployStep",
|
|
237
|
+
"symbolId": "src/steps/amplify-deploy.step:AmplifyDeployStep"
|
|
238
|
+
},
|
|
239
|
+
"projen-pipelines.AmplifyDeployStepConfig": {
|
|
240
|
+
"assembly": "projen-pipelines",
|
|
241
|
+
"datatype": true,
|
|
242
|
+
"docs": {
|
|
243
|
+
"stability": "stable",
|
|
244
|
+
"summary": "Configuration for an AWS Amplify deployment step."
|
|
245
|
+
},
|
|
246
|
+
"fqn": "projen-pipelines.AmplifyDeployStepConfig",
|
|
247
|
+
"kind": "interface",
|
|
248
|
+
"locationInModule": {
|
|
249
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
250
|
+
"line": 7
|
|
251
|
+
},
|
|
252
|
+
"name": "AmplifyDeployStepConfig",
|
|
253
|
+
"properties": [
|
|
254
|
+
{
|
|
255
|
+
"abstract": true,
|
|
256
|
+
"docs": {
|
|
257
|
+
"stability": "stable",
|
|
258
|
+
"summary": "The artifact file to deploy (zip file containing the build)."
|
|
259
|
+
},
|
|
260
|
+
"immutable": true,
|
|
261
|
+
"locationInModule": {
|
|
262
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
263
|
+
"line": 13
|
|
264
|
+
},
|
|
265
|
+
"name": "artifactFile",
|
|
266
|
+
"type": {
|
|
267
|
+
"primitive": "string"
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"abstract": true,
|
|
272
|
+
"docs": {
|
|
273
|
+
"stability": "stable",
|
|
274
|
+
"summary": "The Amplify app ID (static value)."
|
|
275
|
+
},
|
|
276
|
+
"immutable": true,
|
|
277
|
+
"locationInModule": {
|
|
278
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
279
|
+
"line": 9
|
|
280
|
+
},
|
|
281
|
+
"name": "appId",
|
|
282
|
+
"optional": true,
|
|
283
|
+
"type": {
|
|
284
|
+
"primitive": "string"
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"abstract": true,
|
|
289
|
+
"docs": {
|
|
290
|
+
"stability": "stable",
|
|
291
|
+
"summary": "Command to retrieve the Amplify app ID dynamically."
|
|
292
|
+
},
|
|
293
|
+
"immutable": true,
|
|
294
|
+
"locationInModule": {
|
|
295
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
296
|
+
"line": 11
|
|
297
|
+
},
|
|
298
|
+
"name": "appIdCommand",
|
|
299
|
+
"optional": true,
|
|
300
|
+
"type": {
|
|
301
|
+
"primitive": "string"
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"abstract": true,
|
|
306
|
+
"docs": {
|
|
307
|
+
"stability": "stable",
|
|
308
|
+
"summary": "The branch name to deploy to (defaults to 'main')."
|
|
309
|
+
},
|
|
310
|
+
"immutable": true,
|
|
311
|
+
"locationInModule": {
|
|
312
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
313
|
+
"line": 15
|
|
314
|
+
},
|
|
315
|
+
"name": "branchName",
|
|
316
|
+
"optional": true,
|
|
317
|
+
"type": {
|
|
318
|
+
"primitive": "string"
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"abstract": true,
|
|
323
|
+
"docs": {
|
|
324
|
+
"stability": "stable",
|
|
325
|
+
"summary": "Environment name."
|
|
326
|
+
},
|
|
327
|
+
"immutable": true,
|
|
328
|
+
"locationInModule": {
|
|
329
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
330
|
+
"line": 19
|
|
331
|
+
},
|
|
332
|
+
"name": "environment",
|
|
333
|
+
"optional": true,
|
|
334
|
+
"type": {
|
|
335
|
+
"primitive": "string"
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"abstract": true,
|
|
340
|
+
"docs": {
|
|
341
|
+
"stability": "stable",
|
|
342
|
+
"summary": "The AWS region (defaults to 'eu-central-1')."
|
|
343
|
+
},
|
|
344
|
+
"immutable": true,
|
|
345
|
+
"locationInModule": {
|
|
346
|
+
"filename": "src/steps/amplify-deploy.step.ts",
|
|
347
|
+
"line": 17
|
|
348
|
+
},
|
|
349
|
+
"name": "region",
|
|
350
|
+
"optional": true,
|
|
351
|
+
"type": {
|
|
352
|
+
"primitive": "string"
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
],
|
|
356
|
+
"symbolId": "src/steps/amplify-deploy.step:AmplifyDeployStepConfig"
|
|
357
|
+
},
|
|
122
358
|
"projen-pipelines.ApproverMapping": {
|
|
123
359
|
"assembly": "projen-pipelines",
|
|
124
360
|
"datatype": true,
|
|
@@ -3785,7 +4021,7 @@
|
|
|
3785
4021
|
},
|
|
3786
4022
|
"locationInModule": {
|
|
3787
4023
|
"filename": "src/awscdk/github.ts",
|
|
3788
|
-
"line":
|
|
4024
|
+
"line": 285
|
|
3789
4025
|
},
|
|
3790
4026
|
"name": "createAssetUpload"
|
|
3791
4027
|
},
|
|
@@ -3796,7 +4032,7 @@
|
|
|
3796
4032
|
},
|
|
3797
4033
|
"locationInModule": {
|
|
3798
4034
|
"filename": "src/awscdk/github.ts",
|
|
3799
|
-
"line":
|
|
4035
|
+
"line": 340
|
|
3800
4036
|
},
|
|
3801
4037
|
"name": "createDeployment",
|
|
3802
4038
|
"parameters": [
|
|
@@ -3830,7 +4066,7 @@
|
|
|
3830
4066
|
},
|
|
3831
4067
|
"locationInModule": {
|
|
3832
4068
|
"filename": "src/awscdk/github.ts",
|
|
3833
|
-
"line":
|
|
4069
|
+
"line": 456
|
|
3834
4070
|
},
|
|
3835
4071
|
"name": "createIndependentDeployment",
|
|
3836
4072
|
"parameters": [
|
|
@@ -8314,6 +8550,6 @@
|
|
|
8314
8550
|
"symbolId": "src/versioning/types:VersioningStrategyComponents"
|
|
8315
8551
|
}
|
|
8316
8552
|
},
|
|
8317
|
-
"version": "0.
|
|
8318
|
-
"fingerprint": "
|
|
8553
|
+
"version": "0.3.0",
|
|
8554
|
+
"fingerprint": "F4jh5FMamVNEN3+4/Rg6IEzsRlWrxdmNwNyLnpeg31w="
|
|
8319
8555
|
}
|
package/API.md
CHANGED
|
@@ -2116,6 +2116,103 @@ public readonly schedule: string;
|
|
|
2116
2116
|
|
|
2117
2117
|
## Structs <a name="Structs" id="Structs"></a>
|
|
2118
2118
|
|
|
2119
|
+
### AmplifyDeployStepConfig <a name="AmplifyDeployStepConfig" id="projen-pipelines.AmplifyDeployStepConfig"></a>
|
|
2120
|
+
|
|
2121
|
+
Configuration for an AWS Amplify deployment step.
|
|
2122
|
+
|
|
2123
|
+
#### Initializer <a name="Initializer" id="projen-pipelines.AmplifyDeployStepConfig.Initializer"></a>
|
|
2124
|
+
|
|
2125
|
+
```typescript
|
|
2126
|
+
import { AmplifyDeployStepConfig } from 'projen-pipelines'
|
|
2127
|
+
|
|
2128
|
+
const amplifyDeployStepConfig: AmplifyDeployStepConfig = { ... }
|
|
2129
|
+
```
|
|
2130
|
+
|
|
2131
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
2132
|
+
|
|
2133
|
+
| **Name** | **Type** | **Description** |
|
|
2134
|
+
| --- | --- | --- |
|
|
2135
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStepConfig.property.artifactFile">artifactFile</a></code> | <code>string</code> | The artifact file to deploy (zip file containing the build). |
|
|
2136
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStepConfig.property.appId">appId</a></code> | <code>string</code> | The Amplify app ID (static value). |
|
|
2137
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStepConfig.property.appIdCommand">appIdCommand</a></code> | <code>string</code> | Command to retrieve the Amplify app ID dynamically. |
|
|
2138
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStepConfig.property.branchName">branchName</a></code> | <code>string</code> | The branch name to deploy to (defaults to 'main'). |
|
|
2139
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStepConfig.property.environment">environment</a></code> | <code>string</code> | Environment name. |
|
|
2140
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStepConfig.property.region">region</a></code> | <code>string</code> | The AWS region (defaults to 'eu-central-1'). |
|
|
2141
|
+
|
|
2142
|
+
---
|
|
2143
|
+
|
|
2144
|
+
##### `artifactFile`<sup>Required</sup> <a name="artifactFile" id="projen-pipelines.AmplifyDeployStepConfig.property.artifactFile"></a>
|
|
2145
|
+
|
|
2146
|
+
```typescript
|
|
2147
|
+
public readonly artifactFile: string;
|
|
2148
|
+
```
|
|
2149
|
+
|
|
2150
|
+
- *Type:* string
|
|
2151
|
+
|
|
2152
|
+
The artifact file to deploy (zip file containing the build).
|
|
2153
|
+
|
|
2154
|
+
---
|
|
2155
|
+
|
|
2156
|
+
##### `appId`<sup>Optional</sup> <a name="appId" id="projen-pipelines.AmplifyDeployStepConfig.property.appId"></a>
|
|
2157
|
+
|
|
2158
|
+
```typescript
|
|
2159
|
+
public readonly appId: string;
|
|
2160
|
+
```
|
|
2161
|
+
|
|
2162
|
+
- *Type:* string
|
|
2163
|
+
|
|
2164
|
+
The Amplify app ID (static value).
|
|
2165
|
+
|
|
2166
|
+
---
|
|
2167
|
+
|
|
2168
|
+
##### `appIdCommand`<sup>Optional</sup> <a name="appIdCommand" id="projen-pipelines.AmplifyDeployStepConfig.property.appIdCommand"></a>
|
|
2169
|
+
|
|
2170
|
+
```typescript
|
|
2171
|
+
public readonly appIdCommand: string;
|
|
2172
|
+
```
|
|
2173
|
+
|
|
2174
|
+
- *Type:* string
|
|
2175
|
+
|
|
2176
|
+
Command to retrieve the Amplify app ID dynamically.
|
|
2177
|
+
|
|
2178
|
+
---
|
|
2179
|
+
|
|
2180
|
+
##### `branchName`<sup>Optional</sup> <a name="branchName" id="projen-pipelines.AmplifyDeployStepConfig.property.branchName"></a>
|
|
2181
|
+
|
|
2182
|
+
```typescript
|
|
2183
|
+
public readonly branchName: string;
|
|
2184
|
+
```
|
|
2185
|
+
|
|
2186
|
+
- *Type:* string
|
|
2187
|
+
|
|
2188
|
+
The branch name to deploy to (defaults to 'main').
|
|
2189
|
+
|
|
2190
|
+
---
|
|
2191
|
+
|
|
2192
|
+
##### `environment`<sup>Optional</sup> <a name="environment" id="projen-pipelines.AmplifyDeployStepConfig.property.environment"></a>
|
|
2193
|
+
|
|
2194
|
+
```typescript
|
|
2195
|
+
public readonly environment: string;
|
|
2196
|
+
```
|
|
2197
|
+
|
|
2198
|
+
- *Type:* string
|
|
2199
|
+
|
|
2200
|
+
Environment name.
|
|
2201
|
+
|
|
2202
|
+
---
|
|
2203
|
+
|
|
2204
|
+
##### `region`<sup>Optional</sup> <a name="region" id="projen-pipelines.AmplifyDeployStepConfig.property.region"></a>
|
|
2205
|
+
|
|
2206
|
+
```typescript
|
|
2207
|
+
public readonly region: string;
|
|
2208
|
+
```
|
|
2209
|
+
|
|
2210
|
+
- *Type:* string
|
|
2211
|
+
|
|
2212
|
+
The AWS region (defaults to 'eu-central-1').
|
|
2213
|
+
|
|
2214
|
+
---
|
|
2215
|
+
|
|
2119
2216
|
### ApproverMapping <a name="ApproverMapping" id="projen-pipelines.ApproverMapping"></a>
|
|
2120
2217
|
|
|
2121
2218
|
#### Initializer <a name="Initializer" id="projen-pipelines.ApproverMapping.Initializer"></a>
|
|
@@ -5902,6 +5999,93 @@ public readonly packageJson: PackageJsonConfig;
|
|
|
5902
5999
|
|
|
5903
6000
|
## Classes <a name="Classes" id="Classes"></a>
|
|
5904
6001
|
|
|
6002
|
+
### AmplifyDeployStep <a name="AmplifyDeployStep" id="projen-pipelines.AmplifyDeployStep"></a>
|
|
6003
|
+
|
|
6004
|
+
A step that deploys a web application to AWS Amplify.
|
|
6005
|
+
|
|
6006
|
+
#### Initializers <a name="Initializers" id="projen-pipelines.AmplifyDeployStep.Initializer"></a>
|
|
6007
|
+
|
|
6008
|
+
```typescript
|
|
6009
|
+
import { AmplifyDeployStep } from 'projen-pipelines'
|
|
6010
|
+
|
|
6011
|
+
new AmplifyDeployStep(project: Project, config: AmplifyDeployStepConfig)
|
|
6012
|
+
```
|
|
6013
|
+
|
|
6014
|
+
| **Name** | **Type** | **Description** |
|
|
6015
|
+
| --- | --- | --- |
|
|
6016
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStep.Initializer.parameter.project">project</a></code> | <code>projen.Project</code> | - The projen project reference. |
|
|
6017
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStep.Initializer.parameter.config">config</a></code> | <code><a href="#projen-pipelines.AmplifyDeployStepConfig">AmplifyDeployStepConfig</a></code> | *No description.* |
|
|
6018
|
+
|
|
6019
|
+
---
|
|
6020
|
+
|
|
6021
|
+
##### `project`<sup>Required</sup> <a name="project" id="projen-pipelines.AmplifyDeployStep.Initializer.parameter.project"></a>
|
|
6022
|
+
|
|
6023
|
+
- *Type:* projen.Project
|
|
6024
|
+
|
|
6025
|
+
The projen project reference.
|
|
6026
|
+
|
|
6027
|
+
---
|
|
6028
|
+
|
|
6029
|
+
##### `config`<sup>Required</sup> <a name="config" id="projen-pipelines.AmplifyDeployStep.Initializer.parameter.config"></a>
|
|
6030
|
+
|
|
6031
|
+
- *Type:* <a href="#projen-pipelines.AmplifyDeployStepConfig">AmplifyDeployStepConfig</a>
|
|
6032
|
+
|
|
6033
|
+
---
|
|
6034
|
+
|
|
6035
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
6036
|
+
|
|
6037
|
+
| **Name** | **Description** |
|
|
6038
|
+
| --- | --- |
|
|
6039
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStep.toBash">toBash</a></code> | Generates a configuration for a bash script step. |
|
|
6040
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStep.toCodeCatalyst">toCodeCatalyst</a></code> | Generates a configuration for a CodeCatalyst Actions step. |
|
|
6041
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStep.toGithub">toGithub</a></code> | Generates a configuration for a GitHub Actions step. |
|
|
6042
|
+
| <code><a href="#projen-pipelines.AmplifyDeployStep.toGitlab">toGitlab</a></code> | Generates a configuration for a GitLab CI step. |
|
|
6043
|
+
|
|
6044
|
+
---
|
|
6045
|
+
|
|
6046
|
+
##### `toBash` <a name="toBash" id="projen-pipelines.AmplifyDeployStep.toBash"></a>
|
|
6047
|
+
|
|
6048
|
+
```typescript
|
|
6049
|
+
public toBash(): BashStepConfig
|
|
6050
|
+
```
|
|
6051
|
+
|
|
6052
|
+
Generates a configuration for a bash script step.
|
|
6053
|
+
|
|
6054
|
+
Should be implemented by subclasses.
|
|
6055
|
+
|
|
6056
|
+
##### `toCodeCatalyst` <a name="toCodeCatalyst" id="projen-pipelines.AmplifyDeployStep.toCodeCatalyst"></a>
|
|
6057
|
+
|
|
6058
|
+
```typescript
|
|
6059
|
+
public toCodeCatalyst(): CodeCatalystStepConfig
|
|
6060
|
+
```
|
|
6061
|
+
|
|
6062
|
+
Generates a configuration for a CodeCatalyst Actions step.
|
|
6063
|
+
|
|
6064
|
+
Should be implemented by subclasses.
|
|
6065
|
+
|
|
6066
|
+
##### `toGithub` <a name="toGithub" id="projen-pipelines.AmplifyDeployStep.toGithub"></a>
|
|
6067
|
+
|
|
6068
|
+
```typescript
|
|
6069
|
+
public toGithub(): GithubStepConfig
|
|
6070
|
+
```
|
|
6071
|
+
|
|
6072
|
+
Generates a configuration for a GitHub Actions step.
|
|
6073
|
+
|
|
6074
|
+
Should be implemented by subclasses.
|
|
6075
|
+
|
|
6076
|
+
##### `toGitlab` <a name="toGitlab" id="projen-pipelines.AmplifyDeployStep.toGitlab"></a>
|
|
6077
|
+
|
|
6078
|
+
```typescript
|
|
6079
|
+
public toGitlab(): GitlabStepConfig
|
|
6080
|
+
```
|
|
6081
|
+
|
|
6082
|
+
Generates a configuration for a GitLab CI step.
|
|
6083
|
+
|
|
6084
|
+
Should be implemented by subclasses.
|
|
6085
|
+
|
|
6086
|
+
|
|
6087
|
+
|
|
6088
|
+
|
|
5905
6089
|
### AwsAssumeRoleStep <a name="AwsAssumeRoleStep" id="projen-pipelines.AwsAssumeRoleStep"></a>
|
|
5906
6090
|
|
|
5907
6091
|
A step that assumes a role in AWS.
|