Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-release-helper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-release-helper
Commits
c2df145b
Commit
c2df145b
authored
Jun 14, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release notifier
parent
f7379c0a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
src/app.module.ts
src/app.module.ts
+2
-2
src/app.service.ts
src/app.service.ts
+18
-1
No files found.
src/app.module.ts
View file @
c2df145b
import
{
Module
}
from
'
@nestjs/common
'
;
import
{
HttpModule
,
Module
}
from
'
@nestjs/common
'
;
import
{
AppController
}
from
'
./app.controller
'
;
import
{
AppController
}
from
'
./app.controller
'
;
import
{
AppService
}
from
'
./app.service
'
;
import
{
AppService
}
from
'
./app.service
'
;
import
{
AppLogger
}
from
'
./app.logger
'
;
import
{
AppLogger
}
from
'
./app.logger
'
;
...
@@ -6,7 +6,7 @@ import { TypeOrmModule } from '@nestjs/typeorm';
...
@@ -6,7 +6,7 @@ import { TypeOrmModule } from '@nestjs/typeorm';
import
{
typeormConfig
}
from
'
./config
'
;
import
{
typeormConfig
}
from
'
./config
'
;
@
Module
({
@
Module
({
imports
:
[
TypeOrmModule
.
forRoot
(
typeormConfig
())],
imports
:
[
TypeOrmModule
.
forRoot
(
typeormConfig
())
,
HttpModule
],
controllers
:
[
AppController
],
controllers
:
[
AppController
],
providers
:
[
AppService
,
AppLogger
],
providers
:
[
AppService
,
AppLogger
],
})
})
...
...
src/app.service.ts
View file @
c2df145b
import
{
import
{
BadRequestException
,
BadRequestException
,
ForbiddenException
,
ForbiddenException
,
HttpService
,
Injectable
,
Injectable
,
InternalServerErrorException
,
InternalServerErrorException
,
NotFoundException
,
NotFoundException
,
...
@@ -19,6 +20,7 @@ export class AppService {
...
@@ -19,6 +20,7 @@ export class AppService {
@
InjectConnection
(
'
app
'
)
@
InjectConnection
(
'
app
'
)
private
db
:
Connection
,
private
db
:
Connection
,
private
log
:
AppLogger
,
private
log
:
AppLogger
,
private
readonly
httpService
:
HttpService
,
)
{
)
{
this
.
log
.
setContext
(
'
app
'
);
this
.
log
.
setContext
(
'
app
'
);
this
.
config
=
releaseHelperConfig
;
this
.
config
=
releaseHelperConfig
;
...
@@ -34,7 +36,22 @@ export class AppService {
...
@@ -34,7 +36,22 @@ export class AppService {
if
(
!
this
.
config
.
packagerUrl
)
{
if
(
!
this
.
config
.
packagerUrl
)
{
return
;
return
;
}
}
// todo
try
{
const
result
=
await
this
.
httpService
.
post
<
string
>
(
`
${
this
.
config
.
packagerUrl
}
/pack`
,
release
,
{
responseType
:
'
text
'
,
})
.
toPromise
();
this
.
log
.
log
(
`Release
${
release
.
name
}
notified to
${
this
.
config
.
packagerUrl
}
:
${
result
.
data
}
`
,
);
}
catch
(
e
)
{
this
.
log
.
error
(
`Failed to notify
${
release
.
name
}
to
${
this
.
config
.
packagerUrl
}
:
${
e
.
toString
()}
`
,
);
}
}
}
async
getRelease
(
name
?:
string
)
{
async
getRelease
(
name
?:
string
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment