Skip to content
Snippets Groups Projects
Commit 5af2819d authored by Abbas Jafari's avatar Abbas Jafari :speech_balloon:
Browse files

Merge branch 'readmeFileUpdate' into 'master'

Readme Update

See merge request it2810-h21/team-54/project-3!11
parents 2849f717 eef905e8
No related branches found
No related tags found
No related merge requests found
image: node:14.17.6
stages:
# - test
- build
- deploy
cache:
paths:
- client/node_modules
- public/node_modules
- server/node_modules
- /node_modules
# test:
# stage: test
# script:
# - echo "Testing App"
# - npm install
# - npm test
# - echo "Test successfully!"
build-client-pages:
only:
- master
stage: build
script:
# - echo "Creating credential file"
# - echo $DB_HOST > .env
# - echo -n $DB_NAME >> .env
# - echo -n $DB_PASS >> .env
# - echo -n $DB_USER >> .env
# - echo "Start building App"
- cd client
- rm -rf build
- npm install
- npm run build
- rm -rf public
- cp build/index.html build/404.html
- mkdir ../public
- mv -v build/* ../public/
- ls
- echo "Build successfully!"
artifacts:
paths:
- public
pages:
only:
- master
stage: deploy
script:
- cd public
- ls
artifacts:
paths:
- public
# URLs
## The URL of the deployed app
## The URL of the Client app
http://it2810-54.idi.ntnu.no/
*OBS: you need to be connected to NTNU VPN or use NTNU Network
## Timesheet
The timesheet is uploaded on Blackboard too.<br>
......@@ -34,7 +36,7 @@ The website was made using multiple different components composed together on on
We tried to design it as simple and intuitively as possible so that any user will be able to use the website.
## Deployment
We deployed the app to gitlab using CI pipeline by creating and adding gitlab-ci-yml file to the project. The CI pipeline works in our project, and the deployed website is linked at the top. The client was buildt simply using `npm run build`. However, the server side had to be compiled manually using TypeScript instead of nodemon to build. Then, we moved the project files over to the VM. Finally, we could run the server using the Library 'NoHup' instead of nodemon for the server to complete the pipeline and keep running.
We deployed the client APP into NTNUs users server by createing an Apache server and pushed the build folder directly to /tmp folder (Using SSH) and then copied to /var/www/html/ folder. For the server, we have used "forever" for running the server. We manualy uploaded server files to ntnuhome folder and then by "tsc src/server.ts" tried to build/convert the .ts files to .js files. Finally "forever start src/server.js" has started the server.
## Available Scripts
......
......@@ -27,7 +27,7 @@
"web-vitals": "^1.1.2"
},
"scripts": {
"start": "nohup node src/server.js &",
"start": "forever start src/server.js",
"build": "tsc src/server.ts",
"test": "react-scripts test",
"eject": "react-scripts eject"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment