develop #152

Merged
samuel-p merged 36 commits from develop into main 2021-10-27 22:52:31 +00:00
6 changed files with 50 additions and 138 deletions

View file

@ -1,127 +0,0 @@
kind: pipeline
type: docker
name: linux-amd64
platform:
os: linux
arch: amd64
steps:
- name: build
image: amd64/node:12.22.1-buster@sha256:436a6432b6f5109c2c70a1f71f5df0e7d29946a967e85882fe08a37f36b8bec4
commands:
- npm install
- npm run build:ssr
- name: docker
image: plugins/docker
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
repo: samuelph/universal-statuspage
username:
from_secret: USERNAME
password:
from_secret: PASSWORD
when:
branch:
- main
event:
- push
---
kind: pipeline
type: docker
name: linux-arm64
platform:
os: linux
arch: arm64
steps:
- name: build
image: arm64v8/node:12.22.1-buster@sha256:beece4c83b620cd54f88d2f16da50c41f62c19a1e8591354ad82726d43d5605a
commands:
- npm install
- npm run build:ssr
- name: docker
image: plugins/docker
settings:
auto_tag: true
auto_tag_suffix: linux-arm64
repo: samuelph/universal-statuspage
username:
from_secret: USERNAME
password:
from_secret: PASSWORD
trigger:
branch:
- main
event:
- push
# disable temporarily
#---
#kind: pipeline
#type: docker
#name: linux-arm
#
#platform:
# os: linux
# arch: arm
#
#steps:
# - name: build
# image: arm32v7/node:12.21.0-buster@sha256:e93d480d761345d85d283fba41585c6906c28d1670fa7f9581ead8aadf56e583
# commands:
# - npm install
# - npm run build:ssr
# - name: docker
# image: plugins/docker
# settings:
# auto_tag: true
# auto_tag_suffix: linux-arm
# repo: samuelph/universal-statuspage
# username:
# from_secret: USERNAME
# password:
# from_secret: PASSWORD
#
#trigger:
# branch:
# - main
# event:
# - push
---
kind: pipeline
type: docker
name: manifest
steps:
- name: publish
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
target: samuelph/universal-statuspage
template: samuelph/universal-statuspage:OS-ARCH
platforms:
- linux/amd64
- linux/arm64
# - linux/arm
username:
from_secret: USERNAME
password:
from_secret: PASSWORD
depends_on:
- linux-amd64
- linux-arm64
# - linux-arm
trigger:
branch:
- main
event:
- push

33
.woodpecker.yml Normal file
View file

@ -0,0 +1,33 @@
pipeline:
build:
image: node:lts-buster@sha256:86853bc87b53623ce8c40fcc0e9dcbdaed64fe7143e178db5735ef1902002d68
commands:
- npm install
- npm run build:ssr
docker:
image: plugins/docker
secrets:
- DOCKER_USERNAME
- DOCKER_PASSWORD
repo: samuelph/universal-statuspage
tags: latest
when:
branch:
- main
event:
- push
cr:
image: plugins/docker
secrets:
- source: CR_USERNAME
target: DOCKER_USERNAME
- source: CR_PASSWORD
target: DOCKER_PASSWORD
registry: cr.sp-codes.de
repo: cr.sp-codes.de/universal-statuspage
tags: latest
when:
branch:
- main
event:
- push

View file

@ -1,10 +1,10 @@
ARG ARCH ARG ARCH
FROM amd64/alpine:3.14.0@sha256:1775bebec23e1f3ce486989bfc9ff3c4e951690df84aa9f926497d82f2ffca9d AS base-amd64 FROM alpine:3.14.2@sha256:e1c082e3d3c45cccac829840a25941e679c25d438cc8412c2fa221cf1a824e6a AS base-amd64
FROM arm32v7/alpine:3.14.0@sha256:8d99168167baa6a6a0d7851b9684625df9c1455116a9601835c2127df2aaa2f5 AS base-arm FROM arm32v7/alpine:3.14.2@sha256:e12ff876f0075740ed3d7bdf788107ae84c1b3dd6dc98b3baea41088aba5236f AS base-arm
FROM arm64v8/alpine:3.14.0@sha256:53b74ddfc6225e3c8cc84d7985d0f34666e4e8b0b6892a9b2ad1f7516bc21b54 AS base-arm64 FROM arm64v8/alpine:3.14.2@sha256:b06a5cf61b2956088722c4f1b9a6f71dfe95f0b1fe285d44195452b8a1627de7 AS base-arm64
FROM base-${ARCH} FROM base-${ARCH}
RUN apk --no-cache add nodejs="12.22.1-r0" RUN apk --no-cache add nodejs="12.22.6-r0"
COPY dist/universal-statuspage /universal-statuspage COPY dist/universal-statuspage /universal-statuspage

View file

@ -26,17 +26,17 @@
"@angular/platform-browser-dynamic": "~11.1.0", "@angular/platform-browser-dynamic": "~11.1.0",
"@angular/platform-server": "~11.1.0", "@angular/platform-server": "~11.1.0",
"@angular/router": "~11.1.0", "@angular/router": "~11.1.0",
"@fortawesome/fontawesome-free": "^5.15.3", "@fortawesome/fontawesome-free": "^5.15.4",
"@nguniversal/express-engine": "^12.0.2", "@nguniversal/express-engine": "^12.1.0",
"@ngx-translate/core": "^13.0.0", "@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0", "@ngx-translate/http-loader": "^6.0.0",
"@types/node-cron": "^2.0.3", "@types/node-cron": "^2.0.5",
"bootstrap": "^4.6.0", "bootstrap": "^4.6.0",
"cron": "^1.8.2", "cron": "^1.8.2",
"dayjs": "^1.10.5", "dayjs": "^1.10.7",
"express": "^4.17.1", "express": "^4.17.1",
"flag-icon-css": "^3.5.0", "flag-icon-css": "^3.5.0",
"jsonpath-plus": "^5.1.0", "jsonpath-plus": "^6.0.1",
"node-cron": "^3.0.0", "node-cron": "^3.0.0",
"roboto-fontface": "^0.10.0", "roboto-fontface": "^0.10.0",
"rxjs": "~6.6.3", "rxjs": "~6.6.3",
@ -49,7 +49,7 @@
"@angular/cli": "~11.1.1", "@angular/cli": "~11.1.1",
"@angular/compiler-cli": "~11.1.0", "@angular/compiler-cli": "~11.1.0",
"@angular/language-service": "~11.1.0", "@angular/language-service": "~11.1.0",
"@nguniversal/builders": "^12.0.2", "@nguniversal/builders": "^12.1.0",
"@types/express": "^4.17.12", "@types/express": "^4.17.12",
"@types/node": "^14.14.22", "@types/node": "^14.14.22",
"@types/jasmine": "~3.6.3", "@types/jasmine": "~3.6.3",

View file

@ -15,7 +15,7 @@
"matchStrings": [ "matchStrings": [
"\\s+(?<depName>[a-z0-9\\-]+?)=\"(?<currentValue>.*?)\"" "\\s+(?<depName>[a-z0-9\\-]+?)=\"(?<currentValue>.*?)\""
], ],
"lookupNameTemplate": "alpine_3_12/{{{depName}}}", "lookupNameTemplate": "alpine_3_14/{{{depName}}}",
"versioningTemplate": "loose", "versioningTemplate": "loose",
"datasourceTemplate": "repology" "datasourceTemplate": "repology"
} }

View file

@ -79,6 +79,12 @@ api.post('/update/health', (req, res) => {
return res.status(401).send('invalid token'); return res.status(401).send('invalid token');
} }
const serviceId = req.query.service as string; const serviceId = req.query.service as string;
if (!config.groups
.map(g => g.services).reduce((x, y) => x.concat(y), [])
.map(s => s.id).includes(serviceId)) {
// TODO remove old caches
return res.send('OK');
}
let services: { id: string, state: string }[] = []; let services: { id: string, state: string }[] = [];
if (serviceId) { if (serviceId) {
services = [{id: serviceId, state: JSONPath({path: serviceStatePaths[serviceId], json: req.body, wrap: false})}]; services = [{id: serviceId, state: JSONPath({path: serviceStatePaths[serviceId], json: req.body, wrap: false})}];