- A Python webapp which lets you vote between two options
- A Redis queue which collects new votes
- A .NET worker which consumes votes and stores them in…
- A Postgres database backed by a Docker volume
- A Node.js webapp which shows the results of the voting in real time
Note: The voting application only accepts one vote per client. It does not register votes if a vote has already been submitted from a client.
Instructions below are for deploying the CI Pipelines from the Jenkinsfiles which reside inside each app's folder.
For more details about each Pipeline see the corresponding folder (vote, worker, result).
The Pipelines run on Jenkins using kubernetes build agents.
- Create a secret (regcred) to allow Jenkins push images to Dockerhub:
kubectl create secret -n jenkins docker-registry regcred \
--docker-server=https://index.docker.io/v1/ \
--docker-username=<dockerhub-username> --docker-password=<dockerhub-password> \
--docker-email=<dockerhub-email>
- Create variables for SonarCloud tokens:
Add the following variables as secret text, inManage Jenkins > Manage Credentials > Global
:
- sonar-instavote-vote = SonarCloud Token for Vote app
- sonar-instavote-worker = SonarCloud Token for Worker app
- sonar-instavote-result = SonarCloud Token for Result app
- Create a new Jenkins Multibranch Pipeline for each app (vote,worker,result) with:
- Source as GitHub repo (eg. https://github.com/xvag/instavote-ci.git)
- Build mode "by Jenkinsfile" with Script Path pointing to the Jenkinsfile (eg. worker/Jenkinsfile)