Skip to content

Pet Project. Docker, Docker Compose, Gitlab CI, SAST

Notifications You must be signed in to change notification settings

po-khmel/dumplings-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Momo Store, aka Dumpling Shop #2

DEV: The build, static code test, release, and deployment process to the test VM is done in GitLab CI in this project.

PROD: The build, test, and release process is the same as in DEV. Deployment to "prod" in Kubernetes is described in the DumplingInfra project.

All sensitive values are stored as GitLab CI variables

Build stage

Multistage Dockerfiles are used: Frontend Dockerfile and Backend Dockerfile.

  • Container patch versions are assigned according to CI_COMMIT_SHORT_SHA.
  • Docker containers are stored in the GitLab Container Registry.
  • The VUE_APP_API_URL variable is set via --build-arg, and its value depends on the commit message:
    • If the commit contains "test-deploy," then VUE_APP_API_URL=<IP of the test VM>
    • If the commit does not contain "test-deploy," then VUE_APP_API_URL=/api
  • The frontend is served with NGINX.

Test stage

Static Application Security Testing (SAST) for the entire project:

  • GitLab SAST includes:
    • eslint-sast
    • gosec-sast
    • nodejs-scan-sast
    • semgrep-sast
    • spotbugs-sast (without compilation)
  • SonarQube SAST

Release stage

When the project passes tests, the container tag is changed to latest.

  • If the commit contains "test-deploy," the frontend is uploaded to the dumplings-frontend-test GitLab Container repository.
  • If the commit does not contain "test-deploy," the frontend is uploaded to the dumplings-frontend GitLab Container repository.

Deploy to test VM

Deployment depends on the commit:

  • If the commit contains "test-deploy," it deploys with Docker Compose on the test VM (Docker Compose YAML).
  • If the commit contains "prod-deploy," it triggers a pipeline from the infrastructure repository for deployment to Kubernetes.
  • Otherwise, the pipeline terminates - no deployment action.

Infrastructure

The infrastructure project and its documentation can be found at this link: Dumplings Infrastructure

For Developers

Frontend

npm install
NODE_ENV=production VUE_APP_API_URL=http://localhost:8081 npm run serve

Backend

go run ./cmd/api
go test -v ./... 

About

Pet Project. Docker, Docker Compose, Gitlab CI, SAST

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published