SPEAKER: Hi, there.
In this sample, I will demonstrate
how to use the Apigee Maven deploy plugin to deploy
a shared flow from your source code
to Apigee using Cloud Build.
Apigee Maven plugin is a tool for building and deploying
the bundles into your Apigee platform,
and Cloud Build is a fully managed continuous integration
delivery and deployment platform that lets you run fast,
consistent, and reliable automated builds.
The prerequisites for this sample
are, have an Apigee X provision and configure external axis
for API traffic.
As a user, you will need access to deploy shared flows
to your Apigee environment and also trigger Cloud Build
job in your GCP project.
Also, you will need tools like gcloud, unzip, curl,
and jq installed.
Now this sample can be demonstrated
using the Quickstart available through Cloud Shell,
or following the setup instructions.
In this video, we will be using the Cloud Shell Quickstart.
Click the Open into Google Cloud shell
to open the Cloud Shell environment.
Once the environment is loaded, let's follow the instructions
provided in the tutorial.
Now that we have our Cloud Shell totally, completely loaded,
let's go through the tutorial that we have on the very right.
Now, the first thing we will have to do
is to set up the environment.
Now, for that, let's first go through the log in process.
Going to go through the log in.
Allow.
Copy my auth code, paste it over here, and that's logged in.
Now let's go into the appropriate directory.
In our case, it's deploy-apigee-sharedflow.
Now let's click the Click here link that
takes us to the file editor.
Now, in this file editor, we basically
have different variables that we need to populate.
We have the project ID.
We have the Apigee environment.
So let's go ahead and fill that out.
Now let's save the file, and then let's source the ./env.sh
file.
Let's click Authorize.
Then let's click Start.
On the next step, what we'll have to do
is we basically will enable the Cloud Build API.
So let's click this command that basically enables the Cloud
Build on this GCP project.
Now, once it's enabled, let's make sure
that the Cloud Build service account has the Apigee Org
Admin role to do the deployments for us.
That's complete.
Now let's trigger off the Cloud Build job using this gcloud
command and passing the Apigee environment that we had sourced
to the ./env.sh file.
Now, this is going to take a few minutes.
Once the Cloud Build job is complete,
you should see a status that says success,
and at the end of the Cloud Build trigger,
you will actually see a shared flow that is deployed
to the Apigee environment with the name sample-hello-cicd-sf.
Now, let's log in to the Apigee Console,
and let's go to Develop and click Shared Flows.
You'll see that there is a sample-hello-cicd-sf deployed
a minute ago.
Now, let's go back in here.
Now that verifies that we were able to deploy the shared flow.
And once you're done with this, you
can actually go up and clean up your artifacts.
For that, you just have to run the ./clean-up script that we
have.
Once that's complete, you can go back
and you can make sure that it's deleted from your Apigee
environment.
Thanks for watching.
I hope this content was useful to you.
If you have not signed up for Apigee yet, use this link.
And if you have any questions, please
visit the Apigee community.