From 8a7ce9c4033dd593e5f808f3c2504cb37dbc47cf Mon Sep 17 00:00:00 2001 From: Rafael Bardini Date: Tue, 5 Jan 2021 17:20:48 +0100 Subject: [PATCH] Add Estafette+OpenAPI YAML and /readiness route --- .estafette.yaml | 74 ++++++++++++++++++++++ README.md | 10 +++ openapi.yaml | 19 ++++++ packages/server/src/api/routes/projects.js | 8 +++ 4 files changed, 111 insertions(+) create mode 100644 .estafette.yaml create mode 100644 openapi.yaml diff --git a/.estafette.yaml b/.estafette.yaml new file mode 100644 index 000000000..44c917f2a --- /dev/null +++ b/.estafette.yaml @@ -0,0 +1,74 @@ +labels: + app: lhci-server + team: aurora + language: nodejs + +env: + CONFIG_FILE: estafette.secret(GAP4TP5N72Pwguwc.fDnhd6KTaEFT5_ph1vgTq9iblQwQaH-8I2BWmqc8eYFZM4a2CL6k2x0GtZehHlpRQs3hdbK9Bkm2DDkk6sI3x7H9slqR46UrZhFlUY7q8rfnr-DhuL3Bvn7Hjs8MwXY3w-paDst1eTveg-3Dmz8hMbV4sBMEuQZUF_t60U-INJoXQYtFzfhJlrCIW3q2b_ZbUbwXjf51bP8iKWFfKABJrpftlcqAVC-TOxHloaGJgdYPJxD-laaOgqZvZZEpmstsnU8qDbrn_pDOIQT_OlG4US7H2lrKtYWU0jgarWRUQWAqBEaCSlsFwGAHK3GDyUZ2vPmPg3W8RaPVmwVtX1zAUD94QFjdVDlhfZR_P27xwhXj61rZfZnAfsIX98ywqKzm18rhxv3BTsMgTrhY7qZDil_wbjpmnnEKqvx0tOEdr4OmsLt8wBl8my0Bmu2Cl-vQ.fif6eJ6yDEhd2ZwD7dEWien1nQUtTkeoGEx1x5MFXMd6M6PpP7-KyScg2ZOBfW5P-ndVa32y7B6fNjQk4A==) + +stages: + bake: + image: extensions/docker:stable + action: build + inline: | + FROM node:12-buster-slim + WORKDIR /usr/src/lhci + COPY /docs/recipes/docker-server/package.json . + RUN echo $CONFIG_FILE | base64 -d > lighthouserc.json + RUN npm install + + EXPOSE 9001 + CMD [ "npm", "start" ] + repositories: + - eu.gcr.io/travix-com + + push: + image: extensions/docker:stable + action: push + repositories: + - eu.gcr.io/travix-com + +releases: + tooling-common: + clone: true + stages: + deploy: + image: extensions/gke:stable + visibility: private + disableServiceAccountKeyRotation: true + namespace: apps + useGoogleCloudCredentials: true + probeService: false + container: + repository: eu.gcr.io/travix-com + port: 9001 + cpu: + request: 500m + limit: 500m + memory: + request: 1Gi + limit: 1Gi + liveness: + path: /version + readiness: + path: /version + + sidecars: + - type: cloudsqlproxy + env: + CORS_ALLOWED_ORIGINS: "*" + CORS_MAX_AGE: "86400" + cpu: + request: "10m" + limit: "50m" + memory: + request: "10Mi" + limit: "50Mi" + dbinstanceconnectionname: tooling-common-rsc-gvwzh:europe-west1:lighthouse + sqlproxyport: 5432 + + hosts: + - lhci-server.travix.com + + internalhosts: + - lhci-server.internal.travix.io diff --git a/README.md b/README.md index a7c41930c..228605840 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,16 @@ Lighthouse CI is a suite of tools that make continuously running, saving, retrieving, and asserting against [Lighthouse](https://github.com/GoogleChrome/lighthouse) results as easy as possible. +### Syncing the Fork with Upstream + +```console +git clone git@github.com:Travix-International/lighthouse-ci.git && cd lighthouse-ci +git remote add upstream git@github.com:GoogleChrome/lighthouse-ci.git +git fetch upstream master:upstream +git rebase upstream master +git push --force origin master +``` + ### Quick Start To get started with GitHub actions for common project configurations, add the following file to your GitHub repository. Follow [the Getting Started guide](./docs/getting-started.md) for a more complete walkthrough and instructions on other providers and setups. diff --git a/openapi.yaml b/openapi.yaml new file mode 100644 index 000000000..42a66a17f --- /dev/null +++ b/openapi.yaml @@ -0,0 +1,19 @@ +--- +swagger: '2.0' +info: + version: v1 + title: lhci-server.internal.travix.io +host: lhci-server.internal.travix.io +schemes: + - "https" +basePath: "/" +x-google-authorization: + require_access_control: true +paths: + "/": + post: + operationId: ProductsCancellation + responses: + 200: + description: Success + security: diff --git a/packages/server/src/api/routes/projects.js b/packages/server/src/api/routes/projects.js index fe7a0da9b..9b0817153 100644 --- a/packages/server/src/api/routes/projects.js +++ b/packages/server/src/api/routes/projects.js @@ -234,6 +234,14 @@ function createRouter(context) { }) ); + // GET /readiness + router.get( + '/readiness', + handleAsyncError(async (req, res) => { + res.sendStatus(200); + }) + ); + return router; }