Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
d72bf5d0fe
|
|||
|
f566f83398
|
|||
|
668551bc04
|
|||
|
79e95cecfa
|
|||
|
c82a7f0fa1
|
|||
| d635c9b0c0 | |||
| 96754c5999 | |||
| bcd1189f30 | |||
| 8730766c66 | |||
|
67c877385f
|
84
.drone.yml
84
.drone.yml
@@ -1,3 +1,4 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: frontend
|
||||
@@ -23,14 +24,6 @@ steps:
|
||||
- cd frontend
|
||||
- yarn
|
||||
|
||||
# - name: Run unit tests
|
||||
# image: node
|
||||
# environment:
|
||||
# CI: true
|
||||
# commands:
|
||||
# - cd frontend
|
||||
# - yarn test
|
||||
|
||||
- name: Build and push frontend image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
@@ -61,9 +54,7 @@ steps:
|
||||
- frontend/node_modules
|
||||
when:
|
||||
event: push
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
status: [ success, failure ]
|
||||
|
||||
- name: Flush cache
|
||||
image: plugins/s3-cache:1
|
||||
@@ -79,15 +70,11 @@ steps:
|
||||
debug: true
|
||||
filename: frontend.tar
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
status: [ success, failure ]
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- release/*
|
||||
ref:
|
||||
- refs/tags/* # only trigger when tagging
|
||||
event: [ tag, promote ]
|
||||
refs: [ refs/heads/release/*, refs/tags/* ]
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
@@ -116,14 +103,6 @@ steps:
|
||||
- ls -la
|
||||
- yarn
|
||||
|
||||
# - name: Run unit tests
|
||||
# image: node
|
||||
# environment:
|
||||
# CI: true
|
||||
# commands:
|
||||
# - cd frontend
|
||||
# - yarn test
|
||||
|
||||
- name: Build and push frontend dev image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
@@ -153,10 +132,7 @@ steps:
|
||||
mount:
|
||||
- frontend/node_modules
|
||||
when:
|
||||
event: push
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
status: [ success, failure ]
|
||||
|
||||
- name: Flush cache
|
||||
image: plugins/s3-cache:1
|
||||
@@ -172,14 +148,11 @@ steps:
|
||||
debug: true
|
||||
filename: frontend-dev.tar
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
status: [ success, failure ]
|
||||
|
||||
trigger:
|
||||
exclude:
|
||||
branch:
|
||||
- release/*
|
||||
event: [ push, pull_request, promote ]
|
||||
# refs: [ refs/heads/release/*, refs/heads/master, refs/heads/feature/*, refs/heads/hotfix/* ]
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
@@ -214,11 +187,6 @@ steps:
|
||||
- ls -la
|
||||
- npm run test:cov
|
||||
|
||||
# - name: Run E2E tests
|
||||
# image: node
|
||||
# - cd backend
|
||||
# - npm run test:e2e
|
||||
|
||||
- name: Build and push backend image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
@@ -248,10 +216,7 @@ steps:
|
||||
mount:
|
||||
- backend/node_modules
|
||||
when:
|
||||
event: push
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
status: [ success, failure ]
|
||||
|
||||
- name: Flush cache
|
||||
image: plugins/s3-cache:1
|
||||
@@ -267,15 +232,11 @@ steps:
|
||||
debug: true
|
||||
filename: backend.tar
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
status: [ success, failure ]
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- release/*
|
||||
ref:
|
||||
- refs/tags/* # only trigger when tagging
|
||||
event: [ tag, promote ]
|
||||
refs: [ refs/heads/release/*, refs/tags/* ]
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
@@ -309,11 +270,6 @@ steps:
|
||||
- cd backend
|
||||
- npm run test:cov
|
||||
|
||||
# - name: Run E2E tests
|
||||
# image: node
|
||||
# - cd backend
|
||||
# - npm run test:e2e
|
||||
|
||||
- name: Build and push backend dev image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
@@ -343,10 +299,7 @@ steps:
|
||||
mount:
|
||||
- backend/node_modules
|
||||
when:
|
||||
event: push
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
status: [ success, failure ]
|
||||
|
||||
- name: Flush cache
|
||||
image: plugins/s3-cache:1
|
||||
@@ -362,11 +315,8 @@ steps:
|
||||
debug: true
|
||||
filename: backend-dev.tar
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
status: [ success, failure ]
|
||||
|
||||
trigger:
|
||||
exclude:
|
||||
branch:
|
||||
- release/*
|
||||
event: [ push, pull_request, promote ]
|
||||
# refs: [ refs/heads/master, refs/heads/feature/*, refs/heads/hotfix/* ]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ts-onlinetime-ranks-backend",
|
||||
"version": "0.0.2",
|
||||
"version": "0.1.0",
|
||||
"description": "Backend microservice for TeamSpeak 3 Online Time Ranking",
|
||||
"private": true,
|
||||
"license": "UNLICENSED",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ts-onlinetime-ranks-frontend",
|
||||
"version": "0.0.2",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
||||
@@ -10,7 +10,7 @@
|
||||
"@testing-library/react": "^9.3.2",
|
||||
"@testing-library/user-event": "^7.1.2",
|
||||
"@types/jest": "^24.0.0",
|
||||
"@types/node": "^12.0.0",
|
||||
"@types/node": "^14.14.25",
|
||||
"husky": "^4.3.7",
|
||||
"lint-staged": "^10.5.3",
|
||||
"prettier": "^2.2.1",
|
||||
|
||||
16
frontend/src/configs/api.config.ts
Normal file
16
frontend/src/configs/api.config.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export default class APIConfiguration {
|
||||
private static API_DEV = "https://api.beta.tsotr.humenius.me"
|
||||
private static API_PROD = "https://api.tsotr.humenius.me"
|
||||
private static API_LOCAL = "http://localhost:3500"
|
||||
|
||||
public static getUrl = (): string => {
|
||||
switch (process.env.NODE_ENV) {
|
||||
case 'production':
|
||||
return APIConfiguration.API_PROD;
|
||||
case 'development':
|
||||
return APIConfiguration.API_DEV;
|
||||
default:
|
||||
return APIConfiguration.API_LOCAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
import APIConfiguration from "../configs/api.config";
|
||||
import RequestError from "../models/RequestError";
|
||||
import UserStatsResponse from "../models/UserStatsResponse";
|
||||
|
||||
export default class UserStatsService {
|
||||
|
||||
private static apiURL = 'https://api.tsotr.humenius.me/stats'
|
||||
//private static apiURL = 'http://localhost:3500/stats'
|
||||
private static readonly API_URL = APIConfiguration.getUrl();
|
||||
|
||||
private static requestInit: RequestInit = {
|
||||
method: 'GET',
|
||||
@@ -14,7 +14,7 @@ export default class UserStatsService {
|
||||
};
|
||||
|
||||
public static async getStats(seasonId?: string): Promise<UserStatsResponse> {
|
||||
return fetch(`${this.apiURL}/season/${seasonId ?? ''}`, this.requestInit)
|
||||
return fetch(`${UserStatsService.API_URL}/stats/season/${seasonId ?? ''}`, this.requestInit)
|
||||
.then(res => UserStatsService.checkResponse(res))
|
||||
.then(data => data.json())
|
||||
.then(data => {
|
||||
|
||||
@@ -1716,10 +1716,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.20.tgz#f7974863edd21d1f8a494a73e8e2b3658615c340"
|
||||
integrity sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A==
|
||||
|
||||
"@types/node@^12.0.0":
|
||||
version "12.19.12"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.12.tgz#04793c2afa4ce833a9972e4c476432e30f9df47b"
|
||||
integrity sha512-UwfL2uIU9arX/+/PRcIkT08/iBadGN2z6ExOROA2Dh5mAuWTBj6iJbQX4nekiV5H8cTrEG569LeX+HRco9Cbxw==
|
||||
"@types/node@^14.14.25":
|
||||
version "14.14.25"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.25.tgz#15967a7b577ff81383f9b888aa6705d43fbbae93"
|
||||
integrity sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==
|
||||
|
||||
"@types/parse-json@^4.0.0":
|
||||
version "4.0.0"
|
||||
|
||||
Reference in New Issue
Block a user