- Clone both service's repos -
git clone [email protected]:eilonash92/time-service.git
git clone [email protected]:eilonash92/facts-service.git
-
Install local kubernetes using Docker for Desktop.
-
Download helm installer - https://helm.sh/docs/intro/install
-
Install Jenkins using helm chart-
helm repo add jenkins https://charts.jenkins.io
helm install jenkins
- Fetch your admin password -
kubectl exec --namespace default -it svc/myjenkins -c jenkins -- /bin/cat /run/secrets/additional/chart-admin-password && echo
-
Connect to your jenkins using this URL and port - http://localhost:8080.
-
Install plugins - Go to Manage Jenkins -> Manage Plugins -> Choose Available tab -> Search for
docker-pipeline
,docker
,Steps View
-
Go to https://dockerhub.com, register with username and password.
-
Add credentials to dockerhub - Go to Manage Jenkins -> Manage Credentials -> Jenkins -> Global Credentials -> New Credentials -> add the username and password and name in the id fill
docker-hub-credentials
-
Click on "New Item" and give your pipeline the name "deploy_time_service" and choose "FreeStyle" option.
-
Under Source Code Management tab choose Git and add the time_service Github repository URL (No credentials are needed, since the repos are public)
-
Click "Save" and repeat steps 6 + 7 for facts_service.
-
Push your new version to 'main' branch.
-
Go to Jenkins, click on the specific service' deployment job, and click "Build".
The job will run 3 stages -
a. Build - Building a docker image and pushing it to Dockerhub.
b. Deploy - Deploying the new image using helm install.
c. Test - Using cURL to test the web app is alive and it fails the step if the web app not returning 200 OK.