mrwconsulting/ciflex-samples

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:

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:
    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 = __
    ✨ 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: __
    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: __
    ✨ 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"**