O'Reilly logo

AWS Automation Cookbook by Nikit Swaraj

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Workflow

Whenever the latest code pushed in master branch, Jenkins will get triggered and it will pick up the Jenkinsfile. In the Jenkinsfile, the following things will be mentioned:

  • Pull the repository in the Jenkins server
  • Then it will build the image of the application
  • It will upload the image to ECR
  • The next step depends upon the value on parameter, that whether we want to deploy the latest image in Kubernetes cluster or simply want to push the image to ECR
  • Then, it will ssh to the Kubernetes cluster and update the latest image in the deployment

Now, we have to implement the workflow in Jenkinsfile:

  1. Let's start with the agent section. Agent will be the Jenkins master only:
    pipeline {     agent any    }
  1. Let's talk about the parameter. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required