Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ss22-devops-project-app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dobromir Palushev
ss22-devops-project-app
Merge requests
!41
updated logic of the test-job
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
updated logic of the test-job
just-a-test
into
main
Overview
0
Commits
103
Pipelines
0
Changes
10
Closed
Dobromir Palushev
requested to merge
just-a-test
into
main
2 years ago
Overview
0
Commits
103
Pipelines
0
Changes
10
Expand
updated the test stage in the app Dockerfile
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
d3a0b001
103 commits,
2 years ago
10 files
+
89
−
166
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
10
Search (e.g. *.vue) (Ctrl+P)
app/Dockerfile
+
7
−
30
Options
@@ -5,38 +5,15 @@ ARG NODEJS_VERSION='16.17.0'
FROM
node:$NODEJS_VERSION-alpine
AS
base
ARG
\
MONGODB_URL_TEST=mongodb://host.docker.internal:27017/todo-app \
JWT_SECRET_TEST=<my-very-secret-jwt>
ENV
\
PORT=3000 \
# For local dev - mongodb://host.docker.internal:27017/todo-app
MONGODB_URL=<should-be-dynamically-set> \
JWT_SECRET=<should-be-dynamically-set>
# ------------------------------------------------------------------
# Test stage
FROM
base
AS
test
# client tests
WORKDIR
/client
COPY
./client .
RUN
npm ci
--no-audit
--no-fund
MONGODB_URL=<dynamically-set-from-k8s> \
JWT_SECRET=<dynamically-set-from-k8s>
RUN
npm run
test
# server tests
WORKDIR
/server
COPY
./server/src ./src/
COPY
./server/package*.json .
RUN
npm ci
--no-audit
--no-fund
# MONGODB_URL and JWT_SECRET are available as env variables
RUN
npm run
test
# ------------------------------------------------------------------
# Build stage
FROM
base
AS
build
@@ -47,7 +24,7 @@ WORKDIR $APP_BUILD_PATH
COPY
./server/src .
COPY
./server/package*.json .
COPY
./server/package*.json .
/
RUN
\
npm ci
--prod
--no-audit
--no-fund
\
Loading