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
|
.rollup.cache
|
||||||
|
|
||||||
|
.env.production
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.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
|
# Install dependencies
|
||||||
pnpm i --frozen-lockfile
|
pnpm i
|
||||||
# Build Nestjs
|
# Build Nestjs
|
||||||
pnpm build
|
pnpm build
|
||||||
# Build JSX files
|
# Build JSX files
|
||||||
@ -10,19 +12,5 @@ node ./esbuild-client-prod.js
|
|||||||
# Build tailwind
|
# Build tailwind
|
||||||
./node_modules/.bin/tailwindcss -i static/tailwind.css -o ./static/styles.css --minify
|
./node_modules/.bin/tailwindcss -i static/tailwind.css -o ./static/styles.css --minify
|
||||||
|
|
||||||
# Remove previous deployments
|
# Send to remote
|
||||||
rm -rf $DEPLOY_PATH/*
|
scp -r /home/mario/carpeta usuario@dominio.com:/home/usuario
|
||||||
|
|
||||||
# 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
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
"class-validator": "^0.14.0",
|
"class-validator": "^0.14.0",
|
||||||
|
"dotenv": "^16.0.3",
|
||||||
"mysql2": "^3.2.4",
|
"mysql2": "^3.2.4",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"rxjs": "^7.2.0",
|
"rxjs": "^7.2.0",
|
||||||
|
@ -25,6 +25,9 @@ dependencies:
|
|||||||
class-validator:
|
class-validator:
|
||||||
specifier: ^0.14.0
|
specifier: ^0.14.0
|
||||||
version: 0.14.0
|
version: 0.14.0
|
||||||
|
dotenv:
|
||||||
|
specifier: ^16.0.3
|
||||||
|
version: 16.0.3
|
||||||
mysql2:
|
mysql2:
|
||||||
specifier: ^3.2.4
|
specifier: ^3.2.4
|
||||||
version: 3.3.0
|
version: 3.3.0
|
||||||
|
@ -16,9 +16,9 @@ import { SubjectService } from "./controller/subject/subject.service";
|
|||||||
type: "mysql",
|
type: "mysql",
|
||||||
host: "localhost",
|
host: "localhost",
|
||||||
port: 3306,
|
port: 3306,
|
||||||
username: "root",
|
username: process.env.MY_SQL_USER,
|
||||||
password: "1234567890",
|
password: process.env.MY_SQL_PASSWORD,
|
||||||
database: "educa7ls_plataforma",
|
database: process.env.MY_SQL_DB,
|
||||||
entities: [
|
entities: [
|
||||||
Persona,
|
Persona,
|
||||||
CursoGIE,
|
CursoGIE,
|
||||||
|
@ -2,6 +2,9 @@ import { NestFactory } from "@nestjs/core";
|
|||||||
import { AppModule } from "./app.module";
|
import { AppModule } from "./app.module";
|
||||||
import * as express from "express";
|
import * as express from "express";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
|
import * as dotenv from "dotenv";
|
||||||
|
|
||||||
|
dotenv.config();
|
||||||
|
|
||||||
async function bootstrap() {
|
async function bootstrap() {
|
||||||
const app = await NestFactory.create(AppModule);
|
const app = await NestFactory.create(AppModule);
|
||||||
|
Loading…
Reference in New Issue
Block a user