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:
- GitHub Action Workflow File to define a GitHub Action CI
multi-branch pipeline. - specs Folder to hold the specification file for provided proxy.
- test Folder to hold the specification (owasp ruleset), unit and integration tests.
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 git@github.com:g-lalevee/Apigee-Simple-Github_CI-Pipeline.git
cd Apigee-Simple-Github_CI-Pipeline
git init
git remote add origin git@github.com: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-pipelineGitHub 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...
- Update the .github/workflows/apigee-ci.yml file.
In "env" section (workflow level), changeDEFAULT_APIGEE_ORGvalue by your target Apigee organization. - Read carefully the "Set Variables for [Main] branch" step to check if the multibranch rules match your GitHub and Apigee environment naming and configuration.
- Save
- 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.
- Click on it to see execution detail. In list of jobs, click on Apigee-Deploy.
- At the end of execution, you can download artifacts.
Click on Summary link and scroll down to the Artifacts section.
- 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:



