Skip to content

Commit

Permalink
Merge pull request #60 from Blvckleg/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
sanriodev authored Feb 25, 2024
2 parents 15fde9e + 3a1426d commit 43fbdf4
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 26 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy

on:
workflow_run:
workflows: [Docker Image CI]
types: [completed]
branches: [master]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}
passphrase: ${{ secrets.SERVER_PASSPHRASE }}
script_stop: true
script: |
cd bingusboingus
docker compose pull
docker compose up -d
###ssh sachen
# https://github.com/appleboy/ssh-action
21 changes: 15 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@
"runtimeExecutable": "npm",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env",
"runtimeArgs": ["run-script", "start:debug"],
"skipFiles": ["<node_internals>/**"]
"runtimeArgs": [
"run-script",
"start:debug"
],
"skipFiles": [
"<node_internals>/**"
]
},
{
"type": "node",
Expand All @@ -21,9 +26,13 @@
"runtimeExecutable": "npm",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env.dev",
"runtimeArgs": ["run-script", "start:debug"],
"skipFiles": ["<node_internals>/**"]
"runtimeArgs": [
"run-script",
"start:debug"
],
"skipFiles": [
"<node_internals>/**"
]
}
]

}
}
5 changes: 1 addition & 4 deletions src/config/database/mongo/config/config.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ const ENV = process.env.NODE_ENV;
MONGO_PORT: Joi.number().default(27017),
MONGO_USERNAME: Joi.string(),
MONGO_PASSWORD: Joi.string(),
MONGO_DATABASE: Joi.string().default('bingus'),
MONGO_RUN_MIGRATION: Joi.boolean().default(false),
MONGO_ENTITIES: Joi.string().default('dist/**/*.entity.*{ts,js}'),
MONGO_RUN_SYNCHRONIZE: Joi.boolean().default(false),
MONGO_DATABASE: Joi.string().default(null),
}),
}),
],
Expand Down
18 changes: 2 additions & 16 deletions src/config/database/mongo/config/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ import {
*/
@Injectable()
export class MongoConfigService implements MongooseOptionsFactory {
constructor(private configService: ConfigService) {}
constructor(private configService: ConfigService) { }

createMongooseOptions(): MongooseModuleOptions {
if (this.username && this.password) {
return {
uri: `mongodb://${this.username}:${this.password}@${this.uri}`,
};
return { uri: `mongodb://${this.username}:${this.password}@${this.uri}` + (this.database ? `/?authSource=${this.database}` : "") }
} else {
return { uri: this.uri };
}
Expand All @@ -26,9 +24,6 @@ export class MongoConfigService implements MongooseOptionsFactory {
get uri(): string {
return this.configService.get<string>('mongo.uri');
}
get port(): number {
return Number(this.configService.get<number>('mongo.port'));
}
get username(): string {
return this.configService.get<string>('mongo.username');
}
Expand All @@ -38,13 +33,4 @@ export class MongoConfigService implements MongooseOptionsFactory {
get database(): string {
return this.configService.get<string>('mongo.database');
}
get migrationsRun(): boolean {
return JSON.parse(this.configService.get<string>('mongo.migrationsRun'));
}
get synchronizeRun(): boolean {
return JSON.parse(this.configService.get<string>('mongo.synchronizeRun'));
}
get entities(): string {
return this.configService.get<string>('mongo.entities');
}
}

0 comments on commit 43fbdf4

Please sign in to comment.