Database Connection Update #4
222
.drone.yml
222
.drone.yml
@@ -3,16 +3,26 @@ type: docker
|
|||||||
name: frontend
|
name: frontend
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# - name: Restore cache
|
- name: Restore cache
|
||||||
# image: plugins/s3-cache
|
image: plugins/s3-cache
|
||||||
# settings:
|
settings:
|
||||||
# pull: true
|
pull: true
|
||||||
# endpoint: https://storage.humenius.me
|
endpoint: https://storage.humenius.me
|
||||||
# access_key:
|
access_key:
|
||||||
# from_secret: aws_access_key_id
|
from_secret: aws_access_key_id
|
||||||
# secret_key:
|
secret_key:
|
||||||
# from_secret: aws_secret_access_key
|
from_secret: aws_secret_access_key
|
||||||
# restore: true
|
restore: true
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- yarn
|
||||||
|
|
||||||
|
- name: Run unit tests
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- yarn test
|
||||||
|
|
||||||
- name: Build and push frontend image
|
- name: Build and push frontend image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
@@ -28,32 +38,32 @@ steps:
|
|||||||
registry: docker.humenius.me
|
registry: docker.humenius.me
|
||||||
tags: ["latest", "${DRONE_SEMVER}"]
|
tags: ["latest", "${DRONE_SEMVER}"]
|
||||||
|
|
||||||
# - name: rebuild
|
- name: Rebuild cache
|
||||||
# image: plugins/s3-cache
|
image: plugins/s3-cache
|
||||||
# settings:
|
settings:
|
||||||
# pull: true
|
pull: true
|
||||||
# endpoint: https://storage.humenius.me
|
endpoint: https://storage.humenius.me
|
||||||
# access_key:
|
access_key:
|
||||||
# from_secret: aws_access_key_id
|
from_secret: aws_access_key_id
|
||||||
# secret_key:
|
secret_key:
|
||||||
# from_secret: aws_secret_access_key
|
from_secret: aws_secret_access_key
|
||||||
# rebuild: true
|
rebuild: true
|
||||||
# mount:
|
mount:
|
||||||
# - node_modules
|
- node_modules
|
||||||
# when:
|
when:
|
||||||
# event: push
|
event: push
|
||||||
|
|
||||||
# - name: flush
|
- name: Flush cache
|
||||||
# image: plugins/s3-cache:1
|
image: plugins/s3-cache:1
|
||||||
# settings:
|
settings:
|
||||||
# pull: true
|
pull: true
|
||||||
# endpoint: https://storage.humenius.me
|
endpoint: https://storage.humenius.me
|
||||||
# access_key:
|
access_key:
|
||||||
# from_secret: aws_access_key_id
|
from_secret: aws_access_key_id
|
||||||
# secret_key:
|
secret_key:
|
||||||
# from_secret: aws_secret_access_key
|
from_secret: aws_secret_access_key
|
||||||
# flush: true
|
flush: true
|
||||||
# flush_age: 14
|
flush_age: 14
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
@@ -67,6 +77,27 @@ type: docker
|
|||||||
name: frontend-dev
|
name: frontend-dev
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Restore cache
|
||||||
|
image: plugins/s3-cache
|
||||||
|
settings:
|
||||||
|
pull: true
|
||||||
|
endpoint: https://storage.humenius.me
|
||||||
|
access_key:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
secret_key:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
restore: true
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- yarn
|
||||||
|
|
||||||
|
- name: Run unit tests
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- yarn test
|
||||||
|
|
||||||
- name: Build and push frontend dev image
|
- name: Build and push frontend dev image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
@@ -81,6 +112,33 @@ steps:
|
|||||||
registry: docker.humenius.me
|
registry: docker.humenius.me
|
||||||
tags: ["dev-${DRONE_COMMIT_SHA}", "dev-latest"]
|
tags: ["dev-${DRONE_COMMIT_SHA}", "dev-latest"]
|
||||||
|
|
||||||
|
- name: Rebuild cache
|
||||||
|
image: plugins/s3-cache
|
||||||
|
settings:
|
||||||
|
pull: true
|
||||||
|
endpoint: https://storage.humenius.me
|
||||||
|
access_key:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
secret_key:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
rebuild: true
|
||||||
|
mount:
|
||||||
|
- node_modules
|
||||||
|
when:
|
||||||
|
event: push
|
||||||
|
|
||||||
|
- name: Flush cache
|
||||||
|
image: plugins/s3-cache:1
|
||||||
|
settings:
|
||||||
|
pull: true
|
||||||
|
endpoint: https://storage.humenius.me
|
||||||
|
access_key:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
secret_key:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
flush: true
|
||||||
|
flush_age: 14
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
exclude:
|
exclude:
|
||||||
branch:
|
branch:
|
||||||
@@ -92,6 +150,26 @@ type: docker
|
|||||||
name: backend
|
name: backend
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Restore cache
|
||||||
|
image: plugins/s3-cache
|
||||||
|
settings:
|
||||||
|
pull: true
|
||||||
|
endpoint: https://storage.humenius.me
|
||||||
|
access_key:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
secret_key:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
restore: true
|
||||||
|
|
||||||
|
- name: Run unit tests
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- npm run test:cov
|
||||||
|
|
||||||
|
- name: Run E2E tests
|
||||||
|
image: node
|
||||||
|
- npm run test:e2e
|
||||||
|
|
||||||
- name: Build and push backend image
|
- name: Build and push backend image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
@@ -106,6 +184,33 @@ steps:
|
|||||||
registry: docker.humenius.me
|
registry: docker.humenius.me
|
||||||
tags: ["latest", "${DRONE_SEMVER}"]
|
tags: ["latest", "${DRONE_SEMVER}"]
|
||||||
|
|
||||||
|
- name: Rebuild cache
|
||||||
|
image: plugins/s3-cache
|
||||||
|
settings:
|
||||||
|
pull: true
|
||||||
|
endpoint: https://storage.humenius.me
|
||||||
|
access_key:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
secret_key:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
rebuild: true
|
||||||
|
mount:
|
||||||
|
- node_modules
|
||||||
|
when:
|
||||||
|
event: push
|
||||||
|
|
||||||
|
- name: Flush cache
|
||||||
|
image: plugins/s3-cache:1
|
||||||
|
settings:
|
||||||
|
pull: true
|
||||||
|
endpoint: https://storage.humenius.me
|
||||||
|
access_key:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
secret_key:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
flush: true
|
||||||
|
flush_age: 14
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- release/*
|
- release/*
|
||||||
@@ -118,6 +223,26 @@ type: docker
|
|||||||
name: backend-dev
|
name: backend-dev
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Restore cache
|
||||||
|
image: plugins/s3-cache
|
||||||
|
settings:
|
||||||
|
pull: true
|
||||||
|
endpoint: https://storage.humenius.me
|
||||||
|
access_key:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
secret_key:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
restore: true
|
||||||
|
|
||||||
|
- name: Run unit tests
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- npm run test:cov
|
||||||
|
|
||||||
|
- name: Run E2E tests
|
||||||
|
image: node
|
||||||
|
- npm run test:e2e
|
||||||
|
|
||||||
- name: Build and push backend dev image
|
- name: Build and push backend dev image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
@@ -132,6 +257,33 @@ steps:
|
|||||||
registry: docker.humenius.me
|
registry: docker.humenius.me
|
||||||
tags: ["dev-${DRONE_COMMIT_SHA}", "dev-latest"]
|
tags: ["dev-${DRONE_COMMIT_SHA}", "dev-latest"]
|
||||||
|
|
||||||
|
- name: Rebuild cache
|
||||||
|
image: plugins/s3-cache
|
||||||
|
settings:
|
||||||
|
pull: true
|
||||||
|
endpoint: https://storage.humenius.me
|
||||||
|
access_key:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
secret_key:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
rebuild: true
|
||||||
|
mount:
|
||||||
|
- node_modules
|
||||||
|
when:
|
||||||
|
event: push
|
||||||
|
|
||||||
|
- name: Flush cache
|
||||||
|
image: plugins/s3-cache:1
|
||||||
|
settings:
|
||||||
|
pull: true
|
||||||
|
endpoint: https://storage.humenius.me
|
||||||
|
access_key:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
secret_key:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
flush: true
|
||||||
|
flush_age: 14
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
exclude:
|
exclude:
|
||||||
branch:
|
branch:
|
||||||
|
|||||||
@@ -20,14 +20,10 @@ WORKDIR /app
|
|||||||
|
|
||||||
ENV DATABASE_URL="mysql://dummy:user@localhost:1234/db"
|
ENV DATABASE_URL="mysql://dummy:user@localhost:1234/db"
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY . .
|
||||||
COPY prisma ./prisma/
|
|
||||||
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
RUN npx prisma generate
|
RUN npx prisma generate
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export class DatabaseService {
|
|||||||
})
|
})
|
||||||
.then(value => this.prismaClient.seasons.findUnique({
|
.then(value => this.prismaClient.seasons.findUnique({
|
||||||
where: {
|
where: {
|
||||||
season_id: (!seasonId ? value : seasonId)
|
season_id: Number((!seasonId ? value : seasonId))
|
||||||
}
|
}
|
||||||
}) as Promise<seasons>)
|
}) as Promise<seasons>)
|
||||||
.then((result: SeasonInfo) => {
|
.then((result: SeasonInfo) => {
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
FROM node:14.3.0-alpine as builder
|
FROM node:14.3.0-alpine as builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV PATH /app/node_modules/.bin:$PATH
|
ENV PATH /app/node_modules/.bin:$PATH
|
||||||
COPY ./package.json ./
|
|
||||||
RUN yarn
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN yarn
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
FROM node:14.3.0-alpine
|
FROM node:14.3.0-alpine
|
||||||
|
|||||||
Reference in New Issue
Block a user