mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
Merge pull request #416 from OneUptime/workflow-project
active monitoring project
This commit is contained in:
25
.github/workflows/compile.accounts.yaml
vendored
25
.github/workflows/compile.accounts.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Compile Accounts
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Accounts && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.alert.yaml
vendored
24
.github/workflows/compile.alert.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Alert
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Alert && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.api-reference.yaml
vendored
24
.github/workflows/compile.api-reference.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile ApiReference
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd ApiReference && npm install && npm run compile
|
||||
|
||||
23
.github/workflows/compile.common-server.yaml
vendored
23
.github/workflows/compile.common-server.yaml
vendored
@@ -1,23 +0,0 @@
|
||||
name: Compile CommonServer
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install && npm run compile
|
||||
|
||||
23
.github/workflows/compile.common-ui.yaml
vendored
23
.github/workflows/compile.common-ui.yaml
vendored
@@ -1,23 +0,0 @@
|
||||
name: Compile UI Common
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonUI && npm install --force && npm run compile
|
||||
|
||||
22
.github/workflows/compile.common.yaml
vendored
22
.github/workflows/compile.common.yaml
vendored
@@ -1,22 +0,0 @@
|
||||
name: Compile Common
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install && npm run compile
|
||||
|
||||
25
.github/workflows/compile.dashboard-api.yaml
vendored
25
.github/workflows/compile.dashboard-api.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Compile DashboardAPI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd DashboardAPI && npm install && npm run compile
|
||||
|
||||
25
.github/workflows/compile.dashboard.yaml
vendored
25
.github/workflows/compile.dashboard.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Compile Dashboard
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Dashboard && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.file.yaml
vendored
24
.github/workflows/compile.file.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile File Service
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd File && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.helmchart.yaml
vendored
24
.github/workflows/compile.helmchart.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile HelmChart
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd HelmChart && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.home.yaml
vendored
24
.github/workflows/compile.home.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Home
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Home && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.identity.yaml
vendored
24
.github/workflows/compile.identity.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Identity
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Identity && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.integration.yaml
vendored
24
.github/workflows/compile.integration.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Integration
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Integration && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.licensing.yaml
vendored
24
.github/workflows/compile.licensing.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Licensing
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Licensing && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.mail.yaml
vendored
24
.github/workflows/compile.mail.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Mail
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Mail && npm install && npm run compile
|
||||
|
||||
23
.github/workflows/compile.model.yaml
vendored
23
.github/workflows/compile.model.yaml
vendored
@@ -1,23 +0,0 @@
|
||||
name: Compile Model
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd Model && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.probe-api.yaml
vendored
24
.github/workflows/compile.probe-api.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile ProbeAPI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd ProbeAPI && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.realtime.yaml
vendored
24
.github/workflows/compile.realtime.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Realtime
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Realtime && npm install && npm run compile
|
||||
|
||||
25
.github/workflows/compile.status-page.yaml
vendored
25
.github/workflows/compile.status-page.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Compile Status Page
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd StatusPage && npm install && npm run compile
|
||||
|
||||
25
.github/workflows/compile.workers.yaml
vendored
25
.github/workflows/compile.workers.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Compile Workers
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Workers && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.workflow.yaml
vendored
24
.github/workflows/compile.workflow.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Workflow
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Workflow && npm install && npm run compile
|
||||
|
||||
334
.github/workflows/compile.yml
vendored
Normal file
334
.github/workflows/compile.yml
vendored
Normal file
@@ -0,0 +1,334 @@
|
||||
name: Compile
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
compile-accounts:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Accounts && npm install && npm run compile
|
||||
|
||||
compile-alert:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Alert && npm install && npm run compile
|
||||
|
||||
compile-api-reference:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd ApiReference && npm install && npm run compile
|
||||
|
||||
compile-common-server:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install && npm run compile
|
||||
|
||||
compile-common-ui:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonUI && npm install --force && npm run compile
|
||||
|
||||
compile-common:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install && npm run compile
|
||||
|
||||
compile-dashboard-api:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd DashboardAPI && npm install && npm run compile
|
||||
|
||||
compile-dashboard:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Dashboard && npm install && npm run compile
|
||||
|
||||
compile-file:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd File && npm install && npm run compile
|
||||
|
||||
compile-helm-chart:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd HelmChart && npm install && npm run compile
|
||||
|
||||
compile-home:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Home && npm install && npm run compile
|
||||
|
||||
compile-identity:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Identity && npm install && npm run compile
|
||||
|
||||
compile-integrations:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Integration && npm install && npm run compile
|
||||
|
||||
compile-licensing:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Licensing && npm install && npm run compile
|
||||
|
||||
compile-mail:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Mail && npm install && npm run compile
|
||||
|
||||
compile-model:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd Model && npm install && npm run compile
|
||||
|
||||
compile-probe:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Probe && npm install && npm run compile
|
||||
|
||||
compile-probe-api:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd ProbeAPI && npm install && npm run compile
|
||||
|
||||
|
||||
compile-realtime:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Realtime && npm install && npm run compile
|
||||
|
||||
compile-status-page:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd StatusPage && npm install && npm run compile
|
||||
|
||||
compile-workers:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Workers && npm install && npm run compile
|
||||
|
||||
compile-workflow:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Workflow && npm install && npm run compile
|
||||
|
||||
compile-test-server:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd TestServer && npm install && npm run compile
|
||||
25
.github/workflows/docker-build.accounts.yaml
vendored
25
.github/workflows/docker-build.accounts.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Accounts Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for accounts service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Accounts/Dockerfile .
|
||||
25
.github/workflows/docker-build.alert.yaml
vendored
25
.github/workflows/docker-build.alert.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Alert Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Alert/Dockerfile .
|
||||
24
.github/workflows/docker-build.api-reference.yml
vendored
24
.github/workflows/docker-build.api-reference.yml
vendored
@@ -1,24 +0,0 @@
|
||||
name: API Docs Docker Build
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./ApiReference/Dockerfile .
|
||||
@@ -1,26 +0,0 @@
|
||||
name: DashboardAPI Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
|
||||
# build image for accounts service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./DashboardAPI/Dockerfile .
|
||||
25
.github/workflows/docker-build.dashboard.yaml
vendored
25
.github/workflows/docker-build.dashboard.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Dashboard Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Dashboard/Dockerfile .
|
||||
25
.github/workflows/docker-build.file.yaml
vendored
25
.github/workflows/docker-build.file.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: File Service Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for file
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./File/Dockerfile .
|
||||
25
.github/workflows/docker-build.haraka.yaml
vendored
25
.github/workflows/docker-build.haraka.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Haraka Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build images
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Haraka/Dockerfile .
|
||||
25
.github/workflows/docker-build.helm-chart.yml
vendored
25
.github/workflows/docker-build.helm-chart.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Helm Chart Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./HelmChart/Dockerfile .
|
||||
25
.github/workflows/docker-build.home.yaml
vendored
25
.github/workflows/docker-build.home.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Home Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Home/Dockerfile .
|
||||
25
.github/workflows/docker-build.identity.yaml
vendored
25
.github/workflows/docker-build.identity.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Identity Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for identity
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Identity/Dockerfile .
|
||||
25
.github/workflows/docker-build.integration.yaml
vendored
25
.github/workflows/docker-build.integration.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Integration Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for licensing
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Integration/Dockerfile .
|
||||
25
.github/workflows/docker-build.licensing.yaml
vendored
25
.github/workflows/docker-build.licensing.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Licensing Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for licensing
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Licensing/Dockerfile .
|
||||
25
.github/workflows/docker-build.mail.yaml
vendored
25
.github/workflows/docker-build.mail.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Mail Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Mail/Dockerfile .
|
||||
25
.github/workflows/docker-build.nginx.yml
vendored
25
.github/workflows/docker-build.nginx.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: NGINX Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Nginx/Dockerfile ./Nginx
|
||||
25
.github/workflows/docker-build.probe-api.yaml
vendored
25
.github/workflows/docker-build.probe-api.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Probe-api Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image probe api
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./ProbeAPI/Dockerfile .
|
||||
25
.github/workflows/docker-build.status-page.yaml
vendored
25
.github/workflows/docker-build.status-page.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Status Page Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./StatusPage/Dockerfile .
|
||||
26
.github/workflows/docker-build.workers.yaml
vendored
26
.github/workflows/docker-build.workers.yaml
vendored
@@ -1,26 +0,0 @@
|
||||
name: Workers Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Workers/Dockerfile .
|
||||
25
.github/workflows/docker-build.workflow.yaml
vendored
25
.github/workflows/docker-build.workflow.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Workflow Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Workflow/Dockerfile .
|
||||
329
.github/workflows/docker-build.yml
vendored
Normal file
329
.github/workflows/docker-build.yml
vendored
Normal file
@@ -0,0 +1,329 @@
|
||||
name: Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
docker-build-accounts:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for accounts service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Accounts/Dockerfile .
|
||||
|
||||
docker-build-alert:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Alert/Dockerfile .
|
||||
|
||||
docker-build-api-reference:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./ApiReference/Dockerfile .
|
||||
|
||||
docker-build-dashboard-api:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
|
||||
# build image for accounts service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./DashboardAPI/Dockerfile .
|
||||
|
||||
docker-build-dashboard:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Dashboard/Dockerfile .
|
||||
|
||||
docker-build-file:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for file
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./File/Dockerfile .
|
||||
|
||||
docker-build-haraka:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build images
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Haraka/Dockerfile .
|
||||
|
||||
docker-build-helm-chart:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./HelmChart/Dockerfile .
|
||||
|
||||
docker-build-home:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Home/Dockerfile .
|
||||
|
||||
docker-build-identity:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for identity
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Identity/Dockerfile .
|
||||
|
||||
docker-build-integrations:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for licensing
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Integration/Dockerfile .
|
||||
|
||||
docker-build-licensing:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for licensing
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Licensing/Dockerfile .
|
||||
|
||||
docker-build-mail:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Mail/Dockerfile .
|
||||
|
||||
docker-build-nginx:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Nginx/Dockerfile ./Nginx
|
||||
|
||||
docker-build-probe:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image probe api
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Probe/Dockerfile .
|
||||
|
||||
docker-build-probe-api:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image probe api
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./ProbeAPI/Dockerfile .
|
||||
|
||||
docker-build-realtime:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Realtime/Dockerfile .
|
||||
|
||||
docker-build-status-page:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./StatusPage/Dockerfile .
|
||||
|
||||
docker-build-workers:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Workers/Dockerfile .
|
||||
|
||||
docker-build-workflow:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Workflow/Dockerfile .
|
||||
|
||||
|
||||
docker-build-test-server:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./TestServer/Dockerfile .
|
||||
25
.github/workflows/github-build.realtime.yaml
vendored
25
.github/workflows/github-build.realtime.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Realtime Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Realtime/Dockerfile .
|
||||
@@ -1,20 +1,43 @@
|
||||
name: Test Image Deploy to DockerHub
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
- "release"
|
||||
|
||||
jobs:
|
||||
|
||||
workflow-test:
|
||||
github-release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
env:
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- name: "Build Changelog"
|
||||
id: build_changelog
|
||||
uses: mikepenz/release-changelog-builder-action@v3.7.1
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{env.ONEUPTIME_VERSION}}
|
||||
artifactErrorsFailBuild: true
|
||||
body: |
|
||||
${{steps.build_changelog.outputs.changelog}}
|
||||
|
||||
|
||||
test-server-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -24,16 +47,40 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workflow:6.0.$CI_PIPELINE_ID-test --tag oneuptime/workflow:test --push -f ./Workflow/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/test-server:$ONEUPTIME_VERSION --tag oneuptime/test-server:release --push -f ./TestServer/Dockerfile .
|
||||
|
||||
workers-test:
|
||||
|
||||
workflow-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
|
||||
- run: npm run prerun
|
||||
- run: sudo docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workflow:$ONEUPTIME_VERSION --tag oneuptime/workflow:release --push -f ./Workflow/Dockerfile .
|
||||
|
||||
workers-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -43,16 +90,18 @@ jobs:
|
||||
# Build and deploy workers.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workers:6.0.$CI_PIPELINE_ID-test --tag oneuptime/workers:test --push -f ./Workers/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workers:$ONEUPTIME_VERSION --tag oneuptime/workers:release --push -f ./Workers/Dockerfile .
|
||||
|
||||
staus-page-test:
|
||||
staus-page-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -62,16 +111,18 @@ jobs:
|
||||
# Build and deploy status-page.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/status-page:6.0.$CI_PIPELINE_ID-test --tag oneuptime/status-page:test --push -f ./StatusPage/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/status-page:$ONEUPTIME_VERSION --tag oneuptime/status-page:release --push -f ./StatusPage/Dockerfile .
|
||||
|
||||
realtime-test:
|
||||
realtime-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -81,17 +132,19 @@ jobs:
|
||||
# Build and deploy realtime.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/realtime:6.0.$CI_PIPELINE_ID-test --tag oneuptime/realtime:test --push -f ./Realtime/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/realtime:$ONEUPTIME_VERSION --tag oneuptime/realtime:release --push -f ./Realtime/Dockerfile .
|
||||
|
||||
|
||||
probe-api-test:
|
||||
probe-api-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -101,16 +154,18 @@ jobs:
|
||||
# Build and deploy probe-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe-api:6.0.$CI_PIPELINE_ID-test --tag oneuptime/probe-api:test --push -f ./ProbeAPI/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe-api:$ONEUPTIME_VERSION --tag oneuptime/probe-api:release --push -f ./ProbeAPI/Dockerfile .
|
||||
|
||||
nginx-test:
|
||||
nginx-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -120,17 +175,19 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/nginx:6.0.$CI_PIPELINE_ID-test --tag oneuptime/nginx:test --push -f ./Nginx/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/nginx:$ONEUPTIME_VERSION --tag oneuptime/nginx:release --push -f ./Nginx/Dockerfile .
|
||||
|
||||
|
||||
mail-test:
|
||||
mail-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -139,17 +196,19 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/mail:6.0.$CI_PIPELINE_ID-test --tag oneuptime/mail:test --push -f ./Mail/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/mail:$ONEUPTIME_VERSION --tag oneuptime/mail:release --push -f ./Mail/Dockerfile .
|
||||
|
||||
|
||||
licensing-test:
|
||||
licensing-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -159,16 +218,18 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/licensing:6.0.$CI_PIPELINE_ID-test --tag oneuptime/licensing:test --push -f ./Licensing/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/licensing:$ONEUPTIME_VERSION --tag oneuptime/licensing:release --push -f ./Licensing/Dockerfile .
|
||||
|
||||
integrations-test:
|
||||
integrations-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -178,19 +239,19 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/integrations:6.0.$CI_PIPELINE_ID-test --tag oneuptime/integrations:test --push -f ./Integration/Dockerfile .
|
||||
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/integrations:$ONEUPTIME_VERSION --tag oneuptime/integrations:release --push -f ./Integration/Dockerfile .
|
||||
|
||||
|
||||
|
||||
identity-test:
|
||||
probe-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -200,17 +261,18 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/identity:6.0.$CI_PIPELINE_ID-test --tag oneuptime/identity:test --push -f ./Identity/Dockerfile .
|
||||
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe:$ONEUPTIME_VERSION --tag oneuptime/probe:release --push -f ./Probe/Dockerfile .
|
||||
|
||||
home-test:
|
||||
identity-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -220,17 +282,19 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/home:6.0.$CI_PIPELINE_ID-test --tag oneuptime/home:test --push -f ./Home/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/identity:$ONEUPTIME_VERSION --tag oneuptime/identity:release --push -f ./Identity/Dockerfile .
|
||||
|
||||
|
||||
helm-chart-test:
|
||||
home-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -240,17 +304,19 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/helm-chart:6.0.$CI_PIPELINE_ID-test --tag oneuptime/helm-chart:test --push -f ./HelmChart/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/home:$ONEUPTIME_VERSION --tag oneuptime/home:release --push -f ./Home/Dockerfile .
|
||||
|
||||
|
||||
haraka-test:
|
||||
helm-chart-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -260,16 +326,40 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/haraka:6.0.$CI_PIPELINE_ID-test --tag oneuptime/haraka:test --push -f ./Haraka/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/helm-chart:$ONEUPTIME_VERSION --tag oneuptime/helm-chart:release --push -f ./HelmChart/Dockerfile .
|
||||
|
||||
|
||||
file-test:
|
||||
haraka-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
|
||||
- run: npm run prerun
|
||||
- run: sudo docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/haraka:$ONEUPTIME_VERSION --tag oneuptime/haraka:release --push -f ./Haraka/Dockerfile .
|
||||
|
||||
file-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -278,18 +368,20 @@ jobs:
|
||||
# Build and deploy file.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/file:6.0.$CI_PIPELINE_ID-test --tag oneuptime/file:test --push -f ./File/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/file:$ONEUPTIME_VERSION --tag oneuptime/file:release --push -f ./File/Dockerfile .
|
||||
|
||||
|
||||
|
||||
dashboard-test:
|
||||
dashboard-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -299,19 +391,21 @@ jobs:
|
||||
# Build and deploy dashboard-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard:6.0.$CI_PIPELINE_ID-test --tag oneuptime/dashboard:test --push -f ./Dashboard/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard:$ONEUPTIME_VERSION --tag oneuptime/dashboard:release --push -f ./Dashboard/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
dashboard-api-test:
|
||||
dashboard-api-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -321,19 +415,21 @@ jobs:
|
||||
# Build and deploy dashboard-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard-api:6.0.$CI_PIPELINE_ID-test --tag oneuptime/dashboard-api:test --push -f ./DashboardAPI/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard-api:$ONEUPTIME_VERSION --tag oneuptime/dashboard-api:release --push -f ./DashboardAPI/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
api-reference-test:
|
||||
api-reference-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -343,19 +439,21 @@ jobs:
|
||||
# Build and deploy api-reference.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:6.0.$CI_PIPELINE_ID-test --tag oneuptime/api-reference:test --push -f ./ApiReference/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:$ONEUPTIME_VERSION --tag oneuptime/api-reference:release --push -f ./ApiReference/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
alert-test:
|
||||
alert-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -365,19 +463,21 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/alert:6.0.$CI_PIPELINE_ID-test --tag oneuptime/alert:test --push -f ./Alert/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/alert:$ONEUPTIME_VERSION --tag oneuptime/alert:release --push -f ./Alert/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
accounts-test:
|
||||
accounts-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -387,6 +487,6 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/accounts:6.0.$CI_PIPELINE_ID-test --tag oneuptime/accounts:test --push -f ./Accounts/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/accounts:$ONEUPTIME_VERSION --tag oneuptime/accounts:release --push -f ./Accounts/Dockerfile .
|
||||
|
||||
|
||||
@@ -1,38 +1,18 @@
|
||||
name: Release Image Deploy to DockerHub
|
||||
name: Test Image Deploy to DockerHub
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "release"
|
||||
- "master"
|
||||
|
||||
jobs:
|
||||
|
||||
github-release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
env:
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- name: "Build Changelog"
|
||||
id: build_changelog
|
||||
uses: mikepenz/release-changelog-builder-action@v3.7.1
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{env.ONEUPTIME_VERSION}}
|
||||
artifactErrorsFailBuild: true
|
||||
body: |
|
||||
${{steps.build_changelog.outputs.changelog}}
|
||||
|
||||
workflow-release:
|
||||
test-server-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -44,14 +24,33 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workflow:6.0.$CI_PIPELINE_ID --tag oneuptime/workflow:release --push -f ./Workflow/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/test-server:$ONEUPTIME_VERSION-test --tag oneuptime/test-server:test --push -f ./TestServer/Dockerfile .
|
||||
|
||||
workers-release:
|
||||
workflow-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
|
||||
- run: npm run prerun
|
||||
- run: sudo docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workflow:$ONEUPTIME_VERSION-test --tag oneuptime/workflow:test --push -f ./Workflow/Dockerfile .
|
||||
|
||||
workers-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -63,14 +62,14 @@ jobs:
|
||||
# Build and deploy workers.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workers:6.0.$CI_PIPELINE_ID --tag oneuptime/workers:release --push -f ./Workers/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workers:$ONEUPTIME_VERSION-test --tag oneuptime/workers:test --push -f ./Workers/Dockerfile .
|
||||
|
||||
staus-page-release:
|
||||
staus-page-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -82,14 +81,14 @@ jobs:
|
||||
# Build and deploy status-page.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/status-page:6.0.$CI_PIPELINE_ID --tag oneuptime/status-page:release --push -f ./StatusPage/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/status-page:$ONEUPTIME_VERSION-test --tag oneuptime/status-page:test --push -f ./StatusPage/Dockerfile .
|
||||
|
||||
realtime-release:
|
||||
realtime-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -101,15 +100,15 @@ jobs:
|
||||
# Build and deploy realtime.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/realtime:6.0.$CI_PIPELINE_ID --tag oneuptime/realtime:release --push -f ./Realtime/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/realtime:$ONEUPTIME_VERSION-test --tag oneuptime/realtime:test --push -f ./Realtime/Dockerfile .
|
||||
|
||||
|
||||
probe-api-release:
|
||||
probe-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -121,14 +120,33 @@ jobs:
|
||||
# Build and deploy probe-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe-api:6.0.$CI_PIPELINE_ID --tag oneuptime/probe-api:release --push -f ./ProbeAPI/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe:$ONEUPTIME_VERSION-test --tag oneuptime/probe:test --push -f ./Probe/Dockerfile .
|
||||
|
||||
nginx-release:
|
||||
probe-api-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
|
||||
- run: npm run prerun
|
||||
- run: sudo docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3
|
||||
# Build and deploy probe-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe-api:$ONEUPTIME_VERSION-test --tag oneuptime/probe-api:test --push -f ./ProbeAPI/Dockerfile .
|
||||
|
||||
nginx-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -140,15 +158,15 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/nginx:6.0.$CI_PIPELINE_ID --tag oneuptime/nginx:release --push -f ./Nginx/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/nginx:$ONEUPTIME_VERSION-test --tag oneuptime/nginx:test --push -f ./Nginx/Dockerfile .
|
||||
|
||||
|
||||
mail-release:
|
||||
mail-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -159,15 +177,15 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/mail:6.0.$CI_PIPELINE_ID --tag oneuptime/mail:release --push -f ./Mail/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/mail:$ONEUPTIME_VERSION-test --tag oneuptime/mail:test --push -f ./Mail/Dockerfile .
|
||||
|
||||
|
||||
licensing-release:
|
||||
licensing-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -179,14 +197,14 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/licensing:6.0.$CI_PIPELINE_ID --tag oneuptime/licensing:release --push -f ./Licensing/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/licensing:$ONEUPTIME_VERSION-test --tag oneuptime/licensing:test --push -f ./Licensing/Dockerfile .
|
||||
|
||||
integrations-release:
|
||||
integrations-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -198,17 +216,17 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/integrations:6.0.$CI_PIPELINE_ID --tag oneuptime/integrations:release --push -f ./Integration/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/integrations:$ONEUPTIME_VERSION-test --tag oneuptime/integrations:test --push -f ./Integration/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
identity-release:
|
||||
identity-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -220,15 +238,15 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/identity:6.0.$CI_PIPELINE_ID --tag oneuptime/identity:release --push -f ./Identity/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/identity:$ONEUPTIME_VERSION-test --tag oneuptime/identity:test --push -f ./Identity/Dockerfile .
|
||||
|
||||
|
||||
home-release:
|
||||
home-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -240,15 +258,15 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/home:6.0.$CI_PIPELINE_ID --tag oneuptime/home:release --push -f ./Home/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/home:$ONEUPTIME_VERSION-test --tag oneuptime/home:test --push -f ./Home/Dockerfile .
|
||||
|
||||
|
||||
helm-chart-release:
|
||||
helm-chart-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -260,15 +278,15 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/helm-chart:6.0.$CI_PIPELINE_ID --tag oneuptime/helm-chart:release --push -f ./HelmChart/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/helm-chart:$ONEUPTIME_VERSION-test --tag oneuptime/helm-chart:test --push -f ./HelmChart/Dockerfile .
|
||||
|
||||
|
||||
haraka-release:
|
||||
haraka-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -280,14 +298,14 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/haraka:6.0.$CI_PIPELINE_ID --tag oneuptime/haraka:release --push -f ./Haraka/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/haraka:$ONEUPTIME_VERSION-test --tag oneuptime/haraka:test --push -f ./Haraka/Dockerfile .
|
||||
|
||||
file-release:
|
||||
file-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -298,16 +316,16 @@ jobs:
|
||||
# Build and deploy file.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/file:6.0.$CI_PIPELINE_ID --tag oneuptime/file:release --push -f ./File/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/file:$ONEUPTIME_VERSION-test --tag oneuptime/file:test --push -f ./File/Dockerfile .
|
||||
|
||||
|
||||
|
||||
dashboard-release:
|
||||
dashboard-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -319,17 +337,17 @@ jobs:
|
||||
# Build and deploy dashboard-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard:6.0.$CI_PIPELINE_ID --tag oneuptime/dashboard:release --push -f ./Dashboard/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard:$ONEUPTIME_VERSION-test --tag oneuptime/dashboard:test --push -f ./Dashboard/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
dashboard-api-release:
|
||||
dashboard-api-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -341,17 +359,17 @@ jobs:
|
||||
# Build and deploy dashboard-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard-api:6.0.$CI_PIPELINE_ID --tag oneuptime/dashboard-api:release --push -f ./DashboardAPI/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard-api:$ONEUPTIME_VERSION-test --tag oneuptime/dashboard-api:test --push -f ./DashboardAPI/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
api-reference-release:
|
||||
api-reference-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -363,17 +381,17 @@ jobs:
|
||||
# Build and deploy api-reference.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:6.0.$CI_PIPELINE_ID --tag oneuptime/api-reference:release --push -f ./ApiReference/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:$ONEUPTIME_VERSION-test --tag oneuptime/api-reference:test --push -f ./ApiReference/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
alert-release:
|
||||
alert-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -385,17 +403,17 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/alert:6.0.$CI_PIPELINE_ID --tag oneuptime/alert:release --push -f ./Alert/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/alert:$ONEUPTIME_VERSION-test --tag oneuptime/alert:test --push -f ./Alert/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
accounts-release:
|
||||
accounts-test-docker-image-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -407,6 +425,6 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/accounts:6.0.$CI_PIPELINE_ID --tag oneuptime/accounts:release --push -f ./Accounts/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/accounts:$ONEUPTIME_VERSION-test --tag oneuptime/accounts:test --push -f ./Accounts/Dockerfile .
|
||||
|
||||
|
||||
42
.vscode/launch.json
vendored
42
.vscode/launch.json
vendored
@@ -41,6 +41,48 @@
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/TestServer",
|
||||
"name": "Test Server: Debug with Docker",
|
||||
"port": 9141,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/Probe",
|
||||
"name": "Dashboard API: Debug with Docker",
|
||||
"port": 9655,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/ProbeAPI",
|
||||
"name": "Probe API: Debug with Docker",
|
||||
"port": 9932,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/Workflow",
|
||||
|
||||
@@ -34,9 +34,10 @@ const VerifyEmail: FunctionComponent = () => {
|
||||
emailverificationToken,
|
||||
EmailVerificationToken,
|
||||
FormType.Create,
|
||||
apiUrl,
|
||||
{},
|
||||
{}
|
||||
{
|
||||
overrideRequestUrl: apiUrl,
|
||||
}
|
||||
);
|
||||
} catch (err) {
|
||||
setError(API.getFriendlyMessage(err));
|
||||
|
||||
@@ -38,11 +38,7 @@ describe('IP()', () => {
|
||||
});
|
||||
|
||||
test('should return a string', () => {
|
||||
expect(IP.toDatabase('127.0.0.1')).toBe('127.0.0.1');
|
||||
});
|
||||
|
||||
test('should return null', () => {
|
||||
expect(IP.toDatabase('')).toBeNull();
|
||||
expect(IP.toDatabase(new IP('127.0.0.1'))).toBe('127.0.0.1');
|
||||
});
|
||||
|
||||
test('should be an instance IP', () => {
|
||||
|
||||
@@ -3,6 +3,7 @@ import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import Port from '../Port';
|
||||
import Typeof from '../Typeof';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
|
||||
export default class Hostname extends DatabaseProperty {
|
||||
private _route: string = '';
|
||||
@@ -50,6 +51,21 @@ export default class Hostname extends DatabaseProperty {
|
||||
}
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Hostname,
|
||||
value: (this as Hostname).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Hostname {
|
||||
if (json['_type'] === ObjectType.Hostname) {
|
||||
return new Hostname((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
let hostame: string = this.hostname;
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
export default class Route {
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
|
||||
export default class Route extends DatabaseProperty {
|
||||
private _route: string = '';
|
||||
public get route(): string {
|
||||
return this._route;
|
||||
@@ -14,6 +18,7 @@ export default class Route {
|
||||
}
|
||||
|
||||
public constructor(route?: string | Route) {
|
||||
super();
|
||||
if (route && route instanceof Route) {
|
||||
route = route.toString();
|
||||
}
|
||||
@@ -23,6 +28,21 @@ export default class Route {
|
||||
}
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Route,
|
||||
value: (this as Route).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Route {
|
||||
if (json['_type'] === ObjectType.Route) {
|
||||
return new Route((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public addRoute(route: Route | string): Route {
|
||||
if (typeof route === 'string') {
|
||||
route = new Route(route);
|
||||
@@ -36,7 +56,7 @@ export default class Route {
|
||||
return this;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toString(): string {
|
||||
return this.route;
|
||||
}
|
||||
|
||||
@@ -48,4 +68,22 @@ export default class Route {
|
||||
this.route = this.route.replace(paramName, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public static override toDatabase(
|
||||
value: Route | FindOperator<Route>
|
||||
): string | null {
|
||||
if (value) {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static override fromDatabase(_value: string): Route | null {
|
||||
if (_value) {
|
||||
return new Route(_value);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,10 @@ export default class StatusCode {
|
||||
statusCode = parseInt(statusCode as string);
|
||||
}
|
||||
|
||||
if (statusCode >= 100 && statusCode <= 599) {
|
||||
if (
|
||||
(statusCode as number) >= 100 &&
|
||||
(statusCode as number) <= 599
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { FindOperator } from 'typeorm';
|
||||
import Dictionary from '../Dictionary';
|
||||
import Typeof from '../Typeof';
|
||||
import Email from '../Email';
|
||||
import { JSONObject } from '../JSON';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
|
||||
export default class URL extends DatabaseProperty {
|
||||
@@ -182,23 +182,19 @@ export default class URL extends DatabaseProperty {
|
||||
return URL.fromString(this.toString().split('?')[0] || '');
|
||||
}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
value: this.toString(),
|
||||
_type: 'URL',
|
||||
_type: ObjectType.URL,
|
||||
value: (this as URL).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static fromJSON(json: JSONObject): URL {
|
||||
if (json && json['_type'] !== 'URL') {
|
||||
throw new BadDataException('Invalid JSON for URL');
|
||||
public static override fromJSON(json: JSONObject): URL {
|
||||
if (json['_type'] === ObjectType.URL) {
|
||||
return URL.fromString((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
if (json && json['value'] && typeof json['value'] === Typeof.String) {
|
||||
throw new BadDataException('Invalid JSON for URL');
|
||||
}
|
||||
|
||||
return URL.fromString(json['value'] as string);
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public addRoute(route: Route | string): URL {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
|
||||
export interface RGB {
|
||||
red: number;
|
||||
@@ -26,6 +27,21 @@ export default class Color extends DatabaseProperty {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Color,
|
||||
value: (this as Color).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Color {
|
||||
if (json['_type'] === ObjectType.Color) {
|
||||
return new Color((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public static override toDatabase(
|
||||
value: Color | FindOperator<Color>
|
||||
): string | null {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
import Typeof from '../Typeof';
|
||||
|
||||
export default class CompareBase {
|
||||
export default class CompareBase extends SerializableObject {
|
||||
private _value!: number | Date;
|
||||
public get value(): number | Date {
|
||||
return this._value;
|
||||
@@ -11,10 +12,11 @@ export default class CompareBase {
|
||||
}
|
||||
|
||||
public constructor(value: number | Date) {
|
||||
super();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toString(): string {
|
||||
return this.value.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@ import { FindOperator } from 'typeorm';
|
||||
import { ValueTransformer } from 'typeorm/decorator/options/ValueTransformer';
|
||||
import NotImplementedException from '../Exception/NotImplementedException';
|
||||
import { JSONArray, JSONObject } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class DatabaseProperty {
|
||||
public constructor() {}
|
||||
export default class DatabaseProperty extends SerializableObject {
|
||||
public constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected static fromDatabase(
|
||||
_value: string | number | JSONObject | JSONArray
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
export default class EqualToOrNull {
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class EqualToOrNull extends SerializableObject {
|
||||
private _value!: string;
|
||||
public get value(): string {
|
||||
return this._value;
|
||||
@@ -8,10 +12,26 @@ export default class EqualToOrNull {
|
||||
}
|
||||
|
||||
public constructor(value: string) {
|
||||
super();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toString(): string {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.EqualToOrNull,
|
||||
value: (this as EqualToOrNull).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): EqualToOrNull {
|
||||
if (json['_type'] === ObjectType.EqualToOrNull) {
|
||||
return new EqualToOrNull(json['value'] as string);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import CompareBase from './CompareBase';
|
||||
|
||||
export default class GreaterThan extends CompareBase {
|
||||
public constructor(value: number | Date) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.GreaterThan,
|
||||
value: (this as GreaterThan).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): GreaterThan {
|
||||
if (json['_type'] === ObjectType.GreaterThan) {
|
||||
return new GreaterThan(json['value'] as number | Date);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import CompareBase from './CompareBase';
|
||||
|
||||
export default class GreaterThanOrEqual extends CompareBase {
|
||||
public constructor(value: number | Date) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.GreaterThanOrEqual,
|
||||
value: (this as GreaterThanOrEqual).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): GreaterThanOrEqual {
|
||||
if (json['_type'] === ObjectType.GreaterThanOrEqual) {
|
||||
return new GreaterThanOrEqual(json['value'] as number | Date);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import OneUptimeDate from '../Date';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class InBetween {
|
||||
export default class InBetween extends SerializableObject {
|
||||
private _startValue!: number | Date | string;
|
||||
public get startValue(): number | Date | string {
|
||||
return this._startValue;
|
||||
@@ -21,11 +24,31 @@ export default class InBetween {
|
||||
startValue: number | Date | string,
|
||||
endValue: number | Date | string
|
||||
) {
|
||||
super();
|
||||
this.endValue = endValue;
|
||||
this.startValue = startValue;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.InBetween,
|
||||
startValue: (this as InBetween).startValue,
|
||||
endValue: (this as InBetween).endValue,
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): InBetween {
|
||||
if (json['_type'] === ObjectType.InBetween) {
|
||||
return new InBetween(
|
||||
json['startValue'] as number | Date | string,
|
||||
json['endValue'] as number | Date | string
|
||||
);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
let startValue: number | Date | string = this.startValue;
|
||||
let endValue: number | Date | string = this.endValue;
|
||||
|
||||
|
||||
28
Common/Types/Database/IsNull.ts
Normal file
28
Common/Types/Database/IsNull.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class IsNull extends SerializableObject {
|
||||
public constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.IsNull,
|
||||
value: null,
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): IsNull {
|
||||
if (json['_type'] === ObjectType.IsNull) {
|
||||
return new IsNull();
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,24 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import CompareBase from './CompareBase';
|
||||
|
||||
export default class LessThan extends CompareBase {
|
||||
public constructor(value: number | Date) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.LessThan,
|
||||
value: (this as LessThan).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): LessThan {
|
||||
if (json['_type'] === ObjectType.LessThan) {
|
||||
return new LessThan(json['value'] as number | Date);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import CompareBase from './CompareBase';
|
||||
|
||||
export default class LessThanOrEqual extends CompareBase {
|
||||
public constructor(value: number | Date) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.LessThanOrEqual,
|
||||
value: (this as LessThanOrEqual).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): LessThanOrEqual {
|
||||
if (json['_type'] === ObjectType.LessThanOrEqual) {
|
||||
return new LessThanOrEqual(json['value'] as number | Date);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
export default class NotEqual {
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class NotEqual extends SerializableObject {
|
||||
private _value!: string;
|
||||
public get value(): string {
|
||||
return this._value;
|
||||
@@ -8,10 +12,26 @@ export default class NotEqual {
|
||||
}
|
||||
|
||||
public constructor(value: string) {
|
||||
super();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toString(): string {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.NotEqual,
|
||||
value: (this as NotEqual).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): NotEqual {
|
||||
if (json['_type'] === ObjectType.NotEqual) {
|
||||
return new NotEqual(json['value'] as string);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,28 @@
|
||||
export default class NotNull {
|
||||
public constructor() {}
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
public toString(): string {
|
||||
export default class NotNull extends SerializableObject {
|
||||
public constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.NotNull,
|
||||
value: null,
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): NotNull {
|
||||
if (json['_type'] === ObjectType.NotNull) {
|
||||
return new NotNull();
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,39 @@
|
||||
export default class Search {
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class Search extends SerializableObject {
|
||||
private _searchValue!: string;
|
||||
|
||||
public get value(): string {
|
||||
return this._searchValue;
|
||||
}
|
||||
|
||||
public set value(v: string) {
|
||||
this._searchValue = v;
|
||||
}
|
||||
|
||||
public constructor(value: string) {
|
||||
super();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toString(): string {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Search,
|
||||
value: (this as Search).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Search {
|
||||
if (json['_type'] === ObjectType.Search) {
|
||||
return new Search((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
import { JSONObject } from './JSON';
|
||||
import PositiveNumber from './PositiveNumber';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
@@ -264,6 +266,15 @@ export default class OneUptimeDate {
|
||||
return b.diff(a, 'days');
|
||||
}
|
||||
|
||||
public static getNumberOfMinutesBetweenDates(
|
||||
startDate: Date,
|
||||
endDate: Date
|
||||
): number {
|
||||
const a: moment.Moment = moment(startDate);
|
||||
const b: moment.Moment = moment(endDate);
|
||||
return b.diff(a, 'minutes');
|
||||
}
|
||||
|
||||
public static getNumberOfDaysBetweenDatesInclusive(
|
||||
startDate: Date,
|
||||
endDate: Date
|
||||
@@ -363,8 +374,16 @@ export default class OneUptimeDate {
|
||||
return moment(date).isAfter(new Date());
|
||||
}
|
||||
|
||||
public static fromString(date: string): Date {
|
||||
return moment(date).toDate();
|
||||
public static fromString(date: string | JSONObject): Date {
|
||||
if (typeof date === 'string') {
|
||||
return moment(date).toDate();
|
||||
}
|
||||
|
||||
if (date && date['value'] && typeof date['value'] === 'string') {
|
||||
return moment(date['value']).toDate();
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid date');
|
||||
}
|
||||
|
||||
public static asDateForDatabaseQuery(date: string | Date): string {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { FindOperator } from 'typeorm/find-options/FindOperator';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
|
||||
export default class Domain extends DatabaseProperty {
|
||||
private _domain: string = '';
|
||||
@@ -64,6 +65,21 @@ export default class Domain extends DatabaseProperty {
|
||||
return null;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Domain,
|
||||
value: (this as Domain).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Domain {
|
||||
if (json['_type'] === ObjectType.Domain) {
|
||||
return new Domain((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
protected static override fromDatabase(_value: string): Domain | null {
|
||||
if (_value) {
|
||||
return new Domain(_value);
|
||||
|
||||
@@ -2,6 +2,7 @@ import { FindOperator } from 'typeorm';
|
||||
import Hostname from './API/Hostname';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
|
||||
const nonBusinessEmailDomains: Array<string> = [
|
||||
'gmail',
|
||||
@@ -55,6 +56,21 @@ export default class Email extends DatabaseProperty {
|
||||
return true;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Email,
|
||||
value: (this as Email).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Email {
|
||||
if (json['_type'] === ObjectType.Email) {
|
||||
return new Email((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
return this.email;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import BadOperationException from './Exception/BadOperationException';
|
||||
import ObjectID from './ObjectID';
|
||||
import CryptoJS from 'crypto-js';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
|
||||
export default class HashedString extends DatabaseProperty {
|
||||
private isHashed: boolean = false;
|
||||
@@ -22,6 +24,21 @@ export default class HashedString extends DatabaseProperty {
|
||||
this.isHashed = isValueHashed;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.HashedString,
|
||||
value: (this as HashedString).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): HashedString {
|
||||
if (json['_type'] === ObjectType.HashedString) {
|
||||
return new HashedString((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject } from '../JSON';
|
||||
@@ -28,6 +29,17 @@ export default class IP extends DatabaseProperty {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public static fromString(ip: string): IP {
|
||||
return new IP(ip);
|
||||
}
|
||||
|
||||
public static isIP(ip: string): boolean {
|
||||
if (IP.isIPv4(ip) || IP.isIPv6(ip)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
return this.ip;
|
||||
}
|
||||
@@ -60,7 +72,7 @@ export default class IP extends DatabaseProperty {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static fromJSON(json: JSONObject): IP {
|
||||
public static override fromJSON(json: JSONObject): IP {
|
||||
if (json && json['_type'] !== 'IP') {
|
||||
throw new BadDataException('Invalid JSON for IP');
|
||||
}
|
||||
@@ -72,17 +84,20 @@ export default class IP extends DatabaseProperty {
|
||||
return new IP(json['value'] as string);
|
||||
}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
value: this.toString(),
|
||||
_type: 'IP',
|
||||
};
|
||||
}
|
||||
|
||||
public static override toDatabase(_value: string): string | null {
|
||||
public static override toDatabase(
|
||||
_value: IP | FindOperator<IP>
|
||||
): string | null {
|
||||
if (_value) {
|
||||
return _value.toString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,11 @@ enum IconProp {
|
||||
User = 'User',
|
||||
Disc = 'Disc',
|
||||
Settings = 'Settings',
|
||||
Criteria = 'Criteria',
|
||||
Notification = 'Notification',
|
||||
Help = 'Help',
|
||||
JSON = 'JSON',
|
||||
Signal = 'Soignal',
|
||||
Database = 'Database',
|
||||
ChevronDown = 'ChevronDown',
|
||||
ChevronRight = 'ChevronRight',
|
||||
|
||||
@@ -21,11 +21,16 @@ import NotNull from './Database/NotNull';
|
||||
import { BaseEntity } from 'typeorm';
|
||||
import EqualToOrNull from './Database/EqualToOrNull';
|
||||
import NotEqual from './Database/NotEqual';
|
||||
import { CheckOn, FilterType } from './Monitor/CriteriaFilter';
|
||||
|
||||
export enum ObjectType {
|
||||
ObjectID = 'ObjectID',
|
||||
Name = 'Name',
|
||||
EqualToOrNull = 'EqualToOrNull',
|
||||
MonitorSteps = 'MonitorSteps',
|
||||
MonitorStep = 'MonitorStep',
|
||||
MonitorCriteria = 'MonitorCriteria',
|
||||
MonitorCriteriaInstance = 'MonitorCriteriaInstance',
|
||||
NotEqual = 'NotEqual',
|
||||
Email = 'Email',
|
||||
Phone = 'Phone',
|
||||
@@ -83,6 +88,10 @@ export type JSONValue =
|
||||
| Buffer
|
||||
| Permission
|
||||
| Array<Permission>
|
||||
| CheckOn
|
||||
| Array<CheckOn>
|
||||
| FilterType
|
||||
| Array<FilterType>
|
||||
| Search
|
||||
| Domain
|
||||
| Array<Domain>
|
||||
|
||||
@@ -1,32 +1,13 @@
|
||||
import ObjectID from './ObjectID';
|
||||
import Version from './Version';
|
||||
import Email from './Email';
|
||||
import Phone from './Phone';
|
||||
import Color from './Color';
|
||||
import Route from './API/Route';
|
||||
import URL from './API/URL';
|
||||
import Name from './Name';
|
||||
import Search from './Database/Search';
|
||||
import Typeof from './Typeof';
|
||||
import Port from './Port';
|
||||
import Hostname from './API/Hostname';
|
||||
import HashedString from './HashedString';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import OneUptimeDate from './Date';
|
||||
import BaseModel from '../Models/BaseModel';
|
||||
import GreaterThan from './Database/GreaterThan';
|
||||
import JSON5 from 'json5';
|
||||
import GreaterThanOrEqual from './Database/GreaterThanOrEqual';
|
||||
import LessThan from './Database/LessThan';
|
||||
import LessThanOrEqual from './Database/LessThanOrEqual';
|
||||
import InBetween from './Database/InBetween';
|
||||
import Domain from './Domain';
|
||||
import NotNull from './Database/NotNull';
|
||||
import { JSONArray, JSONObject, JSONValue, ObjectType } from './JSON';
|
||||
import { TableColumnMetadata } from '../Types/Database/TableColumn';
|
||||
import TableColumnType from '../Types/Database/TableColumnType';
|
||||
import EqualToOrNull from './Database/EqualToOrNull';
|
||||
import NotEqual from './Database/NotEqual';
|
||||
import SerializableObject from './SerializableObject';
|
||||
import SerializableObjectDictionary from './SerializableObjectDictionary';
|
||||
import JSON5 from 'json5';
|
||||
|
||||
export default class JSONFunctions {
|
||||
public static toJSON(
|
||||
@@ -271,112 +252,8 @@ export default class JSONFunctions {
|
||||
_type: ObjectType.Buffer,
|
||||
value: val as Uint8Array,
|
||||
};
|
||||
} else if (val && val instanceof Name) {
|
||||
return {
|
||||
_type: ObjectType.Name,
|
||||
value: (val as Name).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Domain) {
|
||||
return {
|
||||
_type: ObjectType.Domain,
|
||||
value: (val as Domain).toString(),
|
||||
};
|
||||
} else if (val && val instanceof ObjectID) {
|
||||
return {
|
||||
_type: ObjectType.ObjectID,
|
||||
value: (val as ObjectID).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Phone) {
|
||||
return {
|
||||
_type: ObjectType.Phone,
|
||||
value: (val as Phone).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Email) {
|
||||
return {
|
||||
_type: ObjectType.Email,
|
||||
value: (val as Email).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Port) {
|
||||
return {
|
||||
_type: ObjectType.Port,
|
||||
value: (val as Port).toString(),
|
||||
};
|
||||
} else if (val && val instanceof HashedString) {
|
||||
return {
|
||||
_type: ObjectType.HashedString,
|
||||
value: (val as HashedString).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Hostname) {
|
||||
return {
|
||||
_type: ObjectType.Hostname,
|
||||
value: (val as Hostname).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Version) {
|
||||
return {
|
||||
_type: ObjectType.Version,
|
||||
value: (val as Version).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Route) {
|
||||
return {
|
||||
_type: ObjectType.Route,
|
||||
value: (val as Route).toString(),
|
||||
};
|
||||
} else if (val && val instanceof URL) {
|
||||
return {
|
||||
_type: ObjectType.URL,
|
||||
value: (val as URL).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Color) {
|
||||
return {
|
||||
_type: ObjectType.Color,
|
||||
value: (val as Color).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Search) {
|
||||
return {
|
||||
_type: ObjectType.Search,
|
||||
value: (val as Search).toString(),
|
||||
};
|
||||
} else if (val && val instanceof LessThan) {
|
||||
return {
|
||||
_type: ObjectType.LessThan,
|
||||
value: (val as LessThan).value,
|
||||
};
|
||||
} else if (val && val instanceof InBetween) {
|
||||
return {
|
||||
_type: ObjectType.InBetween,
|
||||
startValue: (val as InBetween).startValue,
|
||||
endValue: (val as InBetween).endValue,
|
||||
};
|
||||
} else if (val && val instanceof NotNull) {
|
||||
return {
|
||||
_type: ObjectType.NotNull,
|
||||
value: null,
|
||||
};
|
||||
} else if (val && val instanceof GreaterThan) {
|
||||
return {
|
||||
_type: ObjectType.GreaterThan,
|
||||
value: (val as GreaterThan).value,
|
||||
};
|
||||
} else if (val && val instanceof EqualToOrNull) {
|
||||
return {
|
||||
_type: ObjectType.EqualToOrNull,
|
||||
value: (val as EqualToOrNull).value.toString(),
|
||||
};
|
||||
} else if (val && val instanceof NotEqual) {
|
||||
return {
|
||||
_type: ObjectType.NotEqual,
|
||||
value: (val as NotEqual).value.toString(),
|
||||
};
|
||||
} else if (val && val instanceof LessThanOrEqual) {
|
||||
return {
|
||||
_type: ObjectType.LessThanOrEqual,
|
||||
value: (val as LessThanOrEqual).value,
|
||||
};
|
||||
} else if (val && val instanceof GreaterThanOrEqual) {
|
||||
return {
|
||||
_type: ObjectType.GreaterThanOrEqual,
|
||||
value: (val as GreaterThanOrEqual).value,
|
||||
};
|
||||
} else if (val && val instanceof SerializableObject) {
|
||||
return val.toJSON();
|
||||
} else if (val && val instanceof Date) {
|
||||
return {
|
||||
_type: ObjectType.DateTime,
|
||||
@@ -431,226 +308,11 @@ export default class JSONFunctions {
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Name
|
||||
SerializableObjectDictionary[(val as JSONObject)['_type'] as string]
|
||||
) {
|
||||
return new Name((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Domain
|
||||
) {
|
||||
return new Domain((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) ===
|
||||
ObjectType.EqualToOrNull
|
||||
) {
|
||||
return new EqualToOrNull((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.NotEqual
|
||||
) {
|
||||
return new NotEqual((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.ObjectID
|
||||
) {
|
||||
return new ObjectID((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Phone
|
||||
) {
|
||||
return new Phone((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Email
|
||||
) {
|
||||
return new Email((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Version
|
||||
) {
|
||||
return new Name((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Route
|
||||
) {
|
||||
return new Route((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.URL
|
||||
) {
|
||||
return URL.fromString((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Port
|
||||
) {
|
||||
return new Port((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Hostname
|
||||
) {
|
||||
return new Hostname((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.HashedString
|
||||
) {
|
||||
return new HashedString((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.DateTime
|
||||
) {
|
||||
return OneUptimeDate.fromString(
|
||||
(val as JSONObject)['value'] as string
|
||||
);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Color
|
||||
) {
|
||||
return new Color((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Search
|
||||
) {
|
||||
return new Search((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
(typeof (val as JSONObject)['value'] === Typeof.Number ||
|
||||
(val as JSONObject)['value'] instanceof Date) &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.LessThan
|
||||
) {
|
||||
return new LessThan((val as JSONObject)['value'] as number | Date);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
(typeof (val as JSONObject)['value'] === Typeof.Number ||
|
||||
(val as JSONObject)['value'] instanceof Date ||
|
||||
typeof (val as JSONObject)['value'] === Typeof.String) &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.GreaterThan
|
||||
) {
|
||||
return new GreaterThan(
|
||||
(val as JSONObject)['value'] as number | Date
|
||||
);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
(typeof (val as JSONObject)['value'] === Typeof.Number ||
|
||||
(val as JSONObject)['value'] instanceof Date ||
|
||||
typeof (val as JSONObject)['value'] === Typeof.String) &&
|
||||
((val as JSONObject)['_type'] as string) ===
|
||||
ObjectType.LessThanOrEqual
|
||||
) {
|
||||
return new LessThanOrEqual(
|
||||
(val as JSONObject)['value'] as number | Date
|
||||
);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] === null &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.NotNull
|
||||
) {
|
||||
return new NotNull();
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
(typeof (val as JSONObject)['value'] === Typeof.Number ||
|
||||
(val as JSONObject)['value'] instanceof Date ||
|
||||
typeof (val as JSONObject)['value'] === Typeof.String) &&
|
||||
((val as JSONObject)['_type'] as string) ===
|
||||
ObjectType.GreaterThanOrEqual
|
||||
) {
|
||||
return new GreaterThanOrEqual(
|
||||
(val as JSONObject)['value'] as number | Date
|
||||
);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['startValue'] &&
|
||||
(typeof (val as JSONObject)['startValue'] === Typeof.Number ||
|
||||
typeof (val as JSONObject)['endValue'] === Typeof.String ||
|
||||
(val as JSONObject)['startValue'] instanceof Date) &&
|
||||
(val as JSONObject)['endValue'] &&
|
||||
(typeof (val as JSONObject)['endValue'] === Typeof.Number ||
|
||||
typeof (val as JSONObject)['endValue'] === Typeof.String ||
|
||||
(val as JSONObject)['endValue'] instanceof Date) &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.InBetween
|
||||
) {
|
||||
return new InBetween(
|
||||
(val as JSONObject)['startValue'] as number | Date,
|
||||
(val as JSONObject)['endValue'] as number | Date
|
||||
);
|
||||
return SerializableObjectDictionary[
|
||||
(val as JSONObject)['_type'] as string
|
||||
].fromJSON(val);
|
||||
} else if (val instanceof Date) {
|
||||
return val;
|
||||
} else if (typeof val === Typeof.Object) {
|
||||
|
||||
36
Common/Types/Monitor/CriteriaFilter.ts
Normal file
36
Common/Types/Monitor/CriteriaFilter.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
export enum CheckOn {
|
||||
ResponseTime = 'Response Time (in ms)',
|
||||
ResponseStatusCode = 'Response Staus Code',
|
||||
ResponseHeader = 'Response Header',
|
||||
ResponseHeaderValue = 'Response Header Value',
|
||||
ResponseBody = 'Response Body',
|
||||
IsOnline = 'Is Online',
|
||||
}
|
||||
|
||||
export interface CriteriaFilter {
|
||||
checkOn: CheckOn;
|
||||
filterType: FilterType | undefined;
|
||||
value: string | number | undefined;
|
||||
}
|
||||
|
||||
export enum FilterType {
|
||||
EqualTo = 'Equal To',
|
||||
NotEqualTo = 'Not Equal To',
|
||||
GreaterThan = 'Greater Than',
|
||||
LessThan = 'Less Than',
|
||||
GreaterThanOrEqualTo = 'Greater Than Or Equal To',
|
||||
LessThanOrEqualTo = 'Less Than Or Equal To',
|
||||
Contains = 'Contains',
|
||||
NotContains = 'Not Contains',
|
||||
StartsWith = 'Starts With',
|
||||
EndsWith = 'Ends With',
|
||||
IsEmpty = 'Is Empty',
|
||||
IsNotEmpty = 'Is Not Empty',
|
||||
True = 'True',
|
||||
False = 'False',
|
||||
}
|
||||
|
||||
export enum FilterCondition {
|
||||
All = 'All',
|
||||
Any = 'Any',
|
||||
}
|
||||
7
Common/Types/Monitor/CriteriaIncident.ts
Normal file
7
Common/Types/Monitor/CriteriaIncident.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import ObjectID from '../ObjectID';
|
||||
|
||||
export interface CriteriaIncident {
|
||||
title: string;
|
||||
description: string;
|
||||
incidentSeverityId?: ObjectID | undefined;
|
||||
}
|
||||
@@ -1,33 +1,104 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import { JSONArray, JSONObject } from '../JSON';
|
||||
import { JSONArray, JSONObject, ObjectType } from '../JSON';
|
||||
import MonitorCriteriaInstance from './MonitorCriteriaInstance';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import MonitorType from './MonitorType';
|
||||
import ObjectID from '../ObjectID';
|
||||
|
||||
export interface MonitorCriteriaType {
|
||||
monitorCriteriaInstanceArray: Array<MonitorCriteriaInstance>;
|
||||
}
|
||||
|
||||
export default class MonitorCriteria extends DatabaseProperty {
|
||||
public monitorCriteria: MonitorCriteriaType | undefined = undefined;
|
||||
public data: MonitorCriteriaType | undefined = undefined;
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
this.data = {
|
||||
monitorCriteriaInstanceArray: [new MonitorCriteriaInstance()],
|
||||
};
|
||||
}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
if (!this.monitorCriteria) {
|
||||
return {
|
||||
_type: 'MonitorCriteria',
|
||||
value: {},
|
||||
};
|
||||
public static getDefaultMonitorCriteria(arg: {
|
||||
monitorType: MonitorType;
|
||||
onlineMonitorStatusId: ObjectID;
|
||||
offlineMonitorStatusId: ObjectID;
|
||||
defaultIncidentSeverityId: ObjectID;
|
||||
}): MonitorCriteria {
|
||||
const monitorCriteria: MonitorCriteria = new MonitorCriteria();
|
||||
|
||||
monitorCriteria.data = {
|
||||
monitorCriteriaInstanceArray: [
|
||||
MonitorCriteriaInstance.getDefaultOnlineMonitorCriteriaInstance(
|
||||
{
|
||||
monitorType: arg.monitorType,
|
||||
monitorStatusId: arg.onlineMonitorStatusId,
|
||||
}
|
||||
),
|
||||
MonitorCriteriaInstance.getDefaultOfflineMonitorCriteriaInstance(
|
||||
{
|
||||
monitorType: arg.monitorType,
|
||||
monitorStatusId: arg.offlineMonitorStatusId,
|
||||
incidentSeverityId: arg.defaultIncidentSeverityId,
|
||||
}
|
||||
),
|
||||
],
|
||||
};
|
||||
|
||||
return monitorCriteria;
|
||||
}
|
||||
|
||||
public static getValidationError(
|
||||
value: MonitorCriteria,
|
||||
monitorType: MonitorType
|
||||
): string | null {
|
||||
if (!value.data) {
|
||||
return 'Monitor Criteria is required';
|
||||
}
|
||||
|
||||
if (value.data.monitorCriteriaInstanceArray.length === 0) {
|
||||
return 'Monitor Criteria is required';
|
||||
}
|
||||
|
||||
for (const criteria of value.data.monitorCriteriaInstanceArray) {
|
||||
if (
|
||||
MonitorCriteriaInstance.getValidationError(
|
||||
criteria,
|
||||
monitorType
|
||||
)
|
||||
) {
|
||||
return MonitorCriteriaInstance.getValidationError(
|
||||
criteria,
|
||||
monitorType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static getNewMonitorCriteriaAsJSON(): JSONObject {
|
||||
return {
|
||||
_type: 'MonitorCriteria',
|
||||
value: {
|
||||
monitorCriteriaInstanceArray: [
|
||||
new MonitorCriteriaInstance().toJSON(),
|
||||
],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
if (!this.data) {
|
||||
return MonitorCriteria.getNewMonitorCriteriaAsJSON();
|
||||
}
|
||||
|
||||
return {
|
||||
_type: ObjectType.MonitorCriteria,
|
||||
value: {
|
||||
monitorCriteriaInstanceArray:
|
||||
this.monitorCriteria.monitorCriteriaInstanceArray.map(
|
||||
this.data.monitorCriteriaInstanceArray.map(
|
||||
(criteria: MonitorCriteriaInstance) => {
|
||||
return criteria.toJSON();
|
||||
}
|
||||
@@ -36,8 +107,12 @@ export default class MonitorCriteria extends DatabaseProperty {
|
||||
};
|
||||
}
|
||||
|
||||
public fromJSON(json: JSONObject): MonitorCriteria {
|
||||
if (!json || json['_type'] !== 'MonitorCriteria') {
|
||||
public static override fromJSON(json: JSONObject): MonitorCriteria {
|
||||
if (json instanceof MonitorCriteria) {
|
||||
return json;
|
||||
}
|
||||
|
||||
if (!json || json['_type'] !== ObjectType.MonitorCriteria) {
|
||||
throw new BadDataException('Invalid monitor criteria');
|
||||
}
|
||||
|
||||
@@ -57,15 +132,17 @@ export default class MonitorCriteria extends DatabaseProperty {
|
||||
json['value'] as JSONObject
|
||||
)['monitorCriteriaInstanceArray'] as JSONArray;
|
||||
|
||||
this.monitorCriteria = {
|
||||
const monitorCriteria: MonitorCriteria = new MonitorCriteria();
|
||||
|
||||
monitorCriteria.data = {
|
||||
monitorCriteriaInstanceArray: monitorCriteriaInstanceArray.map(
|
||||
(json: JSONObject) => {
|
||||
return new MonitorCriteriaInstance().fromJSON(json);
|
||||
return MonitorCriteriaInstance.fromJSON(json);
|
||||
}
|
||||
),
|
||||
};
|
||||
|
||||
return this;
|
||||
return monitorCriteria;
|
||||
}
|
||||
|
||||
public static isValid(_json: JSONObject): boolean {
|
||||
@@ -86,7 +163,7 @@ export default class MonitorCriteria extends DatabaseProperty {
|
||||
value: JSONObject
|
||||
): MonitorCriteria | null {
|
||||
if (value) {
|
||||
return new MonitorCriteria().fromJSON(value);
|
||||
return MonitorCriteria.fromJSON(value);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -1,73 +1,428 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import { JSONObject } from '../JSON';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import ObjectID from '../ObjectID';
|
||||
|
||||
export enum CheckOn {
|
||||
ResponseTime = 'Response Time',
|
||||
ResponseCode = 'Response Code',
|
||||
ResponseHeader = 'Response Header',
|
||||
ResponseBody = 'Response Body',
|
||||
IsOnline = 'Is Online',
|
||||
}
|
||||
|
||||
export interface CriteriaFilter {
|
||||
checkOn: CheckOn;
|
||||
filterType: FilterType;
|
||||
value: string | number;
|
||||
}
|
||||
|
||||
export interface CriteriaIncident {
|
||||
title: string;
|
||||
description: string;
|
||||
incidentSeverityId: ObjectID;
|
||||
}
|
||||
|
||||
export enum FilterType {
|
||||
EqualTo = 'Equal To',
|
||||
NotEqualTo = 'Not Equal To',
|
||||
GreaterThan = 'Greater Than',
|
||||
LessThan = 'Less Than',
|
||||
GreaterThanOrEqualTo = 'Greater Than Or Equal To',
|
||||
LessThanOrEqualTo = 'Less Than Or Equal To',
|
||||
Contains = 'Contains',
|
||||
NotContains = 'Not Contains',
|
||||
StartsWith = 'Starts With',
|
||||
EndsWith = 'Ends With',
|
||||
IsEmpty = 'Is Empty',
|
||||
IsNotEmpty = 'Is Not Empty',
|
||||
}
|
||||
|
||||
export enum FilterCondtion {
|
||||
All = 'All',
|
||||
Any = 'Any',
|
||||
}
|
||||
import { CriteriaIncident } from './CriteriaIncident';
|
||||
import {
|
||||
CheckOn,
|
||||
CriteriaFilter,
|
||||
FilterCondition,
|
||||
FilterType,
|
||||
} from './CriteriaFilter';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import MonitorType from './MonitorType';
|
||||
import Typeof from '../Typeof';
|
||||
|
||||
export interface MonitorCriteriaInstanceType {
|
||||
monitorStateId: ObjectID;
|
||||
filter: {
|
||||
filterCondition: FilterCondtion;
|
||||
filters: Array<CriteriaFilter>;
|
||||
};
|
||||
createIncidents: Array<CriteriaIncident>;
|
||||
monitorStatusId: ObjectID | undefined;
|
||||
filterCondition: FilterCondition;
|
||||
filters: Array<CriteriaFilter>;
|
||||
incidents: Array<CriteriaIncident>;
|
||||
name: string;
|
||||
description: string;
|
||||
changeMonitorStatus?: boolean | undefined;
|
||||
createIncidents?: boolean | undefined;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export default class MonitorCriteriaInstance extends DatabaseProperty {
|
||||
public monitorCriteriaInstance: JSONObject = {};
|
||||
public data: MonitorCriteriaInstanceType | undefined = undefined;
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
this.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorStatusId: undefined,
|
||||
filterCondition: FilterCondition.All,
|
||||
filters: [
|
||||
{
|
||||
checkOn: CheckOn.IsOnline,
|
||||
filterType: undefined,
|
||||
value: undefined,
|
||||
},
|
||||
],
|
||||
createIncidents: false,
|
||||
changeMonitorStatus: false,
|
||||
incidents: [],
|
||||
name: '',
|
||||
description: '',
|
||||
};
|
||||
}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
return this.monitorCriteriaInstance;
|
||||
public static getDefaultOnlineMonitorCriteriaInstance(arg: {
|
||||
monitorType: MonitorType;
|
||||
monitorStatusId: ObjectID;
|
||||
}): MonitorCriteriaInstance {
|
||||
const monitorCriteriaInstance: MonitorCriteriaInstance =
|
||||
new MonitorCriteriaInstance();
|
||||
|
||||
monitorCriteriaInstance.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorStatusId: arg.monitorStatusId,
|
||||
filterCondition: FilterCondition.All,
|
||||
filters: [
|
||||
{
|
||||
checkOn: CheckOn.IsOnline,
|
||||
filterType: FilterType.True,
|
||||
value: undefined,
|
||||
},
|
||||
],
|
||||
incidents: [],
|
||||
changeMonitorStatus: true,
|
||||
createIncidents: false,
|
||||
name: 'Check if online',
|
||||
description: 'This criteria cheks if the monitor is online',
|
||||
};
|
||||
|
||||
return monitorCriteriaInstance;
|
||||
}
|
||||
|
||||
public fromJSON(json: JSONObject): MonitorCriteriaInstance {
|
||||
this.monitorCriteriaInstance = json;
|
||||
public static getDefaultOfflineMonitorCriteriaInstance(arg: {
|
||||
monitorType: MonitorType;
|
||||
monitorStatusId: ObjectID;
|
||||
incidentSeverityId: ObjectID;
|
||||
}): MonitorCriteriaInstance {
|
||||
const monitorCriteriaInstance: MonitorCriteriaInstance =
|
||||
new MonitorCriteriaInstance();
|
||||
|
||||
if (
|
||||
arg.monitorType === MonitorType.Ping ||
|
||||
arg.monitorType === MonitorType.IP
|
||||
) {
|
||||
monitorCriteriaInstance.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorStatusId: arg.monitorStatusId,
|
||||
filterCondition: FilterCondition.All,
|
||||
filters: [
|
||||
{
|
||||
checkOn: CheckOn.IsOnline,
|
||||
filterType: FilterType.False,
|
||||
value: undefined,
|
||||
},
|
||||
],
|
||||
incidents: [
|
||||
{
|
||||
title: `${arg.monitorType} monitor is offline`,
|
||||
description: `${arg.monitorType} monitor is currently offline.`,
|
||||
incidentSeverityId: arg.incidentSeverityId,
|
||||
},
|
||||
],
|
||||
changeMonitorStatus: true,
|
||||
createIncidents: true,
|
||||
name: 'Check if offline',
|
||||
description: 'This criteria cheks if the monitor is offline',
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
arg.monitorType === MonitorType.API ||
|
||||
arg.monitorType === MonitorType.Website
|
||||
) {
|
||||
monitorCriteriaInstance.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorStatusId: arg.monitorStatusId,
|
||||
filterCondition: FilterCondition.Any,
|
||||
filters: [
|
||||
{
|
||||
checkOn: CheckOn.IsOnline,
|
||||
filterType: FilterType.False,
|
||||
value: undefined,
|
||||
},
|
||||
{
|
||||
checkOn: CheckOn.ResponseStatusCode,
|
||||
filterType: FilterType.NotEqualTo,
|
||||
value: 200,
|
||||
},
|
||||
],
|
||||
incidents: [
|
||||
{
|
||||
title: `${arg.monitorType} monitor is offline`,
|
||||
description: `${arg.monitorType} monitor is currently offline.`,
|
||||
incidentSeverityId: arg.incidentSeverityId,
|
||||
},
|
||||
],
|
||||
changeMonitorStatus: true,
|
||||
createIncidents: true,
|
||||
name: 'Check if offline',
|
||||
description: 'This criteria cheks if the monitor is offline',
|
||||
};
|
||||
}
|
||||
|
||||
return monitorCriteriaInstance;
|
||||
}
|
||||
|
||||
public static getNewMonitorCriteriaInstanceAsJSON(): JSONObject {
|
||||
return {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorStatusId: undefined,
|
||||
filterCondition: FilterCondition.All,
|
||||
filters: [
|
||||
{
|
||||
checkOn: CheckOn.IsOnline,
|
||||
filterType: FilterType.True,
|
||||
value: undefined,
|
||||
},
|
||||
],
|
||||
incidents: [],
|
||||
name: '',
|
||||
description: '',
|
||||
createIncidents: false,
|
||||
changeMonitorStatus: false,
|
||||
};
|
||||
}
|
||||
|
||||
public static getValidationError(
|
||||
value: MonitorCriteriaInstance,
|
||||
monitorType: MonitorType
|
||||
): string | null {
|
||||
if (!value.data) {
|
||||
return 'Monitor Step is required';
|
||||
}
|
||||
|
||||
if (value.data.filters.length === 0) {
|
||||
return 'Monitor Criteria filter is required';
|
||||
}
|
||||
|
||||
if (!value.data.name) {
|
||||
return 'Monitor Criteria name is required';
|
||||
}
|
||||
|
||||
if (!value.data.description) {
|
||||
return 'Monitor Criteria description is required';
|
||||
}
|
||||
|
||||
for (const incident of value.data.incidents) {
|
||||
if (!incident) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!incident.title) {
|
||||
return 'Monitor Criteria incident title is required';
|
||||
}
|
||||
|
||||
if (!incident.description) {
|
||||
return 'Monitor Criteria incident description is required';
|
||||
}
|
||||
|
||||
if (!incident.incidentSeverityId) {
|
||||
return 'Monitor Criteria incident severity is required';
|
||||
}
|
||||
}
|
||||
|
||||
for (const filter of value.data.filters) {
|
||||
if (!filter.checkOn) {
|
||||
return 'Monitor Criteria filter check on is required';
|
||||
}
|
||||
|
||||
if (
|
||||
monitorType === MonitorType.Ping &&
|
||||
filter.checkOn !== CheckOn.IsOnline &&
|
||||
filter.checkOn !== CheckOn.ResponseTime
|
||||
) {
|
||||
return (
|
||||
'Ping Monitor cannot have filter criteria: ' +
|
||||
filter.checkOn
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public setName(name: string): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.name = name;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setDescription(description: string): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.description = description;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public static clone(
|
||||
monitorCriteriaInstance: MonitorCriteriaInstance
|
||||
): MonitorCriteriaInstance {
|
||||
return MonitorCriteriaInstance.fromJSON(
|
||||
monitorCriteriaInstance.toJSON()
|
||||
);
|
||||
}
|
||||
|
||||
public setMonitorStatusId(
|
||||
monitorStatusId: ObjectID | undefined
|
||||
): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.monitorStatusId = monitorStatusId;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setFilterCondition(
|
||||
filterCondition: FilterCondition
|
||||
): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.filterCondition = filterCondition;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setFilters(filters: Array<CriteriaFilter>): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.filters = filters;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setIncidents(
|
||||
incidents: Array<CriteriaIncident>
|
||||
): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.incidents = [...incidents];
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setChangeMonitorStatus(
|
||||
changeMonitorStatus: boolean | undefined
|
||||
): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.changeMonitorStatus = changeMonitorStatus;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setCreateIncidents(
|
||||
createIncidents: boolean | undefined
|
||||
): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.createIncidents = createIncidents;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
if (!this.data) {
|
||||
return MonitorCriteriaInstance.getNewMonitorCriteriaInstanceAsJSON();
|
||||
}
|
||||
|
||||
return {
|
||||
_type: ObjectType.MonitorCriteriaInstance,
|
||||
value: {
|
||||
id: this.data.id,
|
||||
monitorStatusId: this.data.monitorStatusId?.toString(),
|
||||
filterCondition: this.data.filterCondition,
|
||||
filters: this.data.filters,
|
||||
incidents: this.data.incidents,
|
||||
name: this.data.name,
|
||||
description: this.data.description,
|
||||
} as any,
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): MonitorCriteriaInstance {
|
||||
if (json instanceof MonitorCriteriaInstance) {
|
||||
return json;
|
||||
}
|
||||
|
||||
if (!json) {
|
||||
throw new BadDataException('json is null');
|
||||
}
|
||||
|
||||
if (!json['_type']) {
|
||||
throw new BadDataException('json._type is null');
|
||||
}
|
||||
|
||||
if (json['_type'] !== ObjectType.MonitorCriteriaInstance) {
|
||||
throw new BadDataException(
|
||||
'json._type should be MonitorCriteriaInstance'
|
||||
);
|
||||
}
|
||||
|
||||
if (!json['value']) {
|
||||
throw new BadDataException('json.value is null');
|
||||
}
|
||||
|
||||
json = json['value'] as JSONObject;
|
||||
|
||||
if (!json['filterCondition']) {
|
||||
throw new BadDataException('json.filterCondition is null');
|
||||
}
|
||||
|
||||
if (!json['filters']) {
|
||||
throw new BadDataException('json.filters is null');
|
||||
}
|
||||
|
||||
if (!Array.isArray(json['filters'])) {
|
||||
throw new BadDataException('json.filters should be an array');
|
||||
}
|
||||
|
||||
if (!json['incidents']) {
|
||||
throw new BadDataException('json.incidents is null');
|
||||
}
|
||||
|
||||
if (!Array.isArray(json['incidents'])) {
|
||||
throw new BadDataException('json.incidents should be an array');
|
||||
}
|
||||
|
||||
let monitorStatusId: ObjectID | undefined = undefined;
|
||||
|
||||
if (
|
||||
json['monitorStatusId'] &&
|
||||
typeof json['monitorStatusId'] === Typeof.String
|
||||
) {
|
||||
monitorStatusId = new ObjectID(json['monitorStatusId'] as string);
|
||||
} else if (
|
||||
json['monitorStatusId'] &&
|
||||
(json['monitorStatusId'] as JSONObject)['value'] !== null
|
||||
) {
|
||||
monitorStatusId = new ObjectID(
|
||||
(json['monitorStatusId'] as JSONObject)['value'] as string
|
||||
);
|
||||
}
|
||||
|
||||
const filterCondition: FilterCondition = json[
|
||||
'filterCondition'
|
||||
] as FilterCondition;
|
||||
|
||||
const filters: Array<CriteriaFilter> = [];
|
||||
|
||||
const incidents: Array<CriteriaIncident> = [];
|
||||
|
||||
for (const filter of json['filters']) {
|
||||
filters.push({ ...(filter as any) });
|
||||
}
|
||||
|
||||
for (const incident of json['incidents']) {
|
||||
incidents.push({ ...(incident as any) });
|
||||
}
|
||||
|
||||
const monitorCriteriaInstance: MonitorCriteriaInstance =
|
||||
new MonitorCriteriaInstance();
|
||||
|
||||
monitorCriteriaInstance.data = {
|
||||
id: (json['id'] as string) || ObjectID.generate().toString(),
|
||||
monitorStatusId,
|
||||
filterCondition,
|
||||
filters,
|
||||
incidents,
|
||||
name: (json['name'] as string) || '',
|
||||
description: (json['description'] as string) || '',
|
||||
};
|
||||
|
||||
return monitorCriteriaInstance;
|
||||
}
|
||||
|
||||
public static isValid(_json: JSONObject): boolean {
|
||||
return true;
|
||||
}
|
||||
@@ -86,7 +441,7 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
|
||||
value: JSONObject
|
||||
): MonitorCriteriaInstance | null {
|
||||
if (value) {
|
||||
return new MonitorCriteriaInstance().fromJSON(value);
|
||||
return MonitorCriteriaInstance.fromJSON(value);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export default class MonitorCustomFields {}
|
||||
@@ -1,43 +1,170 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import { JSONObject } from '../JSON';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import URL from '../API/URL';
|
||||
import IP from '../IP/IP';
|
||||
import MonitorCriteria from './MonitorCriteria';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import HTTPMethod from '../API/HTTPMethod';
|
||||
import Dictionary from '../Dictionary';
|
||||
import ObjectID from '../ObjectID';
|
||||
import MonitorType from './MonitorType';
|
||||
|
||||
export interface MonitorStepType {
|
||||
monitorDestination: URL | IP;
|
||||
id: string;
|
||||
monitorDestination?: URL | IP | undefined;
|
||||
monitorCriteria: MonitorCriteria;
|
||||
requestType: HTTPMethod;
|
||||
requestHeaders?: Dictionary<string> | undefined;
|
||||
requestBody?: string | undefined;
|
||||
}
|
||||
|
||||
export default class MonitorStep extends DatabaseProperty {
|
||||
public monitorStep: MonitorStepType | undefined = undefined;
|
||||
public data: MonitorStepType | undefined = undefined;
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
|
||||
this.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorDestination: undefined,
|
||||
monitorCriteria: new MonitorCriteria(),
|
||||
requestType: HTTPMethod.GET,
|
||||
requestHeaders: undefined,
|
||||
requestBody: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
public static isValid(_json: JSONObject): boolean {
|
||||
return true;
|
||||
public static getDefaultMoniorStep(arg: {
|
||||
monitorType: MonitorType;
|
||||
onlineMonitorStatusId: ObjectID;
|
||||
offlineMonitorStatusId: ObjectID;
|
||||
defaultIncidentSeverityId: ObjectID;
|
||||
}): MonitorStep {
|
||||
const monitorStep: MonitorStep = new MonitorStep();
|
||||
|
||||
monitorStep.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorDestination: undefined,
|
||||
monitorCriteria: MonitorCriteria.getDefaultMonitorCriteria(arg),
|
||||
requestType: HTTPMethod.GET,
|
||||
requestHeaders: undefined,
|
||||
requestBody: undefined,
|
||||
};
|
||||
|
||||
return monitorStep;
|
||||
}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
if (this.monitorStep) {
|
||||
public get id(): ObjectID {
|
||||
return new ObjectID(this.data?.id!);
|
||||
}
|
||||
|
||||
public set id(v: ObjectID) {
|
||||
this.data!.id = v.toString();
|
||||
}
|
||||
|
||||
public setRequestType(requestType: HTTPMethod): MonitorStep {
|
||||
this.data!.requestType = requestType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public setRequestHeaders(requestHeaders: Dictionary<string>): MonitorStep {
|
||||
this.data!.requestHeaders = requestHeaders;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static clone(monitorStep: MonitorStep): MonitorStep {
|
||||
return MonitorStep.fromJSON(monitorStep.toJSON());
|
||||
}
|
||||
|
||||
public setRequestBody(requestBody: string): MonitorStep {
|
||||
this.data!.requestBody = requestBody;
|
||||
return this;
|
||||
}
|
||||
|
||||
public setMonitorDestination(monitorDestination: URL | IP): MonitorStep {
|
||||
this.data!.monitorDestination = monitorDestination;
|
||||
return this;
|
||||
}
|
||||
|
||||
public setMonitorCriteria(monitorCriteria: MonitorCriteria): MonitorStep {
|
||||
this.data!.monitorCriteria = monitorCriteria;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static getNewMonitorStepAsJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.MonitorStep,
|
||||
value: {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorDestination: undefined,
|
||||
monitorCriteria: MonitorCriteria.getNewMonitorCriteriaAsJSON(),
|
||||
requestType: HTTPMethod.GET,
|
||||
requestHeaders: undefined,
|
||||
requestBody: undefined,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public static getValidationError(
|
||||
value: MonitorStep,
|
||||
monitorType: MonitorType
|
||||
): string | null {
|
||||
if (!value.data) {
|
||||
return 'Monitor Step is required';
|
||||
}
|
||||
|
||||
if (!value.data.monitorDestination) {
|
||||
return 'Monitor Destination is required';
|
||||
}
|
||||
|
||||
if (!value.data.monitorCriteria) {
|
||||
return 'Monitor Criteria is required';
|
||||
}
|
||||
|
||||
if (
|
||||
!MonitorCriteria.getValidationError(
|
||||
value.data.monitorCriteria,
|
||||
monitorType
|
||||
)
|
||||
) {
|
||||
return MonitorCriteria.getValidationError(
|
||||
value.data.monitorCriteria,
|
||||
monitorType
|
||||
);
|
||||
}
|
||||
|
||||
if (!value.data.requestType && monitorType === MonitorType.API) {
|
||||
return 'Request Type is required';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
if (this.data) {
|
||||
return {
|
||||
_type: 'MonitorStep',
|
||||
_type: ObjectType.MonitorStep,
|
||||
value: {
|
||||
id: this.data.id,
|
||||
monitorDestination:
|
||||
this.monitorStep.monitorDestination.toJSON(),
|
||||
monitorCriteria: this.monitorStep.monitorCriteria.toJSON(),
|
||||
this.data?.monitorDestination?.toJSON() || undefined,
|
||||
monitorCriteria: this.data.monitorCriteria.toJSON(),
|
||||
requestType: this.data.requestType,
|
||||
requestHeaders: this.data.requestHeaders || undefined,
|
||||
requestBody: this.data.requestBody || undefined,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return {};
|
||||
return MonitorStep.getNewMonitorStepAsJSON();
|
||||
}
|
||||
|
||||
public fromJSON(json: JSONObject): MonitorStep {
|
||||
public static override fromJSON(json: JSONObject): MonitorStep {
|
||||
if (json instanceof MonitorStep) {
|
||||
return json;
|
||||
}
|
||||
|
||||
if (!json || json['_type'] !== 'MonitorStep') {
|
||||
throw new BadDataException('Invalid monitor step');
|
||||
}
|
||||
@@ -70,10 +197,6 @@ export default class MonitorStep extends DatabaseProperty {
|
||||
);
|
||||
}
|
||||
|
||||
if (!monitorDestination) {
|
||||
throw new BadDataException('Invalid monitor destination');
|
||||
}
|
||||
|
||||
if (!json['monitorCriteria']) {
|
||||
throw new BadDataException('Invalid monitor criteria');
|
||||
}
|
||||
@@ -85,14 +208,21 @@ export default class MonitorStep extends DatabaseProperty {
|
||||
throw new BadDataException('Invalid monitor criteria');
|
||||
}
|
||||
|
||||
this.monitorStep = {
|
||||
monitorDestination: monitorDestination,
|
||||
monitorCriteria: new MonitorCriteria().fromJSON(
|
||||
const monitorStep: MonitorStep = new MonitorStep();
|
||||
|
||||
monitorStep.data = {
|
||||
id: json['id'] as string,
|
||||
monitorDestination: monitorDestination || undefined,
|
||||
monitorCriteria: MonitorCriteria.fromJSON(
|
||||
json['monitorCriteria'] as JSONObject
|
||||
),
|
||||
requestType: (json['requestType'] as HTTPMethod) || HTTPMethod.GET,
|
||||
requestHeaders:
|
||||
(json['requestHeaders'] as Dictionary<string>) || undefined,
|
||||
requestBody: (json['requestBody'] as string) || undefined,
|
||||
};
|
||||
|
||||
return this;
|
||||
return monitorStep;
|
||||
}
|
||||
|
||||
public isValid(): boolean {
|
||||
@@ -113,7 +243,7 @@ export default class MonitorStep extends DatabaseProperty {
|
||||
value: JSONObject
|
||||
): MonitorStep | null {
|
||||
if (value) {
|
||||
return new MonitorStep().fromJSON(value);
|
||||
return MonitorStep.fromJSON(value);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -1,46 +1,109 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import { JSONArray, JSONObject } from '../JSON';
|
||||
import { JSONArray, JSONObject, ObjectType } from '../JSON';
|
||||
import MonitorStep from './MonitorStep';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import MonitorType from './MonitorType';
|
||||
import ObjectID from '../ObjectID';
|
||||
|
||||
export interface MonitorStepsType {
|
||||
monitorStepsInstanceArray: Array<MonitorStep>;
|
||||
defaultMonitorStatusId?: ObjectID | undefined;
|
||||
}
|
||||
|
||||
export default class MonitorSteps extends DatabaseProperty {
|
||||
public monitorSteps: MonitorStepsType | undefined = undefined;
|
||||
public data: MonitorStepsType | undefined = undefined;
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
this.data = {
|
||||
monitorStepsInstanceArray: [new MonitorStep()],
|
||||
defaultMonitorStatusId: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
if (!this.monitorSteps) {
|
||||
return {
|
||||
_type: 'MonitorSteps',
|
||||
value: {},
|
||||
};
|
||||
}
|
||||
|
||||
public static getNewMonitorStepsAsJSON(): JSONObject {
|
||||
return {
|
||||
_type: 'MonitorSteps',
|
||||
_type: ObjectType.MonitorSteps,
|
||||
value: {
|
||||
monitorStepsInstanceArray:
|
||||
this.monitorSteps.monitorStepsInstanceArray.map(
|
||||
(step: MonitorStep) => {
|
||||
return step.toJSON();
|
||||
}
|
||||
),
|
||||
monitorStepsInstanceArray: [new MonitorStep().toJSON()],
|
||||
defaultMonitorStatusId: undefined,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public fromJSON(json: JSONObject): MonitorSteps {
|
||||
public static getDefaultMonitorSteps(arg: {
|
||||
defaultMonitorStatusId: ObjectID;
|
||||
monitorType: MonitorType;
|
||||
onlineMonitorStatusId: ObjectID;
|
||||
offlineMonitorStatusId: ObjectID;
|
||||
defaultIncidentSeverityId: ObjectID;
|
||||
}): MonitorSteps {
|
||||
const monitorSteps: MonitorSteps = new MonitorSteps();
|
||||
|
||||
monitorSteps.data = {
|
||||
monitorStepsInstanceArray: [MonitorStep.getDefaultMoniorStep(arg)],
|
||||
defaultMonitorStatusId: arg.defaultMonitorStatusId,
|
||||
};
|
||||
|
||||
return monitorSteps;
|
||||
}
|
||||
|
||||
public setMonitorStepsInstanceArray(
|
||||
monitorSteps: Array<MonitorStep>
|
||||
): void {
|
||||
if (this.data) {
|
||||
this.data.monitorStepsInstanceArray = monitorSteps;
|
||||
}
|
||||
}
|
||||
|
||||
public static clone(monitorSteps: MonitorSteps): MonitorSteps {
|
||||
return MonitorSteps.fromJSON(monitorSteps.toJSON());
|
||||
}
|
||||
|
||||
public setDefaultMonitorStatusId(
|
||||
monitorStatusId: ObjectID | undefined
|
||||
): MonitorSteps {
|
||||
if (this.data) {
|
||||
this.data.defaultMonitorStatusId = monitorStatusId;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
if (!this.data) {
|
||||
return MonitorSteps.getNewMonitorStepsAsJSON();
|
||||
}
|
||||
|
||||
return {
|
||||
_type: ObjectType.MonitorSteps,
|
||||
value: {
|
||||
monitorStepsInstanceArray:
|
||||
this.data.monitorStepsInstanceArray.map(
|
||||
(step: MonitorStep) => {
|
||||
return step.toJSON();
|
||||
}
|
||||
),
|
||||
defaultMonitorStatusId:
|
||||
this.data.defaultMonitorStatusId?.toString() || undefined,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): MonitorSteps {
|
||||
if (json instanceof MonitorSteps) {
|
||||
return json;
|
||||
}
|
||||
|
||||
if (!json) {
|
||||
throw new BadDataException('Invalid monitor steps');
|
||||
}
|
||||
|
||||
if (json['_type'] !== 'MonitorSteps') {
|
||||
throw new BadDataException('Invalid monitor steps');
|
||||
}
|
||||
|
||||
if (!json['value']) {
|
||||
throw new BadDataException('Invalid monitor steps');
|
||||
}
|
||||
@@ -53,19 +116,51 @@ export default class MonitorSteps extends DatabaseProperty {
|
||||
json['value'] as JSONObject
|
||||
)['monitorStepsInstanceArray'] as JSONArray;
|
||||
|
||||
this.monitorSteps = {
|
||||
const monitorSteps: MonitorSteps = new MonitorSteps();
|
||||
|
||||
monitorSteps.data = {
|
||||
monitorStepsInstanceArray: monitorStepsInstanceArray.map(
|
||||
(json: JSONObject) => {
|
||||
return new MonitorStep().fromJSON(json);
|
||||
return MonitorStep.fromJSON(json);
|
||||
}
|
||||
),
|
||||
defaultMonitorStatusId: (json['value'] as JSONObject)[
|
||||
'defaultMonitorStatusId'
|
||||
]
|
||||
? new ObjectID(
|
||||
(json['value'] as JSONObject)[
|
||||
'defaultMonitorStatusId'
|
||||
] as string
|
||||
)
|
||||
: undefined,
|
||||
};
|
||||
|
||||
return this;
|
||||
return monitorSteps;
|
||||
}
|
||||
|
||||
public static isValid(_json: JSONObject): boolean {
|
||||
return true;
|
||||
public static getValidationError(
|
||||
value: MonitorSteps,
|
||||
monitorType: MonitorType
|
||||
): string | null {
|
||||
if (!value.data) {
|
||||
return 'Monitor Steps is required';
|
||||
}
|
||||
|
||||
if (value.data.monitorStepsInstanceArray.length === 0) {
|
||||
return 'Monitor Steps is required';
|
||||
}
|
||||
|
||||
if (!value.data.defaultMonitorStatusId) {
|
||||
return 'Default Monitor Status is required';
|
||||
}
|
||||
|
||||
for (const step of value.data.monitorStepsInstanceArray) {
|
||||
if (MonitorStep.getValidationError(step, monitorType)) {
|
||||
return MonitorStep.getValidationError(step, monitorType);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected static override toDatabase(
|
||||
@@ -82,7 +177,7 @@ export default class MonitorSteps extends DatabaseProperty {
|
||||
value: JSONObject
|
||||
): MonitorSteps | null {
|
||||
if (value) {
|
||||
return new MonitorSteps().fromJSON(value);
|
||||
return MonitorSteps.fromJSON(value);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -35,7 +35,7 @@ export class MonitorTypeHelper {
|
||||
},
|
||||
{
|
||||
monitorType: MonitorType.Website,
|
||||
title: 'Webiste',
|
||||
title: 'Website',
|
||||
description:
|
||||
'This monitor type lets you monitor landing pages like home page of your company / blog or more.',
|
||||
},
|
||||
@@ -45,24 +45,24 @@ export class MonitorTypeHelper {
|
||||
description:
|
||||
'This monitor types does the basic ping test of an endpoint.',
|
||||
},
|
||||
{
|
||||
monitorType: MonitorType.Kubernetes,
|
||||
title: 'Kubenretes',
|
||||
description:
|
||||
'This monitor types lets you monitor kuberetes clusters.',
|
||||
},
|
||||
// {
|
||||
// monitorType: MonitorType.Kubernetes,
|
||||
// title: 'Kubenretes',
|
||||
// description:
|
||||
// 'This monitor types lets you monitor kuberetes clusters.',
|
||||
// },
|
||||
{
|
||||
monitorType: MonitorType.IP,
|
||||
title: 'IP',
|
||||
description:
|
||||
'This monitor types lets you monitor any IPv4 or IPv6 addresses.',
|
||||
},
|
||||
{
|
||||
monitorType: MonitorType.IncomingRequest,
|
||||
title: 'Incoming Request',
|
||||
description:
|
||||
'This monitor types lets you ping OneUptime from any external device or service wuth a custom payload.',
|
||||
},
|
||||
// {
|
||||
// monitorType: MonitorType.IncomingRequest,
|
||||
// title: 'Incoming Request',
|
||||
// description:
|
||||
// 'This monitor types lets you ping OneUptime from any external device or service wuth a custom payload.',
|
||||
// },
|
||||
];
|
||||
|
||||
return monitorTypeProps;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
|
||||
export default class Name extends DatabaseProperty {
|
||||
private _title: string = '';
|
||||
@@ -55,6 +57,21 @@ export default class Name extends DatabaseProperty {
|
||||
return null;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Name,
|
||||
value: (this as Name).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Name {
|
||||
if (json['_type'] === ObjectType.Name) {
|
||||
return new Name((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public static override fromDatabase(_value: string): Name | null {
|
||||
if (_value) {
|
||||
return new Name(_value);
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import UUID from '../Utils/UUID';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
|
||||
export default class ObjectID extends DatabaseProperty {
|
||||
private _id: string = '';
|
||||
@@ -35,6 +37,21 @@ export default class ObjectID extends DatabaseProperty {
|
||||
return null;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.ObjectID,
|
||||
value: (this as ObjectID).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): ObjectID {
|
||||
if (json['_type'] === ObjectType.ObjectID) {
|
||||
return new ObjectID((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
protected static override fromDatabase(_value: string): ObjectID | null {
|
||||
if (_value) {
|
||||
return new ObjectID(_value);
|
||||
|
||||
@@ -68,6 +68,11 @@ enum Permission {
|
||||
CanEditScheduledMaintenanceCustomField = 'CanEditScheduledMaintenanceCustomField',
|
||||
CanReadScheduledMaintenanceCustomField = 'CanReadScheduledMaintenanceCustomField',
|
||||
|
||||
CanCreateMonitorProbe = 'CanCreateMonitorProbe',
|
||||
CanDeleteMonitorProbe = 'CanDeleteMonitorProbe',
|
||||
CanEditMonitorProbe = 'CanEditMonitorProbe',
|
||||
CanReadMonitorProbe = 'CanReadMonitorProbe',
|
||||
|
||||
CanCreateStatusPageCustomField = 'CanCreateStatusPageCustomField',
|
||||
CanDeleteStatusPageCustomField = 'CanDeleteStatusPageCustomField',
|
||||
CanEditStatusPageCustomField = 'CanEditStatusPageCustomField',
|
||||
@@ -1623,6 +1628,39 @@ export class PermissionHelper {
|
||||
isAccessControlPermission: false,
|
||||
},
|
||||
|
||||
{
|
||||
permission: Permission.CanCreateMonitorProbe,
|
||||
title: 'Can Create Monitor Probe',
|
||||
description:
|
||||
'This permission can create Monitor Probe this project.',
|
||||
isAssignableToTenant: true,
|
||||
isAccessControlPermission: false,
|
||||
},
|
||||
{
|
||||
permission: Permission.CanDeleteMonitorProbe,
|
||||
title: 'Can Delete Monitor Probe',
|
||||
description:
|
||||
'This permission can delete Monitor Probe of this project.',
|
||||
isAssignableToTenant: true,
|
||||
isAccessControlPermission: false,
|
||||
},
|
||||
{
|
||||
permission: Permission.CanEditMonitorProbe,
|
||||
title: 'Can Edit Monitor Probe',
|
||||
description:
|
||||
'This permission can edit Monitor Probe of this project.',
|
||||
isAssignableToTenant: true,
|
||||
isAccessControlPermission: false,
|
||||
},
|
||||
{
|
||||
permission: Permission.CanReadMonitorProbe,
|
||||
title: 'Can Read Monitor Probe',
|
||||
description:
|
||||
'This permission can read Monitor Probe of this project.',
|
||||
isAssignableToTenant: true,
|
||||
isAccessControlPermission: false,
|
||||
},
|
||||
|
||||
{
|
||||
permission: Permission.CanCreateProjectIncident,
|
||||
title: 'Can Create Incident',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
|
||||
export default class Phone extends DatabaseProperty {
|
||||
private _phone: string = '';
|
||||
@@ -35,6 +36,21 @@ export default class Phone extends DatabaseProperty {
|
||||
return this.phone;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Phone,
|
||||
value: (this as Phone).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Phone {
|
||||
if (json['_type'] === ObjectType.Phone) {
|
||||
return new Phone((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
protected static override toDatabase(
|
||||
_value: Phone | FindOperator<Phone>
|
||||
): string | null {
|
||||
|
||||
@@ -3,6 +3,7 @@ import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
import PositiveNumber from './PositiveNumber';
|
||||
import Typeof from './Typeof';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
|
||||
export default class Port extends DatabaseProperty {
|
||||
private _port: PositiveNumber = new PositiveNumber(0);
|
||||
@@ -18,6 +19,21 @@ export default class Port extends DatabaseProperty {
|
||||
}
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Port,
|
||||
value: (this as Port).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Port {
|
||||
if (json['_type'] === ObjectType.Port) {
|
||||
return new Port((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public static isValid(port: number | string | PositiveNumber): boolean {
|
||||
if (typeof port === Typeof.String) {
|
||||
try {
|
||||
|
||||
@@ -18,7 +18,7 @@ export default class PositiveNumber {
|
||||
}
|
||||
}
|
||||
|
||||
if (positiveNumber < 0) {
|
||||
if ((positiveNumber as number) < 0) {
|
||||
throw new BadDataException('positiveNumber cannot be less than 0');
|
||||
}
|
||||
|
||||
|
||||
8
Common/Types/Probe/ProbeApiIngestResponse.ts
Normal file
8
Common/Types/Probe/ProbeApiIngestResponse.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import ObjectID from '../ObjectID';
|
||||
|
||||
export default interface ProbeApiIngestResponse {
|
||||
monitorId: ObjectID;
|
||||
ingestedMonitorStepId?: ObjectID | undefined;
|
||||
nextMonitorStepId?: ObjectID | undefined;
|
||||
criteriaMetId?: string | undefined;
|
||||
}
|
||||
13
Common/Types/Probe/ProbeMonitorResponse.ts
Normal file
13
Common/Types/Probe/ProbeMonitorResponse.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import Dictionary from '../Dictionary';
|
||||
import { JSONObject } from '../JSON';
|
||||
import ObjectID from '../ObjectID';
|
||||
|
||||
export default interface ProbeMonitorResponse {
|
||||
isOnline?: boolean | undefined;
|
||||
responseTimeInMs?: number | undefined;
|
||||
responseCode?: number | undefined;
|
||||
responseHeaders?: Dictionary<string> | undefined;
|
||||
responseBody?: string | JSONObject | undefined;
|
||||
monitorStepId: ObjectID;
|
||||
monitorId: ObjectID;
|
||||
}
|
||||
18
Common/Types/SerializableObject.ts
Normal file
18
Common/Types/SerializableObject.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import NotImplementedException from './Exception/NotImplementedException';
|
||||
import { JSONObject } from './JSON';
|
||||
|
||||
export default class SerializableObject {
|
||||
public constructor() {}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public static fromJSON(_json: JSONObject): SerializableObject {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public fromJSON(json: JSONObject): SerializableObject {
|
||||
return SerializableObject.fromJSON(json);
|
||||
}
|
||||
}
|
||||
59
Common/Types/SerializableObjectDictionary.ts
Normal file
59
Common/Types/SerializableObjectDictionary.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import Dictionary from './Dictionary';
|
||||
import Phone from './Phone';
|
||||
import { ObjectType } from './JSON';
|
||||
import ObjectID from './ObjectID';
|
||||
import Name from './Name';
|
||||
import EqualToOrNull from './Database/EqualToOrNull';
|
||||
import MonitorSteps from './Monitor/MonitorSteps';
|
||||
import MonitorStep from './Monitor/MonitorStep';
|
||||
import MonitorCriteria from './Monitor/MonitorCriteria';
|
||||
import MonitorCriteriaInstance from './Monitor/MonitorCriteriaInstance';
|
||||
import NotEqual from './Database/NotEqual';
|
||||
import Email from './Email';
|
||||
import Color from './Color';
|
||||
import Domain from './Domain';
|
||||
import Version from './Version';
|
||||
import Route from './API/Route';
|
||||
import URL from './API/URL';
|
||||
import Search from './Database/Search';
|
||||
import GreaterThan from './Database/GreaterThan';
|
||||
import GreaterThanOrEqual from './Database/GreaterThanOrEqual';
|
||||
import LessThan from './Database/LessThan';
|
||||
import LessThanOrEqual from './Database/LessThanOrEqual';
|
||||
import Port from './Port';
|
||||
import Hostname from './API/Hostname';
|
||||
import HashedString from './HashedString';
|
||||
import InBetween from './Database/InBetween';
|
||||
import NotNull from './Database/NotNull';
|
||||
import IsNull from './Database/IsNull';
|
||||
|
||||
const SerializableObjectDictionary: Dictionary<any> = {
|
||||
[ObjectType.Phone]: Phone,
|
||||
[ObjectType.ObjectID]: ObjectID,
|
||||
[ObjectType.Name]: Name,
|
||||
[ObjectType.EqualToOrNull]: EqualToOrNull,
|
||||
[ObjectType.MonitorSteps]: MonitorSteps,
|
||||
[ObjectType.MonitorStep]: MonitorStep,
|
||||
[ObjectType.MonitorCriteria]: MonitorCriteria,
|
||||
[ObjectType.MonitorCriteriaInstance]: MonitorCriteriaInstance,
|
||||
[ObjectType.NotEqual]: NotEqual,
|
||||
[ObjectType.Email]: Email,
|
||||
[ObjectType.Color]: Color,
|
||||
[ObjectType.Domain]: Domain,
|
||||
[ObjectType.Version]: Version,
|
||||
[ObjectType.Route]: Route,
|
||||
[ObjectType.URL]: URL,
|
||||
[ObjectType.Search]: Search,
|
||||
[ObjectType.GreaterThan]: GreaterThan,
|
||||
[ObjectType.GreaterThanOrEqual]: GreaterThanOrEqual,
|
||||
[ObjectType.LessThan]: LessThan,
|
||||
[ObjectType.LessThanOrEqual]: LessThanOrEqual,
|
||||
[ObjectType.Port]: Port,
|
||||
[ObjectType.Hostname]: Hostname,
|
||||
[ObjectType.HashedString]: HashedString,
|
||||
[ObjectType.InBetween]: InBetween,
|
||||
[ObjectType.NotNull]: NotNull,
|
||||
[ObjectType.IsNull]: IsNull,
|
||||
};
|
||||
|
||||
export default SerializableObjectDictionary;
|
||||
@@ -16,6 +16,43 @@ export default class Text {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static convertNumberToWords(num: number): string {
|
||||
const words: Array<string> = [
|
||||
'first',
|
||||
'second',
|
||||
'third',
|
||||
'fourth',
|
||||
'fifth',
|
||||
'sixth',
|
||||
'seventh',
|
||||
'eighth',
|
||||
'ninth',
|
||||
'tenth',
|
||||
'eleventh',
|
||||
'twelfth',
|
||||
'thirteenth',
|
||||
'fourteenth',
|
||||
'fifteenth',
|
||||
'sixteenth',
|
||||
'seventeenth',
|
||||
'eighteenth',
|
||||
'nineteenth',
|
||||
'twentieth',
|
||||
];
|
||||
|
||||
if (num <= 20) {
|
||||
return words[num - 1]!;
|
||||
}
|
||||
|
||||
if (num % 10 === 0) {
|
||||
return `${words[19]} ${words[num / 10 - 2]}`;
|
||||
}
|
||||
|
||||
return `${words[19]} ${words[Math.floor(num / 10) - 2]}-${
|
||||
words[(num % 10) - 1]
|
||||
}`;
|
||||
}
|
||||
|
||||
public static uppercaseFirstLetter(word: string): string {
|
||||
if (word.length > 0) {
|
||||
return word.charAt(0).toUpperCase() + word.slice(1);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
|
||||
export default class Version extends DatabaseProperty {
|
||||
private _version: string = '';
|
||||
@@ -26,6 +27,21 @@ export default class Version extends DatabaseProperty {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Version,
|
||||
value: (this as Version).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Version {
|
||||
if (json['_type'] === ObjectType.Version) {
|
||||
return new Version((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
protected static override toDatabase(
|
||||
value: Version | FindOperator<Version>
|
||||
): string | null {
|
||||
|
||||
@@ -2,3 +2,4 @@ export const EVERY_MINUTE: string = '* * * * *';
|
||||
export const EVERY_DAY: string = '0 8 * * *';
|
||||
export const EVERY_HOUR: string = '1 * * * *';
|
||||
export const EVERY_FIVE_MINUTE: string = '*/5 * * * *';
|
||||
export const EVERY_FIVE_SECONDS: string = '*/5 * * * * *';
|
||||
61
CommonServer/API/ProbeAPI.ts
Normal file
61
CommonServer/API/ProbeAPI.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import Probe from 'Model/Models/Probe';
|
||||
import UserMiddleware from '../Middleware/UserAuthorization';
|
||||
import ProbeService, {
|
||||
Service as ProbeServiceType,
|
||||
} from '../Services/ProbeService';
|
||||
import {
|
||||
ExpressRequest,
|
||||
ExpressResponse,
|
||||
NextFunction,
|
||||
} from '../Utils/Express';
|
||||
import Response from '../Utils/Response';
|
||||
import BaseAPI from './BaseAPI';
|
||||
import LIMIT_MAX from 'Common/Types/Database/LimitMax';
|
||||
import PositiveNumber from 'Common/Types/PositiveNumber';
|
||||
|
||||
export default class ProbeAPI extends BaseAPI<Probe, ProbeServiceType> {
|
||||
public constructor() {
|
||||
super(Probe, ProbeService);
|
||||
|
||||
this.router.post(
|
||||
`${new this.entityType()
|
||||
.getCrudApiPath()
|
||||
?.toString()}/global-probes`,
|
||||
UserMiddleware.getUserMiddleware,
|
||||
async (
|
||||
req: ExpressRequest,
|
||||
res: ExpressResponse,
|
||||
next: NextFunction
|
||||
) => {
|
||||
try {
|
||||
const probes: Array<Probe> = await ProbeService.findBy({
|
||||
query: {
|
||||
isGlobalProbe: true,
|
||||
},
|
||||
select: {
|
||||
name: true,
|
||||
description: true,
|
||||
lastAlive: true,
|
||||
iconFileId: true,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
skip: 0,
|
||||
limit: LIMIT_MAX,
|
||||
});
|
||||
|
||||
return Response.sendEntityArrayResponse(
|
||||
req,
|
||||
res,
|
||||
probes,
|
||||
new PositiveNumber(probes.length),
|
||||
Probe
|
||||
);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,8 @@ export const ClusterKey: ObjectID = new ObjectID(
|
||||
process.env['ONEUPTIME_SECRET'] || 'secret'
|
||||
);
|
||||
|
||||
export const hasClusterKey: boolean = Boolean(process.env['ONEUPTIME_SECRET']);
|
||||
|
||||
export const Domain: Hostname = Hostname.fromString(
|
||||
process.env['DOMAIN'] || 'localhost'
|
||||
);
|
||||
|
||||
@@ -21,6 +21,14 @@ export default abstract class LocalCache {
|
||||
this.cache[namespace + '.' + key] = value;
|
||||
}
|
||||
|
||||
public static setNumber(
|
||||
namespace: string,
|
||||
key: string,
|
||||
value: number
|
||||
): void {
|
||||
this.cache[namespace + '.' + key] = value;
|
||||
}
|
||||
|
||||
public static setModel(
|
||||
namespace: string,
|
||||
key: string,
|
||||
@@ -44,6 +52,10 @@ export default abstract class LocalCache {
|
||||
return this.cache[namespace + '.' + key] as string;
|
||||
}
|
||||
|
||||
public static getNumber(namespace: string, key: string): number {
|
||||
return this.cache[namespace + '.' + key] as number;
|
||||
}
|
||||
|
||||
public static async getOrSetString(
|
||||
namespace: string,
|
||||
key: string,
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
import ProbeService from '../Services/ProbeService';
|
||||
import BadDataException from 'Common/Types/Exception/BadDataException';
|
||||
import Version from 'Common/Types/Version';
|
||||
|
||||
import {
|
||||
ExpressRequest,
|
||||
ExpressResponse,
|
||||
NextFunction,
|
||||
OneUptimeRequest,
|
||||
} from '../Utils/Express';
|
||||
|
||||
import { ClusterKey as ONEUPTIME_SECRET } from '../Config';
|
||||
import ObjectID from 'Common/Types/ObjectID';
|
||||
import LocalCache from '../Infrastructure/LocalCache';
|
||||
import Probe from 'Model/Models/Probe';
|
||||
|
||||
export default class ProbeMiddleware {
|
||||
public static async isAuthorizedProbeMiddleware(
|
||||
req: ExpressRequest,
|
||||
_res: ExpressResponse,
|
||||
next: NextFunction
|
||||
): Promise<void> {
|
||||
let probeKey: ObjectID | null = null,
|
||||
probeName: string | null = null,
|
||||
clusterKey: ObjectID | null = null,
|
||||
probeVersion: Version | null = null,
|
||||
probeId: ObjectID | null = null;
|
||||
|
||||
if (req.params && req.params['probeKey']) {
|
||||
probeKey = new ObjectID(req.params['probeKey'] || '');
|
||||
} else if (req.query && req.query['probeKey']) {
|
||||
probeKey = new ObjectID((req.query['probeKey'] as string) || '');
|
||||
} else if (req.headers && req.headers['probekey']) {
|
||||
// Header keys are automatically transformed to lowercase
|
||||
probeKey = new ObjectID(req.headers['probekey'] as string);
|
||||
} else if (req.body && req.body.probeKey) {
|
||||
probeKey = req.body.probeKey;
|
||||
}
|
||||
|
||||
if (!probeKey) {
|
||||
throw new BadDataException('Probe key not found.');
|
||||
}
|
||||
|
||||
if (req.params && req.params['probeName']) {
|
||||
probeName = req.params['probeName'];
|
||||
} else if (req.query && req.query['probeName']) {
|
||||
probeName = req.query['probeName'] as string;
|
||||
} else if (req.headers && req.headers['probename']) {
|
||||
// Header keys are automatically transformed to lowercase
|
||||
probeName = req.headers['probename'] as string;
|
||||
} else if (req.body && req.body.probeName) {
|
||||
probeName = req.body.probeName;
|
||||
}
|
||||
|
||||
if (!probeName) {
|
||||
throw new BadDataException('Probe Name not found.');
|
||||
}
|
||||
|
||||
if (req.params && req.params['clusterKey']) {
|
||||
clusterKey = new ObjectID(req.params['clusterKey'] as string);
|
||||
} else if (req.query && req.query['clusterKey']) {
|
||||
clusterKey = new ObjectID(req.query['clusterKey'] as string);
|
||||
} else if (req.headers && req.headers['clusterkey']) {
|
||||
// Header keys are automatically transformed to lowercase
|
||||
clusterKey = new ObjectID(req.headers['clusterkey'] as string);
|
||||
} else if (req.body && req.body.clusterKey) {
|
||||
clusterKey = req.body.clusterKey;
|
||||
}
|
||||
|
||||
if (req.params && req.params['probeVersion']) {
|
||||
probeVersion = new Version(req.params['probeVersion']);
|
||||
} else if (req.query && req.query['probeVersion']) {
|
||||
probeVersion = new Version(req.query['probeVersion'] as string);
|
||||
} else if (req.headers && req.headers['probeversion']) {
|
||||
// Header keys are automatically transformed to lowercase
|
||||
probeVersion = new Version(req.headers['probeversion'] as string);
|
||||
} else if (req.body && req.body.probeVersion) {
|
||||
probeVersion = req.body.probeVersion;
|
||||
}
|
||||
|
||||
if (!probeVersion) {
|
||||
throw new BadDataException('Probe version not found.');
|
||||
}
|
||||
|
||||
if (clusterKey && clusterKey === ONEUPTIME_SECRET) {
|
||||
/*
|
||||
* If cluster key matches then just query by probe name,
|
||||
* Because if the probe key does not match, we can update probe key later
|
||||
* Without updating mognodb database manually.
|
||||
*/
|
||||
|
||||
if (LocalCache.hasValue('probe', probeName)) {
|
||||
probeId = (LocalCache.getModel('probe', probeName) as Probe).id;
|
||||
} else {
|
||||
const probe: Probe | null = await ProbeService.findOneBy({
|
||||
query: {
|
||||
name: probeName,
|
||||
},
|
||||
props: { isRoot: true },
|
||||
});
|
||||
|
||||
if (probe && probe.id) {
|
||||
probeId = probe.id;
|
||||
|
||||
LocalCache.setModel('probe', probeName, probe);
|
||||
}
|
||||
}
|
||||
} else if (LocalCache.hasValue('probe', probeName)) {
|
||||
probeId = LocalCache.getModel<Probe>('probe', probeName).id;
|
||||
} else {
|
||||
const probe: Probe | null = await ProbeService.findOneBy({
|
||||
query: {
|
||||
name: probeName,
|
||||
key: probeKey,
|
||||
},
|
||||
select: {
|
||||
_id: true,
|
||||
name: true,
|
||||
key: true,
|
||||
probeVersion: true,
|
||||
},
|
||||
props: { isRoot: true },
|
||||
});
|
||||
|
||||
if (probe && probe.id) {
|
||||
probeId = probe.id;
|
||||
|
||||
LocalCache.setModel('probe', probeName, probe);
|
||||
}
|
||||
}
|
||||
|
||||
if (!probeId && (!clusterKey || clusterKey !== ONEUPTIME_SECRET)) {
|
||||
throw new BadDataException(
|
||||
'Probe key and probe name do not match.'
|
||||
);
|
||||
}
|
||||
|
||||
if (!probeId) {
|
||||
//Create a new probe.
|
||||
let probe: Probe = new Probe();
|
||||
probe.name = probeName;
|
||||
probe.probeVersion = probeVersion;
|
||||
probe.key = probeKey;
|
||||
|
||||
probe = await ProbeService.create({
|
||||
data: probe,
|
||||
props: { isRoot: true },
|
||||
});
|
||||
|
||||
probeId = probe.id;
|
||||
|
||||
LocalCache.setModel('probe', probeName, probe);
|
||||
}
|
||||
|
||||
if (LocalCache.getModel<Probe>('probe', probeName).key !== probeKey) {
|
||||
//Update probe key becasue it does not match.
|
||||
|
||||
await ProbeService.updateProbeKeyByName(probeName, probeKey);
|
||||
|
||||
const probe: Probe | null = await ProbeService.findOneBy({
|
||||
query: { name: probeName, key: probeKey },
|
||||
select: {
|
||||
_id: true,
|
||||
name: true,
|
||||
key: true,
|
||||
probeVersion: true,
|
||||
},
|
||||
props: { isRoot: true },
|
||||
});
|
||||
|
||||
if (probe) {
|
||||
probeId = probe.id;
|
||||
|
||||
LocalCache.setModel('probe', probeName, probe);
|
||||
}
|
||||
}
|
||||
|
||||
const oneuptimeRequest: OneUptimeRequest = req as OneUptimeRequest;
|
||||
|
||||
if (!probeId) {
|
||||
throw new BadDataException('Probe ID not found');
|
||||
}
|
||||
|
||||
oneuptimeRequest.probe = {
|
||||
id: probeId,
|
||||
};
|
||||
|
||||
// Run in background.
|
||||
await ProbeService.updateLastAlive(probeName);
|
||||
|
||||
if (
|
||||
probeVersion &&
|
||||
(!LocalCache.getModel<Probe>('probe', probeName).version ||
|
||||
LocalCache.getModel<Probe>(
|
||||
'probe',
|
||||
probeName
|
||||
).version?.toString() !== probeVersion.toString())
|
||||
) {
|
||||
await ProbeService.updateProbeVersionByName(
|
||||
probeName,
|
||||
probeVersion
|
||||
);
|
||||
}
|
||||
|
||||
return next();
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ export default class ProjectMiddleware {
|
||||
const apiKey: ObjectID | null = this.getApiKey(req);
|
||||
|
||||
if (!tenantId) {
|
||||
throw new BadDataException('tenantId not found in the request');
|
||||
throw new BadDataException('ProjectId not found in the request');
|
||||
}
|
||||
|
||||
if (!apiKey) {
|
||||
|
||||
@@ -121,14 +121,14 @@ export default class UserMiddleware {
|
||||
oneuptimeRequest.tenantId = tenantId;
|
||||
|
||||
// check if the force sso for login is present and if it is, check if the sso token is present and if it is then allow, otherwise decline.
|
||||
}
|
||||
|
||||
if (ProjectMiddleware.hasApiKey(req)) {
|
||||
return await ProjectMiddleware.isValidProjectIdAndApiKeyMiddleware(
|
||||
req,
|
||||
res,
|
||||
next
|
||||
);
|
||||
}
|
||||
if (ProjectMiddleware.hasApiKey(req)) {
|
||||
return await ProjectMiddleware.isValidProjectIdAndApiKeyMiddleware(
|
||||
req,
|
||||
res,
|
||||
next
|
||||
);
|
||||
}
|
||||
|
||||
const accessToken: string | null = UserMiddleware.getAccessToken(req);
|
||||
|
||||
44
CommonServer/Services/MonitorProbeService.ts
Normal file
44
CommonServer/Services/MonitorProbeService.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import PostgresDatabase from '../Infrastructure/PostgresDatabase';
|
||||
import DatabaseService, { OnCreate } from './DatabaseService';
|
||||
import CreateBy from '../Types/Database/CreateBy';
|
||||
import BadDataException from 'Common/Types/Exception/BadDataException';
|
||||
import MonitorProbe from 'Model/Models/MonitorProbe';
|
||||
|
||||
export class Service extends DatabaseService<MonitorProbe> {
|
||||
public constructor(postgresDatabase?: PostgresDatabase) {
|
||||
super(MonitorProbe, postgresDatabase);
|
||||
}
|
||||
|
||||
protected override async onBeforeCreate(
|
||||
createBy: CreateBy<MonitorProbe>
|
||||
): Promise<OnCreate<MonitorProbe>> {
|
||||
if (
|
||||
(createBy.data.monitorId || createBy.data.monitor) &&
|
||||
(createBy.data.probeId || createBy.data.probe)
|
||||
) {
|
||||
const monitorProbe: MonitorProbe | null = await this.findOneBy({
|
||||
query: {
|
||||
monitorId:
|
||||
createBy.data.monitorId! || createBy.data.monitor?.id!,
|
||||
probeId: createBy.data.probeId! || createBy.data.probe?.id!,
|
||||
},
|
||||
select: {
|
||||
_id: true,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (monitorProbe) {
|
||||
throw new BadDataException(
|
||||
'Probe is already added to this monitor.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return { createBy, carryForward: null };
|
||||
}
|
||||
}
|
||||
|
||||
export default new Service();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user