set
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
name: CD-Liara
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "18"
|
||||||
|
- name: update-liara
|
||||||
|
env:
|
||||||
|
LIARA_TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOiI2NGVkY2ZmYWJiODUyOWZmNWFmOTU3YmEiLCJpYXQiOjE3MjAyNzUyNDB9.WNsgMX03tD1rZaceKRgjQ_MCffvW8oOQ7CnT_NdYP30
|
||||||
|
run: |
|
||||||
|
npm i -g @liara/cli@5
|
||||||
|
liara deploy --app="api-asanmarket" --api-token="$LIARA_TOKEN" --no-app-logs
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"app":"asanservice",
|
||||||
|
"port":"6060",
|
||||||
|
"disks":[
|
||||||
|
{
|
||||||
|
"name": "uploads",
|
||||||
|
"mountTo": "static/uploads"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"node": {
|
||||||
|
"version": "18"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+2
-5
@@ -1,13 +1,10 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
const mongoose = require('mongoose')
|
const mongoose = require('mongoose')
|
||||||
// mongodb database connection string. change it as per your needs. here "mydb" is the name of the database. You don't need to create DB from mongodb terminal. mongoose create the database automatically.
|
// mongodb database connection string. change it as per your needs. here "mydb" is the name of the database. You don't need to create DB from mongodb terminal. mongoose create the database automatically.
|
||||||
const inHostUrl = 'mongodb://asanserv_admin:admin1234@localhost:27017/asanserv_database'
|
const inHostUrl = 'mongodb://root:KPTt76tImNBBMm4Kor8QA9gB@asan-service:27017/asanserv_database?authSource=admin'
|
||||||
const outHostUrl =
|
|
||||||
'mongodb://asanserv_admin:admin1234@www.asan-service.com:27017/asanserv_database?serverSelectionTimeoutMS=5000&connectTimeoutMS=10000&authSource=asanserv_database'
|
|
||||||
const locaUrl = 'mongodb://localhost:27017/AsanService'
|
|
||||||
const init = ()=>{
|
const init = ()=>{
|
||||||
try {
|
try {
|
||||||
mongoose.connect(outHostUrl, {
|
mongoose.connect(inHostUrl, {
|
||||||
useNewUrlParser: true,
|
useNewUrlParser: true,
|
||||||
useUnifiedTopology: true,
|
useUnifiedTopology: true,
|
||||||
useFindAndModify: false,
|
useFindAndModify: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user