Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Jenkins

...

URL:

httphttps://ec2-3-234-254-227.compute-1.amazonaws.com:8080jenkins.diaper-project.com

Username and password: same as given in login secrets on box

Current System:

For Backend Mobile and Backend Dashboard:

  • An infrastructure person needs to SSH into the production server
  • An infrastructure person has to pull the changes from the master branch and then deploy the code in production

For frontend dashboard:

  • right now, this is even a little bit complicated
  • Each time the frontend developer needs to first build react in oneself's system
  • then, the frontend dev needs to run build
  • after that, the build folder has to be copied into the AWS server
  • Later, optionally, the frontend dev also needs to check if the build has any issues

[To be completed - maybe phase 2] For frontend mobile:

  • The developer needs to compile the flutter code in one's system
  • Then they need to upload into the test flight
  • New app has to be distributed

Where we want to be ?

For Backend Mobile and Backend Dashboard:

  • As soon as the github PR is merged, there has to be a hook in github which has to trigger the jenkins build job and display the job results hyperlink in github
  • This jenkins job needs to ssh into the respective production system
  • Pull the branch into it (in this phase, it is master branch, in the next phase we want to also support the branch or tag which has to be deployed and the backend system shall deploy that)
  • It shall then restart the docker container

For frontend dashboard:

  • we shall first install npm into the dashboard frontend production system
  • As soon as the github PR is merged, there has to be a hook in github which has to trigger the jenkins build job and display the job results hyperlink in github
  • This jenkins job needs to ssh into the frontend dashboard production system
  • Then pull the relevant branch (in this phase, it is master branch, in the next phase we want to also support the branch or tag which has to be deployed and the frontend system shall deploy that)
  • It shall then do the npm build and then copy the files to /var/www/html
  • Then it might optionally restart the apache server

[To be completed - maybe phase 2] For frontend mobile:

  • currently, we don't have a dedicated server system for building this and uploading to the test flight
  • We may need a mac remote machine to add a job that completely automates the process of compiling the code till uploading the build to test flight(If it is possible to get a mac remote machine)
  • This is the most time consuming task out of all others because, we need an extra infra machine to solve this
  • Detailed process is to be updated by the person who will be automating this

What is the impact of the above automation ?

  • Right now, there is a dedicated infrastructure person who ssh'es into the AWS machine and needs to perform this operations
  • We can decrease the overhead on infra and also the dependency between devs and infra to make this process happen
  • This potentially solved the wait time that dev faces until infra can deploy their code (on an average, it takes 2 days now depending on the availability of the infrastructure person. If this system is in place, all the deployments can be carried out instantaneously and without any room for errors)

Effort in dev sprints for this by subtasks:

  • exploring and adding github hooks (2 hours)
  • Setup jenkins in one of the servers in a new docker container and test a few sample tasks in that → 8 to 12 hours
  • Setting up a backend dashboard task with ssh into AWS and copying all other tasks and verifying that the task is working → 4 to 8 hours
  • Setting up a backend mobile task with ssh into AWS and copying all other tasks and verifying that the task is working → assuming the dashboard is done, with the experience in that, this shouldn't take more than 3 hours → 2 to 3 hours
  • Setting up frontend dashboard task will first need npm current dev version to be installed on AWS machine and test a frontend build → 2 to 4 hours
  • Setting up a backend mobile task with ssh into AWS and copying all other tasks and verifying that the task is working → assuming the dashboard and mobile are done, with the experience in that, this shouldn't take more than 3 hours → 2 to 3 hours
  • Testing all the systems frontend dashboard, backend mobile, backend dashboard - 2 to 3 hours
  • Unexpected things or surprises - 8 to 11 hours
  • Overall task time taken → 30 to 46 hours → 2 sprints(4 weeks) assuming there are also other tasks for the infra to support other teams

Scope:

  • We are automating the deployment process from github pr merge to deployment of the updated code in the production
  • In this phase, we are only solving this for frontend dashboard, backend dashboard and backend mobile code repositories
  • We are not automating the pipeline for frontend mobile in this phase as we have more dependencies
  • After the end of this story, we should be in a place where the devs won't need infra's support in deployment process. However, if there is some merge issue in the AWS machine, the infra person shall still ssh into AWS and resolve the issue to make sure Jenkins is back to up and running(this happens rarely)

Future scope - following phases:

...

Slack.

* Tutorial: Generic Webhook TriggerPipeline Syntax (jenkins.io)


ArgoCD: Available on K8S. Login to K8S and port-forward the pod to access the service.

ArgoCD username: admin, password: D0N@t4get!
ArgoCD username: diaper, password: Arg0-d1aper-p4w0d (no admin access)

* Tutorial: Argo CD - Declarative GitOps CD for Kubernetes


Nexus: Available on K8S. Login to K8S and port-forward the pod to access the service.

nexus username: admin, password: D0N@t4get!
nexus username: k8s, password: n3xus-d1aper-p4w0d (For K8S use only)
nexus username: jenkins, password: n3xus-d1aper-p4w0d (For Jenkins use only)

<Individual accounts are also available.>

Tutorial: Sonatype Nexus Repository Tutorial

Image Added


TODO: Upload videos of how to config ArgoCD.

...