Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

History

README.md

Deploy Apigee Sharedflow using Apigee Maven plugin and Cloud Build

This sample demonstrates how to use the Apigee Maven deploy plugin to deploy a sharedflow to Apigee using Cloud Build

Screencast

Alt text

Prerequisites

  1. Provision Apigee X
  2. Access to deploy sharedflow to Apigee, trigger Cloud Build
  3. Configure external access for API traffic to your Apigee X instance
  4. Make sure the following tools are available in your terminal's $PATH (Cloud Shell has these pre-configured)

(QuickStart) Setup using CloudShell

Use the following GCP CloudShell tutorial, and follow the instructions.

Open in Cloud Shell

Setup instructions

  1. Clone the apigee-samples repo, and switch the deploy-apigee-sharedflow directory
git clone https://github.com/GoogleCloudPlatform/apigee-samples.git
cd apigee-samples/deploy-apigee-sharedflow
  1. Edit the env.sh and configure the ENV vars
  • PROJECT the project where your Apigee organization is located
  • APIGEE_ENV the Apigee environment where the demo resources should be created

Now source the env.sh file

source ./env.sh
  1. Enable the Cloud Build API and assign Apigee Org admin role to the Cloud Build service account
gcloud services enable cloudbuild.googleapis.com

gcloud projects add-iam-policy-binding "$PROJECT" \
  --member="serviceAccount:$CLOUD_BUILD_SA" \
  --role="roles/apigee.admin"
  1. Trigger the build
gcloud builds submit --config cloudbuild.yaml . \
    --substitutions="_APIGEE_TEST_ENV=$APIGEE_ENV"

Verification

Login to the Apigee console, click "Develop" and then "Shared Flows", you should see a sharedflow called sample-hello-ci-cd-sf imported and deployed.

Cleanup

If you want to clean up the artifacts from this example in your Apigee Organization, first source your env.sh script, and then run

./clean-up-deploy-apigee-sharedflow.sh