CL9: Add Approval & Deployment

Task: Add Approval & Deployment

Add Approval Step

Open your pipeline and go to edit mode. Add a new stage below the Build.

Node

Add a new Action Group & Action “Approve”, make sure to select the proper SNS topic. The result should look as follows:

Node

Add Deployment Step

Create an additonal Action called Deploy and select AWS CodeBuild as Action provider:

Node

As previously done, create a new CodeBuild project. Suggested naming is <artifactId>-deploy.

Note: Make sure so select Ubuntu as OS once again!

Node

As Buidlspec, enter deployspec.yml:

Node

Finish the CodeBuild Wizard and return to CodePipeline. Finish the CodePipeline Wizard.

Node

The result should look as follows:

Node

Hit save!

Test

To trigger a new pipeline execution, just modify any file inside the repository and push changes e.g. put a comment in deployspec.yml.

$ git add *
$ git commit -m 'changed deployspec'
$ git push

Now check your pipeline and approve

Node

In case of errors, check the CodeBuild logs -> Build Details.

If you are facing the following “AccessDeniedException”, make sure to modify the respective role.

Node

Go to AWS IAM, locate the mentioned role and add a “AmazonSSMReadOnlyAccess” or similar policy:

Node

Restart the pipeline manually, by pressing “Release change”:

Node

Check for a successful build

Node

Verify, that the deployment has actually taken place, by looking into the Build logs.

Node

From the Build logs, note down the routes URL - you should now be able to launch it via your web browser. The output should look as follows:

Node

Make sure to also check your SAP Cloud Platform Cockpit - Applications Area!