Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lecture-devops-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
s80984
lecture-devops-app
Commits
e60ad08b
Commit
e60ad08b
authored
3 years ago
by
s80984
Browse files
Options
Downloads
Patches
Plain Diff
Update build pipeline
parent
2f6d5829
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#14142
failed
3 years ago
Stage: build
Stage: test
Stage: deploy
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+3
-3
3 additions, 3 deletions
.gitlab-ci.yml
app/server/Dockerfile.test
+19
-0
19 additions, 0 deletions
app/server/Dockerfile.test
docker-compose.test.yml
+27
-0
27 additions, 0 deletions
docker-compose.test.yml
docker-compose.yml
+5
-3
5 additions, 3 deletions
docker-compose.yml
with
54 additions
and
6 deletions
.gitlab-ci.yml
+
3
−
3
View file @
e60ad08b
...
...
@@ -43,7 +43,7 @@ job_build-image:
# - docker info
# - docker-compose --version
script
:
-
docker-compose up -d
-
docker-compose
-f docker-compose.yml
up -d
# - docker-compose up -d --build
# # - docker ps
# # - docker network list
...
...
@@ -71,8 +71,8 @@ job_test-image:
before_script
:
-
apk add --no-cache docker-compose
script
:
-
docker-compose up
-
npm run test
-
docker-compose
-f docker-compose.test.yml
up
#
- npm run test
# - docker run
# --detach
# --publish "${outerPort}:8080"
...
...
This diff is collapsed.
Click to expand it.
app/server/Dockerfile.test
0 → 100644
+
19
−
0
View file @
e60ad08b
FROM
node
:
16
# Create app directory
# WORKDIR /usr/src/app
WORKDIR
/
usr
/
src
/
app
# COPY ./client/package*.json ./
COPY
package
*.
json
.
/
RUN
npm
install
# Bundle app source
COPY
.
.
EXPOSE
3000
CMD
[
"npm"
,
"run test"
]
This diff is collapsed.
Click to expand it.
docker-compose.test.yml
0 → 100644
+
27
−
0
View file @
e60ad08b
version
:
'
3'
services
:
mongo
:
container_name
:
mongo
image
:
mongo
ports
:
-
'
27017:27017'
volumes
:
-
mongodb:/.local/db/data/db
app
:
container_name
:
node-mongo-app
# image: ${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}
restart
:
always
build
:
context
:
.
dockerfile
:
./app/server/Dockerfile.test
ports
:
-
'
80:3000'
links
:
-
mongo
environment
:
-
PORT=3000
-
MONGODB_URL=mongodb://mongo:27017/todo-app
-
JWT_SECRET=myjwtsecret
volumes
:
mongodb
:
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
5
−
3
View file @
e60ad08b
version
:
'
3'
services
:
mongo
:
container_name
:
mongo
db
container_name
:
mongo
image
:
mongo
ports
:
-
'
27017:27017'
...
...
@@ -11,14 +11,16 @@ services:
container_name
:
node-mongo-app
# image: ${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}
restart
:
always
build
:
./app/server
build
:
context
:
.
dockerfile
:
./app/server/Dockerfile
ports
:
-
'
80:3000'
links
:
-
mongo
environment
:
-
PORT=3000
-
MONGODB_URL=mongodb://mongo
db
:27017/todo-app
-
MONGODB_URL=mongodb://mongo:27017/todo-app
-
JWT_SECRET=myjwtsecret
volumes
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment