You have been brought into a scenario where our entire DevOps team just vanished over night. We suspect it could be an alien abduction, since some of our engineers brought up UFO sightings in the stand-ups last week (Needs peer review).
We are planning for the big release of our Hello World Application by end of the day
Our DevOps team was working day and night to get this application onto the CICD pipeline but, unfortunately they couldnt complete it, which is where you come in!
Status: In-progress
Application Code: https://github.com/DevOpsTestLab/sample-spring-boot
Description:
The DevOps team picked up this work as part of the CICD onboarding but, unfortunately they couldn't complete it.
Below is the block diagram of how the pipeline should look like. The blocks in RED needs your attention.
Description: We will be using Jenkins as our CICD tool. Here is the link to our Jenkins repo, https://github.com/DevOpsTestLab/jenkins. This Jenkins repo will have all the required Terraform files needed to deploy a Jenkins server on an EC2 instance. Here are the things for you to consider,
- Setup your bucket, statefiles and required IAM roles and policies on AWS
- Update your bucket and statefile names in the TF files - https://github.com/DevOpsTestLab/jenkins/blob/main/main.tf#L7-L8
- Setup your private key pair - https://github.com/DevOpsTestLab/jenkins/blob/main/ec2.tf
- Run the terraform plan and apply from your local or any other instance where you are running terraform from
- The Jenkins initial admin password should be available on your terraform output prompt, refer, https://github.com/DevOpsTestLab/jenkins/blob/main/ec2.tf#L21
- Once the Terraform provisioning completes, open the public IP with the right port number
- Install suggested plugins and create a initial user to get started with the next task
- Install the following plugins as they are bare minimum to get you started,
Note: Based on the latest update we have from our DevOps team(Before they vanished), this instance may not be fully ready, we know it spins up successfully.However, you may still have to modify any configuration, install plugins, create new configurations, add credentials to support our new onboarding initiative.
Description: Here is our flagship application which needs to be onboarded, https://github.com/DevOpsTestLab/sample-spring-boot. Fork this repository under your own github account so that you can work on it independently. You should see the
Jenkinfile
as part of the repository which our DevOps team created. Its developed in springboot and gradle is used as the build automation tool. Create a multi-branch pipeline project in our Jenkins instance and confirm that the build is successful. Although not a top priority, you can ensure that each build is also running Unit tests and creating coverage report to use in sonarqube.
Note: Feel free to install any plugin in Jenkins to make this work. Set-up GITHUB credentials in Jenkins so that it can checkout and perform the build.
Description: We would like to get visibility on our code quality. Please integrate sonarqube in our pipeline. Here are the details below of our sonarqube server, https://sonarcloud.io/. Please integrate your GITHUB account with sonarcloud and create an organization. Update the
Jenkinsfile
to include a new stage calledsonarqube
and add the logic to scan the project. You may have already seen that the devops team has used docker pipeline to use docker containers as our execution environment. Please stick to the same approach if possible.
Note: Please make sure that you dont interfere with the ongoing development on the master branch. Follow branching and merging strategies as much as possible. The multi-branch pipeline will spin up automated jobs for each new branch you create. Feel free to look up in dockerhub for any docker images that you can find to use as the execution environment.
Here are some useful links,
- https://sonarcloud.io/documentation/analysis/analysis-parameters/
- https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-jenkins/
Description: Based on the latest update from the DevOps team, one of the engineers was "working" on containerzing the application. You should see a
Dockerfile
in the repo. We were told that the docker build was failing with theCOPY
step, troubleshoot the same and integrate it in the pipeline. Add a new stage for docker build and docker push to the docker hub. You may have already seen that the devops team has used docker pipeline to use docker containers as our execution environment. Please stick to the same approach if possible.
Note: Please make sure to not interfere with the ongoing development on the master branch. Follow branching and merging strategies as much as possible. The multi-branch pipeline will spin up automated jobs for each new branch you create. Feel free to look up in dockerhub for any docker images that you can find to use as the execution environment. You can use your personal credentials to perform the docker push from Jenkins. Make sure to not put your credentials in clear text. Tag the docker images along with the Jenkins build number. Feel free to install any plugins as required.
Description: Based on the latest update from the DevOps team, one of the engineers was "working" on creating the manifest file(
kubernetes.yml
) for our application. You should see akubernetes.yml
in the repo. Review the file carefully, it should have a deployment and the service definitions. Make any changes to it in-order to support this deployment. Setup a new stage inJenkinsfile
for App deployment and implement the deployment to your EKS Cluster.
Note: Please make sure to not interfere with the ongoing development on the master branch. Follow branching and merging strategies as much as possible. The multi-branch pipeline will spin up automated jobs for each new branch you create. Feel free to look up in dockerhub for any docker images that you can find to use as the execution environment. For this you would need an execution environment with kubectl in it. You can use the https://plugins.jenkins.io/kubernetes-cd/ plugin for this, but its really up to you! Innovate and Improvise wherever possible!