Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Ceph Webapp Poc
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
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Jacopo Gasparetto
Ceph Webapp Poc
Commits
b4395864
Commit
b4395864
authored
1 year ago
by
Jacopo Gasparetto
Browse files
Options
Downloads
Patches
Plain Diff
feat(ci-cd): Add automatic build for nginx/frontend image
parent
8e9dd344
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!8
feat(deployment): Add frontend container based on nginx
,
!7
feat(ci-cd): Frontend container image based on nginx
Pipeline
#100142
passed
1 year ago
Stage: fetch-version
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+22
-1
22 additions, 1 deletion
.gitlab-ci.yml
README.md
+28
-3
28 additions, 3 deletions
README.md
with
50 additions
and
4 deletions
.gitlab-ci.yml
+
22
−
1
View file @
b4395864
...
...
@@ -94,7 +94,7 @@ test:
script
:
echo "Hello, Test!"
upload-frontend
:
upload-frontend
-package
:
stage
:
upload
before_script
:
-
PACKAGENAME="$(cat packagename.txt)"
...
...
@@ -112,3 +112,24 @@ upload-frontend:
-
dev
-
/^(([0-9]+)\.)?([0-9]+)\.x/
# Maintenance branches
-
/^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/
# Prerelease branches
upload-frontend-docker
:
stage
:
upload
before_script
:
-
PACKAGENAME="$(cat packagename.txt)"
-
VERSION="$(cat version.txt)"
-
PACKAGE_FULLNAME="${PACKAGENAME}_v${VERSION}.tar.gz"
-
docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
script
:
-
tar -xvf frontend/${PACKAGE_FULLNAME} -C frontend/build
-
docker build --pull -t "${CI_REGISTRY_IMAGE}/frontend:v${VERSION}" frontend -f Dockerfile.prod
-
docker push "${CI_REGISTRY_IMAGE}/frontend:v${VERSION}"
only
:
changes
:
-
.gitlab-ci.yml
-
frontend/**/*
refs
:
-
main
-
dev
-
/^(([0-9]+)\.)?([0-9]+)\.x/
# Maintenance branches
-
/^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/
# Prerelease branches
This diff is collapsed.
Click to expand it.
README.md
+
28
−
3
View file @
b4395864
...
...
@@ -13,10 +13,35 @@ To run the project, use
docker compose up
```
## Endpoints
##
Development
Endpoints
The following endpoint are available
-
Webapp
[
localhost:
808
0
](
localhost:
808
0
)
-
API
[
localhost:
808
0/api/v1/
](
localhost:
808
0/api/v1/
)
-
Webapp
[
localhost:
300
0
](
localhost:
300
0
)
-
API
[
localhost:
300
0/api/v1/
](
localhost:
300
0/api/v1/
)
-
Minio
[
localhost:9000
](
localhost:9000
)
## Deployment
This project is configured with a CI/CD pipeline which builds two Docker images
for backend and frontend services. The images are stored
[
here
](
https://baltig.infn.it/jgasparetto/ceph-webapp-poc/container_registry
)
.
### Frontend Configuration
The frontend service consists in a NGINX web server provided with the static
website files produces by React build. The site must be configure as a
"Single Page App" (SPA). In this context, all routes routed through the web
browser must be
**always**
redirect to the
`/`
route.
[
Here
](
frontend/nginx.conf
)
you can find a configuration example which you can
use as
```
shell
docker run
-p
8080:80
-v
$(
pwd
)
/frontend/nginx.conf:/etc/nginx/conf.d/default.conf frontend
```
### Backend Configuration
The only configuration needed to the backend service is an env file, or otherwise
you can directly expose the environmental variables needed, as shown at
[
example.dev
](
backend/envs/example.env
)
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