- If you enjoyed this kata you can continue with the Second part.
Install Docker
$ # Run inside docker container
$ docker run --rm -d \
-p 8080:8080 \
-v jenkins_home:/var/jenkins_home \
--name my-jenkins \
jenkins/jenkins:lts
$ # Get the admin password
$ docker exec -it my-jenkins cat /var/jenkins_home/secrets/initialAdminPassword
$ # Stop Jenkins
$ docker kill my-jenkins
- Recommended plugins.
- Blue Ocean.
- Pipeline: AWS Steps.
- Slack Notification Plugin.
- Notifications channel #jenkins.
- S3 bucket pipeline_kata/my-team-name.
- Create a pipeline job. You can use the Scripted or Declarative Pipeline.
- Download the source code from the forked repository (master branch).
- Build the project and launch the unit tests. You can use the following command:
Create a version using the current job build number.
$ mvn clean package -Drevision=${VERSION}
Hint: you need to install Maven 3.5.0 or newer. - Publish on Jenkins your test results using the junit step.
Get the build result (JAR) from the /target directory and save it in Jenkins for later retrieval. You can use the archive step. - Upload the JAR to AWS S3 bucket (create a directory with you team name).
Take care how you store your credentials.
Hint: you need AWS credentials for this step. - Send Slack notification in case of successful or failed execution.
You can send any information like job name, build number, message color etc...
Hint: you need the Slack URL and a token for this step. - Pipeline as code. Move the pipeline code in a Jenkinsfile and push it to the same repository. Pool the repository to detect any commit changes and start the build without manual steps.