Add .env config
This commit is contained in:
parent
cd71cb4e17
commit
c9b8aad459
33
.cpanel.yml
33
.cpanel.yml
@ -1,33 +0,0 @@
|
||||
---
|
||||
deployment:
|
||||
tasks:
|
||||
- export DEPLOY_PATH=/home4/educa7ls/staging.eegsac.com
|
||||
# Install dependencies
|
||||
- pnpm i --frozen-lockfile
|
||||
# Build Nestjs
|
||||
- pnpm build
|
||||
# Build JSX files
|
||||
- node ./esbuild-prod.js
|
||||
# Build hydration script
|
||||
- node ./esbuild-client-prod.js
|
||||
# Build tailwind
|
||||
- ./node_modules/.bin/tailwindcss -i static/tailwind.css -o ./static/styles.css --minify
|
||||
|
||||
# Remove previous deployments
|
||||
- rm -rf $DEPLOY_PATH/*
|
||||
|
||||
# Move files to deploy path
|
||||
- /bin/cp -r ./dist $DEPLOY_PATH
|
||||
- /bin/cp -r ./static $DEPLOY_PATH
|
||||
- /bin/cp ./package.json $DEPLOY_PATH
|
||||
- /bin/cp ./pnpm-lock.yaml $DEPLOY_PATH
|
||||
- /bin/cp ./.htaccess $DEPLOY_PATH
|
||||
|
||||
# Remove build dependencies
|
||||
- rm -rf ./node_modules
|
||||
|
||||
# Install prod deps
|
||||
- cd $DEPLOY_PATH
|
||||
- pnpm i --frozen-lockfile --prod
|
||||
|
||||
# Success??
|
3
.env.example
Normal file
3
.env.example
Normal file
@ -0,0 +1,3 @@
|
||||
MY_SQL_USER=root
|
||||
MY_SQL_PASSWORD=1234567890
|
||||
MY_SQL_DB=educa7ls
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,6 +4,8 @@
|
||||
|
||||
.rollup.cache
|
||||
|
||||
.env.production
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
24
deploy.sh
24
deploy.sh
@ -1,6 +1,8 @@
|
||||
export DEPLOY_PATH=/home4/educa7ls/staging.eegsac.com
|
||||
# TO BE RUN IN LOCAL MACHINE, REMOTE CANNOT BUILD
|
||||
|
||||
|
||||
# Install dependencies
|
||||
pnpm i --frozen-lockfile
|
||||
pnpm i
|
||||
# Build Nestjs
|
||||
pnpm build
|
||||
# Build JSX files
|
||||
@ -10,19 +12,5 @@ node ./esbuild-client-prod.js
|
||||
# Build tailwind
|
||||
./node_modules/.bin/tailwindcss -i static/tailwind.css -o ./static/styles.css --minify
|
||||
|
||||
# Remove previous deployments
|
||||
rm -rf $DEPLOY_PATH/*
|
||||
|
||||
# Move files to deploy path
|
||||
/bin/cp -r ./dist $DEPLOY_PATH
|
||||
/bin/cp -r ./static $DEPLOY_PATH
|
||||
/bin/cp ./package.json $DEPLOY_PATH
|
||||
/bin/cp ./pnpm-lock.yaml $DEPLOY_PATH
|
||||
/bin/cp ./.htaccess $DEPLOY_PATH
|
||||
|
||||
# Remove build dependencies
|
||||
rm -rf ./node_modules
|
||||
|
||||
# Install prod deps
|
||||
cd $DEPLOY_PATH
|
||||
pnpm i --frozen-lockfile --prod
|
||||
# Send to remote
|
||||
scp -r /home/mario/carpeta usuario@dominio.com:/home/usuario
|
||||
|
@ -31,6 +31,7 @@
|
||||
"axios": "^1.4.0",
|
||||
"class-transformer": "^0.5.1",
|
||||
"class-validator": "^0.14.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"mysql2": "^3.2.4",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rxjs": "^7.2.0",
|
||||
|
@ -25,6 +25,9 @@ dependencies:
|
||||
class-validator:
|
||||
specifier: ^0.14.0
|
||||
version: 0.14.0
|
||||
dotenv:
|
||||
specifier: ^16.0.3
|
||||
version: 16.0.3
|
||||
mysql2:
|
||||
specifier: ^3.2.4
|
||||
version: 3.3.0
|
||||
|
@ -16,9 +16,9 @@ import { SubjectService } from "./controller/subject/subject.service";
|
||||
type: "mysql",
|
||||
host: "localhost",
|
||||
port: 3306,
|
||||
username: "root",
|
||||
password: "1234567890",
|
||||
database: "educa7ls_plataforma",
|
||||
username: process.env.MY_SQL_USER,
|
||||
password: process.env.MY_SQL_PASSWORD,
|
||||
database: process.env.MY_SQL_DB,
|
||||
entities: [
|
||||
Persona,
|
||||
CursoGIE,
|
||||
|
@ -2,6 +2,9 @@ import { NestFactory } from "@nestjs/core";
|
||||
import { AppModule } from "./app.module";
|
||||
import * as express from "express";
|
||||
import * as path from "path";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
|
Loading…
Reference in New Issue
Block a user