Skip to content

Instavote App - Continuous Integration with Jenkins

License

Notifications You must be signed in to change notification settings

xvag/instavote-ci

Repository files navigation

Instavote - Example Voting App

Architecture

Architecture diagram

  • 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.

Continuous Integration Pipelines

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.

  1. 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>
  1. Create variables for SonarCloud tokens:
    Add the following variables as secret text, in Manage 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
  1. Create a new Jenkins Multibranch Pipeline for each app (vote,worker,result) with: