Update deployment related files

This commit is contained in:
Keannu Bernasol 2023-12-03 00:43:50 +08:00
parent ad295a0e6d
commit fefc3aae38
14 changed files with 72 additions and 1373 deletions

View file

@ -15,7 +15,7 @@ WORKDIR /code
ADD . /code/ ADD . /code/
# Install pipenv # Install pipenv
RUN pip install --no-cache-dir -r linux-requirements.txt RUN pip install --no-cache-dir -r requirements.txt
# Make migrations # Make migrations
RUN python equipment_tracker/manage.py makemigrations RUN python equipment_tracker/manage.py makemigrations
@ -24,7 +24,7 @@ RUN python equipment_tracker/manage.py makemigrations
RUN python equipment_tracker/manage.py migrate RUN python equipment_tracker/manage.py migrate
# Generate DRF Spectacular Documentation # Generate DRF Spectacular Documentation
RUN python equipment_tracker/manage.py spectacular --color --file stude/schema.yml RUN python equipment_tracker/manage.py spectacular --color --file equipment_tracker/schema.yml
# Expose port 8000 for the web server # Expose port 8000 for the web server
EXPOSE 8000 EXPOSE 8000

View file

@ -15,7 +15,7 @@ services:
[ [
"sh", "sh",
"-c", "-c",
"python equipment_tracker/manage.py spectacular --color --file stude/schema.yml && python equipment_tracker/manage.py collectstatic --noinput && python equipment_tracker/manage.py makemigrations && python equipment_tracker/manage.py migrate && python equipment_tracker/manage.py runserver", "python equipment_tracker/manage.py spectacular --color --file equipment_tracker/schema.yml && python equipment_tracker/manage.py collectstatic --noinput && python equipment_tracker/manage.py makemigrations && python equipment_tracker/manage.py migrate && python equipment_tracker/manage.py runserver",
] ]
volumes: volumes:
- .:/code # For hotreloading - .:/code # For hotreloading

View file

@ -28,10 +28,11 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = str(os.getenv('SECRET_KEY')) SECRET_KEY = str(os.getenv('SECRET_KEY'))
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = False
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
# CSRF_TRUSTED_ORIGINS = [] To-do: Specify URL to web frontend CSRF_TRUSTED_ORIGINS = [
"https://equipment-tracker-frontend.keannu1.duckdns.org"]
# Email credentials # Email credentials
EMAIL_HOST = '' EMAIL_HOST = ''
@ -210,7 +211,7 @@ USE_TZ = True
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
DOMAIN = 'citc-tracker.keannu1.duckdns.org' DOMAIN = 'equipment-tracker-frontend.keannu1.duckdns.org'
SITE_NAME = 'CITC Equipment Tracker' SITE_NAME = 'CITC Equipment Tracker'

View file

@ -933,6 +933,22 @@ components:
required: required:
- token - token
- uid - uid
CategoryEnum:
enum:
- PC
- NETWORKING
- CCTV
- FURNITURE
- PERIPHERALS
- MISC
type: string
description: |-
* `PC` - PC
* `NETWORKING` - Networking
* `CCTV` - CCTV
* `FURNITURE` - Furniture
* `PERIPHERALS` - Peripherals
* `MISC` - Miscellaneous
CustomUser: CustomUser:
type: object type: object
properties: properties:
@ -970,6 +986,8 @@ components:
type: string type: string
description: description:
type: string type: string
category:
$ref: '#/components/schemas/CategoryEnum'
last_updated: last_updated:
type: string type: string
format: date-time format: date-time
@ -996,6 +1014,12 @@ components:
readOnly: true readOnly: true
equipment: equipment:
type: integer type: integer
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
status: status:
$ref: '#/components/schemas/StatusEnum' $ref: '#/components/schemas/StatusEnum'
remarks: remarks:
@ -1012,12 +1036,13 @@ components:
format: date-time format: date-time
readOnly: true readOnly: true
required: required:
- category
- date_added - date_added
- equipment - equipment
- equipment_name
- id - id
- last_updated - last_updated
- last_updated_by - last_updated_by
- remarks
- status - status
EquipmentInstanceLog: EquipmentInstanceLog:
type: object type: object
@ -1027,6 +1052,12 @@ components:
readOnly: true readOnly: true
equipment: equipment:
type: integer type: integer
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
status: status:
type: string type: string
remarks: remarks:
@ -1048,8 +1079,10 @@ components:
type: object type: object
additionalProperties: {} additionalProperties: {}
required: required:
- category
- date_added - date_added
- equipment - equipment
- equipment_name
- history - history
- id - id
- last_updated - last_updated
@ -1067,6 +1100,12 @@ components:
readOnly: true readOnly: true
equipment: equipment:
type: integer type: integer
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
status: status:
allOf: allOf:
- $ref: '#/components/schemas/StatusEnum' - $ref: '#/components/schemas/StatusEnum'
@ -1074,6 +1113,7 @@ components:
remarks: remarks:
type: string type: string
readOnly: true readOnly: true
nullable: true
history_date: history_date:
type: string type: string
format: date-time format: date-time
@ -1082,7 +1122,9 @@ components:
type: string type: string
readOnly: true readOnly: true
required: required:
- category
- equipment - equipment
- equipment_name
- history_date - history_date
- history_id - history_id
- history_user - history_user
@ -1099,6 +1141,8 @@ components:
type: string type: string
description: description:
type: string type: string
category:
$ref: '#/components/schemas/CategoryEnum'
last_updated: last_updated:
type: string type: string
format: date-time format: date-time
@ -1117,7 +1161,6 @@ components:
additionalProperties: {} additionalProperties: {}
required: required:
- date_added - date_added
- description
- history - history
- id - id
- last_updated - last_updated
@ -1135,6 +1178,9 @@ components:
description: description:
type: string type: string
readOnly: true readOnly: true
nullable: true
category:
$ref: '#/components/schemas/CategoryEnum'
history_date: history_date:
type: string type: string
format: date-time format: date-time
@ -1193,6 +1239,8 @@ components:
type: string type: string
description: description:
type: string type: string
category:
$ref: '#/components/schemas/CategoryEnum'
last_updated: last_updated:
type: string type: string
format: date-time format: date-time
@ -1212,6 +1260,12 @@ components:
readOnly: true readOnly: true
equipment: equipment:
type: integer type: integer
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
status: status:
$ref: '#/components/schemas/StatusEnum' $ref: '#/components/schemas/StatusEnum'
remarks: remarks:
@ -1262,13 +1316,16 @@ components:
- new_username - new_username
StatusEnum: StatusEnum:
enum: enum:
- Working - WORKING
- Broken - BROKEN
- Under Maintenance - MAINTENANCE
- Decomissioned - DECOMISSIONED
type: string type: string
description: "* `Working` - Working\n* `Broken` - Broken\n* `Under Maintenance`\ description: |-
\ - Under Maintenance\n* `Decomissioned` - Decomissioned " * `WORKING` - Working
* `BROKEN` - Broken
* `MAINTENANCE` - Under Maintenance
* `DECOMISSIONED` - Decomissioned
TokenObtainPair: TokenObtainPair:
type: object type: object
properties: properties:

File diff suppressed because it is too large Load diff