Skip to content

CICD Platform automates AWS CodePipeline setup with CDK, CodeBuild, DynamoDB, and Cognito, enhancing CI/CD workflows and integrating with ServiceCatalog.

License

Notifications You must be signed in to change notification settings

mrwconsulting/ciflex-samples

Repository files navigation

CICD Platform

ciflex-platform

CICD Platform is an AWS CodePipeline generator that simplifies pipeline creation by automating building, unit testing, code style linting, and deploying tasks.As a fully managed continuous delivery service, this DevOps platform leverages CDK, CodeBuild, Dynamodb and Cognito to streamline AWS CodePipeline infrastructure and efficiently manage and automate CI/CD processes. With CiFlex, DevOps teams can create and publish plugins to introduce new features and enhance their CI/CD workflows. Additionally, it integrates with ServiceCatalog to provide a comprehensive solution for managing CodePipeline setups.

Benefits:

  • Self-Mutating CICD Pipeline: CiFlex plugins can be dynamically added, updated with new values, or removed without coding, enabling a pipeline to reconfigure itself to deploy new or updated stages. Pipelines will automatically update based on configuration files submitted by application teams.

  • Plugin-Based Architecture: With a plugin-based architecture, DevOps teams can effortlessly extend functionality by creating or modifying plugins. This empowers application teams to swiftly incorporate new capabilities into their pipelines, adapting to changing requirements with ease.

  • Authorization: CiFlex prioritizes security by leveraging AWS Cognito services to protect its APIs with JSON Web Tokens (JWT). This ensures that application teams must authenticate to create and provision pipelines, guaranteeing secure access and maintaining data integrity.

  • AWS Service Catalog Integration: Streamline pipeline creation and provisioning with seamless integration into the AWS Service Catalog. Centralize management of pipeline resources to enhance efficiency and governance for application teams.

  • Pipeline-Level Variables : Both stages and steps expose pipeline variables to be easily consumed by other stages and steps. These pipeline-level variables are fully customizable, allowing you to define their names and values.

  • Command-Line Inteface: A unified tool that offers a consistent interface for interacting with CiFlex APIs.

  • Technology: CDK,Cognito,Dynamodb,CodeBuild,CodePipeline,Service Catalog

AWS Service Catalog Integration

AWS Service Catalog Integration

Dynamically Configure AWS CodePipeline

Dynamically Configure AWS CodePipeline

Prerequisites

Usage

export CIFLEX_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx

npm config set //npm.pkg.github.com/:_authToken $CIFLEX_TOKEN
npm config set @mrwconsulting:registry https://npm.pkg.github.com/
npm install @ciflex/ciflexctl --global

ciflexctl --help
ciflexctl --version

Platform Setup

  1. Request CiFlex Token: (email: support@mrwconsulting.tech)

  2. Install CiFlex Platform:

    export AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
    export AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>
    export CIFLEX_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    npm config set //npm.pkg.github.com/:_authToken $CIFLEX_TOKEN
    npm config set @mrwconsulting:registry https://npm.pkg.github.com/
    npm install @ciflex/ciflexctl --global
    
    ciflexctl platform --setup --vpcId <VPC_ID>

    Detected vpc id: <VPC_ID>
    Verify toolkit stack...
    Toolkit stack exists..

    ✨ Synthesis time: 7.06s
    stack (ciflex-platform-stack): deploying... [1/1]
    ciflex-platform-stack: creating CloudFormation changeset...

    ✅ stack (ciflex-platform-stack)
    ✨ Deployment time: 309.76s

    Outputs:
    stack.restapiEndpoint7C8BD49C = <https...>
    ✨ Total time: 325.35s

    Do you want to install cognito admin account? [y/N]y
    Enter cognito username: [admin]
    Enter cognito email: [support@mrwconsulting.tech]
    Enter cognito password: [Password01!]

    Cognito account configured: <arn...>
    Do you want to load default plugins? [y/N]y
    Creating dynamodb table: ciflex-registry
    Loading default plugins...

    Do you want to initialize catalog repository? [y/N]y

    ✨ Synthesis time: 5.32s

    ciflex-catalog-stack: deploying... [1/1]
    ciflex-catalog-stack: creating CloudFormation changeset...

    ✅ ciflex-catalog-stack
    ✨ Deployment time: 56.37s

    Stack ARN: <arn...>
    ✨ Total time: 61.69s

    Catalog repository initialized...

Pipeline Samples

export AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
export AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>
export CIFLEX_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx

cd springboot-maven
../bin/access-token.sh 
export CIFLEX_ACCESS_TOKEN=<CIFLEX_ACCESS_TOKEN>
ciflexctl pipeline --deploy

List Available Plugins

export AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
export AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>

ciflexctl plugins --list

FAQ

Q. What are the environment variables used to configure CiFlexctl?
A. Here are a few common ones. See the documentation for more details.

    export CIFLEX_TOKEN="license token"
    export CIFLEX_ACCESS_TOKEN="your access token" **"CiFlex access token, created by Cognito"**
    export VPC_ID="your vpc id" **"Target AWS VPC for setup"**

Q. Can we add our own stages and steps?
A. Certainly! You can add your own custom stages \ steps to a pipeline by including them in the YAML file that defines the pipeline. This allows you to tailor the pipeline to your specific requirements and workflows.

Q. Can we create our own plugins or update existing ones?
A. Yes, use ciflexctl

    ciflexctl plugins --help

Q. Can different pipelines be deployed based on a branch in our software development process?
A. Yes, create pipeline properties file. Here's example:[pipeline.properties]

    [branch name]: [pipeline configuration file]
    main: pipeline.yaml
    dev: pipeline-dev.yaml

Q. How do I disable a pipeline stage?
A. Both stages and steps can be disabled by setting the 'isActive' attribute to 'false'. Here's an example

    - stageName: DeployStage
      pluginName: Manual-Approval
      isActive: false **"this disable entire stage"**

Links

About

CICD Platform automates AWS CodePipeline setup with CDK, CodeBuild, DynamoDB, and Cognito, enhancing CI/CD workflows and integrating with ServiceCatalog.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published