This is a bash script for easy installation, provision & logging the Jenkins and Elastic Stack. Tho ship the Jenkins log, this project using filebeat and will be parsed by logstash.
This script depends on docker and docker-compose, so before running the script, kindly make sure that the server has that service / bin.
- Assign Jenkins custom variable ( username, password, server ip ) into .env
- Assign Elastic Password into .env
- Create docker internal network so the service can communicate and compose down won’t delete the network
- Run Elastic Stack compose & build
- Run Jenkins Filebeat Compose & build
- Docker compose down for Elastic Stack to remove the elastic container
- Docker compose down for Jenkins Filebeat to remove the jenkins container
- Remove created internal network
- Removing volume for elastic and jenkins
This is the tree structure of this project / repository.
.
|-- README.MD
|-- elastic-stack
| |-- docker-compose.yml
| |-- elasticsearch
| | |-- Dockerfile
| | `-- elasticsearch.yml
| |-- kibana
| | |-- Dockerfile
| | `-- kibana.yml
| `-- logstash
| |-- Dockerfile
| |-- logstash.conf
| `-- logstash.yml
|-- install.sh
|-- jenkins-preconfigured
| |-- docker-compose.yml
| |-- filebeat
| | |-- Dockerfile
| | `-- filebeat.yml
| `-- jenkins
| |-- Dockerfile
| |-- casc.yaml
| `-- plugins.txt
`-- uninstall.sh
The installation are straightforward, just run ./install.sh
and follow the instructions on the terminal.
Please run ./uninstall.sh
in the root directory to clean and uninstall the Jenkins + Elastic.
If kibana showing error after clicking / narrow down the log based on timestamp, kindly change the “dateFormat:tz” from “Browser” to “UTC” in Kibana Management > Advanced Settings > Timezone for date formatting
This work is under MIT license.