feat: add CI/CD Pipeline recipe (#5183)
Signed-off-by: Dakshata <dakshatamishralakshya@gmail.com>
This commit is contained in:
@@ -0,0 +1,99 @@
|
|||||||
|
version: 1.0.0
|
||||||
|
title: CI-CD Pipeline Generator
|
||||||
|
description: Generates a CI-CD pipeline configuration (GitHub Actions, GitLab CI) based on project language and framework.
|
||||||
|
author:
|
||||||
|
contact: the-matrixneo
|
||||||
|
|
||||||
|
activities:
|
||||||
|
- Detect project type
|
||||||
|
- Generate pipeline YAML
|
||||||
|
- Create build, test, deploy stages
|
||||||
|
- Add caching and matrix testing
|
||||||
|
- Specify required secrets setup
|
||||||
|
|
||||||
|
instructions: |
|
||||||
|
You are a DevOps Automation Specialist, that generates robust and efficient CI/CD pipeline files.
|
||||||
|
Your goal is to analyze a project and produce a ready-to-use configuration file tailored to the user's specifications.
|
||||||
|
Key capabilities:
|
||||||
|
- Automatically detect the project's language and framework.
|
||||||
|
- Generate pipeline YAML for different platforms (GitHub Actions, GitLab CI).
|
||||||
|
- Create logical stages for building, testing, and deploying.
|
||||||
|
- Implement optimizations like dependency caching.
|
||||||
|
- Provide clear instructions for setting up required secrets.
|
||||||
|
IMPORTANT: Always start by checking memory for any saved user preferences, to ensure a consistent workflow.
|
||||||
|
|
||||||
|
prompt: |
|
||||||
|
Generate a CI/CD pipeline configuration:
|
||||||
|
- Platform: {{ platform }}
|
||||||
|
- Project Type: {{ project_type }}
|
||||||
|
- Deployment Target: {{ deployment_target }}
|
||||||
|
{% if branch_name %}
|
||||||
|
- Main Branch: {{ branch_name }}
|
||||||
|
{% endif %}
|
||||||
|
{% if project_context %}
|
||||||
|
- Project Context: {{ project_context }}
|
||||||
|
{% endif %}
|
||||||
|
Steps:
|
||||||
|
1. Memory & Context: Load preferences (cloud provider, Docker registry, secrets).
|
||||||
|
2. Project Analysis: If "auto," scan for key files; derive build/test commands.
|
||||||
|
3. Pipeline Logic:
|
||||||
|
- Setup: Checkout repo, set up language, cache dependencies.
|
||||||
|
- Build: Install dependencies, then run build script only if defined in the project (use shell conditional logic to check for a 'build' script).
|
||||||
|
- Test: Run tests, optionally lint/code quality.
|
||||||
|
- Deploy (conditional):
|
||||||
|
{% if deployment_target == "docker" %}
|
||||||
|
- Build & push Docker image (use DOCKER_USERNAME, DOCKER_PASSWORD).
|
||||||
|
{% elif deployment_target == "serverless" %}
|
||||||
|
- Serverless deploy (use AWS_ACCESS_KEY_ID).
|
||||||
|
{% endif %}
|
||||||
|
- Matrix: Include matrix testing when applicable.
|
||||||
|
- Validate: Ensure generated YAML is valid.
|
||||||
|
4. Save & Summarize:
|
||||||
|
- Save: `.github/workflows/main.yml` (GitHub), `.gitlab-ci.yml` (GitLab).
|
||||||
|
- Output config and list required secrets.
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
- key: platform
|
||||||
|
input_type: string
|
||||||
|
requirement: required
|
||||||
|
description: "CI/CD platform: 'github_actions', 'gitlab_ci'."
|
||||||
|
default: "github_actions"
|
||||||
|
|
||||||
|
- key: project_type
|
||||||
|
input_type: string
|
||||||
|
requirement: optional
|
||||||
|
description: "Project type: 'nodejs', 'python', 'go', 'auto'."
|
||||||
|
default: "auto"
|
||||||
|
|
||||||
|
- key: deployment_target
|
||||||
|
input_type: string
|
||||||
|
requirement: optional
|
||||||
|
description: "Deployment: 'none', 'docker', 'serverless'."
|
||||||
|
default: "none"
|
||||||
|
|
||||||
|
- key: branch_name
|
||||||
|
input_type: string
|
||||||
|
requirement: optional
|
||||||
|
description: "Main branch for pipeline trigger."
|
||||||
|
default: "main"
|
||||||
|
|
||||||
|
- key: project_context
|
||||||
|
input_type: string
|
||||||
|
requirement: optional
|
||||||
|
description: "Additional context, versions or build flags."
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
extensions:
|
||||||
|
- type: builtin
|
||||||
|
name: developer
|
||||||
|
display_name: Developer
|
||||||
|
timeout: 300
|
||||||
|
bundled: true
|
||||||
|
description: For file system scanning, project detection, YAML saving.
|
||||||
|
|
||||||
|
- type: builtin
|
||||||
|
name: memory
|
||||||
|
display_name: Memory
|
||||||
|
timeout: 300
|
||||||
|
bundled: true
|
||||||
|
description: For storing preferences of deployment platform.
|
||||||
Reference in New Issue
Block a user