DEV: The build, static code test, release, and deployment process to the test VM is done in GitLab CI in this project.
- The root
.gitlab-ci.yml
triggers downstream pipelines: for Frontend and Backend
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
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
- If the commit contains "test-deploy," then
- The frontend is served with NGINX.
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
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.
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.
The infrastructure project and its documentation can be found at this link: Dumplings Infrastructure
npm install
NODE_ENV=production VUE_APP_API_URL=http://localhost:8081 npm run serve
go run ./cmd/api
go test -v ./...