Skip to content

myselfakashagarwal/pweb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screenshot 2024-05-27 at 5 56 37 PM

About

A web development codebase integrated with a modularized CI/CD pipeline.

Components

  • Develop – Dev codebase running via Docker Compose, mimicking production for development.
  • Build – Jenkins with build and push jobs using Docker-in-Docker (DIND) to build and push artifacts.
  • Deploy – Pulling the artifact and running it.
  • Update – A background service that updates to newer versions automatically.

Develop

The website is built using Three.js, a WebGL framework. For development purposes, Docker Compose is used to mount the codebase along with environment variables and configurations, providing features such as hot reload.

Build

Jenkins and Docker are used together in a multi-stage build process. Jenkins jobs like pweb_build (which uses the host's Docker daemon to build the artifact) and pweb_push (which pushes the build to a defined registry) are mounted during the artifact build.

Deploy & Update

A cloud VM instance with Docker is kept running with two containers:

  • One for the deployable build created in the build phase.
  • The other for Watchtower, which handles automatic deployments. It monitors the registry and pulls new builds (on push), replacing the old versions with the same configurations and performing graceful shutdowns.

Working

The entire pipeline is abstracted in pweb.yml, a Docker Compose file with multiple configured environments. Profiles are defined to spawn different environments as needed—such as development for local development, build for the build phase, and deploy and update for deployment on the cloud.

Use

(assumed user in present inside the cloned repo)

To spawn the environment ANY

docker-compose -f pweb.yml --profile ${DESIRED-ENV} up

To spawn the environment for development

docker-compose -f pweb.yml --profile development up

To spawn the environment for creatinfg and pushing builds

docker-compose -f pweb.yml --profile build up

To spawn complete pipeline

docker-compose -f pweb.yml --profile pweb up

About

Three.js Portfolio website with containerised & continuous- dev , build & delivery pipeline

Topics

Resources

Stars

Watchers

Forks