Database Connection Update #4
222
.drone.yml
222
.drone.yml
@@ -3,16 +3,26 @@ type: docker
|
||||
name: frontend
|
||||
|
||||
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: 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 image
|
||||
image: plugins/docker
|
||||
@@ -28,32 +38,32 @@ steps:
|
||||
registry: docker.humenius.me
|
||||
tags: ["latest", "${DRONE_SEMVER}"]
|
||||
|
||||
# - name: rebuild
|
||||
# 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: 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
|
||||
# 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
|
||||
- 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:
|
||||
branch:
|
||||
@@ -67,6 +77,27 @@ type: docker
|
||||
name: frontend-dev
|
||||
|
||||
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
|
||||
image: plugins/docker
|
||||
settings:
|
||||
@@ -81,6 +112,33 @@ steps:
|
||||
registry: docker.humenius.me
|
||||
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:
|
||||
exclude:
|
||||
branch:
|
||||
@@ -92,6 +150,26 @@ type: docker
|
||||
name: backend
|
||||
|
||||
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
|
||||
image: plugins/docker
|
||||
settings:
|
||||
@@ -106,6 +184,33 @@ steps:
|
||||
registry: docker.humenius.me
|
||||
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:
|
||||
branch:
|
||||
- release/*
|
||||
@@ -118,6 +223,26 @@ type: docker
|
||||
name: backend-dev
|
||||
|
||||
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
|
||||
image: plugins/docker
|
||||
settings:
|
||||
@@ -132,6 +257,33 @@ steps:
|
||||
registry: docker.humenius.me
|
||||
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:
|
||||
exclude:
|
||||
branch:
|
||||
|
||||
@@ -20,14 +20,10 @@ WORKDIR /app
|
||||
|
||||
ENV DATABASE_URL="mysql://dummy:user@localhost:1234/db"
|
||||
|
||||
COPY package*.json ./
|
||||
COPY prisma ./prisma/
|
||||
COPY . .
|
||||
|
||||
RUN npm install
|
||||
RUN npx prisma generate
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm run build
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ export class DatabaseService {
|
||||
})
|
||||
.then(value => this.prismaClient.seasons.findUnique({
|
||||
where: {
|
||||
season_id: (!seasonId ? value : seasonId)
|
||||
season_id: Number((!seasonId ? value : seasonId))
|
||||
}
|
||||
}) as Promise<seasons>)
|
||||
.then((result: SeasonInfo) => {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
FROM node:14.3.0-alpine as builder
|
||||
WORKDIR /app
|
||||
ENV PATH /app/node_modules/.bin:$PATH
|
||||
COPY ./package.json ./
|
||||
RUN yarn
|
||||
COPY . .
|
||||
RUN yarn
|
||||
RUN yarn build
|
||||
|
||||
FROM node:14.3.0-alpine
|
||||
|
||||
Reference in New Issue
Block a user