Coder Social home page Coder Social logo

apigee-simple-github-pipeline's Introduction

PyPI status

Apigee-Simple-Github-Pipeline

This is not an official Google product.
This implementation is not an official Google product, nor is it part of an official Google product. Support is available on a best-effort basis via GitHub.


Goal

Simple implementation for a CI/CD pipeline for Apigee using GitHub repository, CI/CD with GitHub and the Apigee Maven Plugins.

The CICD pipeline includes:

  • Git branch dependent Apigee environment selection and proxy naming to allow deployment of feature branches as separate proxies in the same environment
  • Open API Specification (Swagger) static code analysis using stoplight spectral
  • Static Apigee Proxy code analysis using apigeelint
  • Static JS code analysis using eslint
  • Unit JS testing using mocha
  • Integration testing of the deployed proxy using apickli
  • Packaging and deployment of an Apigee configuration using Apigee Config Maven Plugin
  • Packaging and deployment of the API proxy bundle using Apigee Deploy Maven Plugin

API Proxy and Apigee configuration

The folder ./apiproxy includes a simple API proxy bundle, a simple Apigee configuration file ./EdgeConfig/edge.json as well as the following resources:

Target Audience

  • Operations
  • API Engineers
  • Security

Limitations & Requirements

  • The authentication to the Apigee Edge management API is done using OAuth2. If you require MFA, please see the documentation for the Maven deploy plugin for how to configure MFA.
  • The authentication to the Apigee X / Apigee hybrid management API is done using a GCP Service Account. See CI/CD Configuration Instructions.

CI/CD Configuration Instructions

Initialize a GitHub Repository

Create a GitHub repository to hold your API Proxy.

To use the Apigee-Simple-Github_CI-Pipeline in your GitHub repository like github.com/my-user/my-api-proxy-repo, follow these steps:

git clone [email protected]:g-lalevee/Apigee-Simple-Github_CI-Pipeline.git
cd Apigee-Simple-Github_CI-Pipeline
git init
git remote add origin [email protected]:my-user/my-api-proxy.git
git checkout -b feature/cicd-pipeline
git add .
git commit -m "initial commit"
git push -u origin feature/cicd-pipeline

GitHub Configuration

Add GitHub secrets APIGEE_CREDS_USR and APIGEE_CREDS_PSW, to store your Apigee User ID and password:

  • Go to your repository’s Settings > Secrets.
  • Click the New Repository Secret button.
    Fill in the details:
    • Name: APIGEE_CREDS_USR
    • Value: your Apigee user ID
    • Click the Add secret button
  • Click again the New Repository Secret button.
    Fill in the details:
    • Name: APIGEE_CREDS_PSW
    • Value: your Apigee user ID password
    • Click the Add secret button

Run the pipeline

Using your favorite IDE...

  1. Update the .github/workflows/apigee-ci.yml file.
    In "env" section (workflow level), change DEFAULT_APIGEE_ORG value by your target Apigee organization.
  2. Read carefully the "Set Variables for [Main] branch" step to check if the multibranch rules match your GitHub and Apigee environment naming and configuration.
  3. Save
  4. Commit, Push.. et voila!

Use the GitHub UI to monitor your pipeline execution:

  • Go to your GitHub repository > Actions (tab). You can see your workflow running.

GitHub CICD Pipeline
 

  • Click on it to see execution detail. In list of jobs, click on Apigee-Deploy.

GitHub CICD Pipeline Animated
 

  • At the end of execution, you can download artifacts.
    Click on Summary link and scroll down to the Artifacts section.

GitHub CICD Pipeline artifacts
 

  • For example, download apigeelint-report.zip file and open html content with your browser. You can see the results of static code analysis for Apigee proxy with Apigeelint tool:

GitHub CICD Pipeline apickli
 

apigee-simple-github-pipeline's People

Contributors

g-lalevee avatar nabilrehman8 avatar clalevee avatar nabilrehman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.