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
Compare revisions
76199636d6f1567d759ba1d93fc742d077bced03 to 511b275d9a0c998bd9628d00d238ff59e219fe80
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
s28840/ss22-devops-project-app
Select target project
No results found
511b275d9a0c998bd9628d00d238ff59e219fe80
Select Git revision
Branches
main
staging
Tags
v2.0.0
v2.0.1
Swap
Target
s28840/ss22-devops-project-app
Select target project
s28840/ss22-devops-project-app
1 result
76199636d6f1567d759ba1d93fc742d077bced03
Select Git revision
Branches
main
staging
Tags
v2.0.0
v2.0.1
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
pipeline multiple updates
· 40e9f1cf
Dobromir Palushev
authored
2 years ago
40e9f1cf
Merge branch 'just-a-test' into 'staging'
· 511b275d
Dobromir Palushev
authored
2 years ago
pipeline multiple updates See merge request
!5
511b275d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+6
-2
6 additions, 2 deletions
.gitlab-ci.yml
app/Dockerfile
+12
-5
12 additions, 5 deletions
app/Dockerfile
k8s-manifests/configmap.yaml
+0
-2
0 additions, 2 deletions
k8s-manifests/configmap.yaml
with
18 additions
and
9 deletions
.gitlab-ci.yml
View file @
511b275d
...
...
@@ -7,9 +7,10 @@ workflow:
variables
:
DOCKER_VERSION
:
'
20.10.17'
K8S_VERSION
:
'
1.24'
GOOGLE_CLOUD_SDK_IMAGE_VERSION
:
'
400.0.0'
MONGO_VERSION
:
'
4.4'
K8S_NAMESPACE
:
'
todoapp-devops'
GOOGLE_CLOUD_SDK_IMAGE_VERSION
:
'
400.0.0'
GCP_COMPUTE_REGION
:
'
europe-west4a'
CONTAINER_TAG
:
'
${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}'
stages
:
...
...
@@ -34,11 +35,14 @@ test-image:
services
:
-
name
:
docker:${DOCKER_VERSION}-dind
script
:
-
docker run -p 27017:27017 -d mongo:${MONGO_VERSION}
-
docker build
--tag "${CONTAINER_TAG}-test"
--target=test
"./app"
after_script
:
-
docker stop mongo:${MONGO_VERSION} | xargs docker rm
-
docker image rm --force mongo:${MONGO_VERSION}
-
docker image rm --force "${CONTAINER_TAG}-test"
build-image
:
...
...
This diff is collapsed.
Click to expand it.
app/Dockerfile
View file @
511b275d
...
...
@@ -5,11 +5,14 @@ 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>
PORT=<dynamically-set-from-k8s> \
MONGODB_URL=<dynamically-set-from-k8s> \
JWT_SECRET=<dynamically-set-from-k8s>
# ------------------------------------------------------------------
# Test stage
...
...
@@ -33,8 +36,12 @@ COPY ./server/package*.json .
RUN
npm ci
--no-audit
--no-fund
ARG
\
MONGODB_URL_TEST \
JWT_SECRET_TEST
# MONGODB_URL and JWT_SECRET are available as env variables
RUN
npm run
test
RUN
MONGODB_URL
=
$MONGODB_URL_TEST
JWT_SECRET
=
$JWT_SECRET_TEST
npm run
test
# ------------------------------------------------------------------
# Build stage
...
...
This diff is collapsed.
Click to expand it.
k8s-manifests/configmap.yaml
View file @
511b275d
...
...
@@ -4,6 +4,4 @@ metadata:
name
:
todo-app-config
data
:
PORT
:
3000
# MONGODB_URL: mongodb://<mongo-service>:27017/todo-app
# mongodb-service.<namespace>?
MONGODB_URL
:
mongodb-service
This diff is collapsed.
Click to expand it.