This sample demonstrates how to use the Apigee Maven deploy plugin to deploy a proxy to Apigee using Cloud Build
- Provision Apigee X
- Access to deploy proxies to Apigee, trigger Cloud Build
- Configure external access for API traffic to your Apigee X instance
- Make sure the following tools are available in your terminal's $PATH (Cloud Shell has these pre-configured)
- gcloud SDK
- unzip
- curl
- jq
- npm
Use the following GCP CloudShell tutorial, and follow the instructions.
- Clone the apigee-samples repo, and switch the deploy-apigee-proxy directory
git clone https://github.com/GoogleCloudPlatform/apigee-samples.git
cd apigee-samples/deploy-apigee-proxy
- Edit the
env.sh
and configure the ENV vars
PROJECT
the project where your Apigee organization is locatedAPIGEE_HOST
the externally reachable hostname of the Apigee environment group that contains APIGEE_ENVAPIGEE_ENV
the Apigee environment where the demo resources should be created
Now source the env.sh
file
source ./env.sh
- 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"
- Trigger the build
gcloud builds submit --config cloudbuild.yaml . \
--substitutions="_APIGEE_TEST_ENV=$APIGEE_ENV"
You can test the API call to make sure the deployment was successful
curl -v -X GET https://$APIGEE_HOST/v1/samples/hello-cicd
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-proxy.sh