feat: add secret E2E fixture
This commit is contained in:
commit
7b71e21c9d
11
.maidn/database.yaml
Normal file
11
.maidn/database.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: maidn-e2e-secret
|
||||
namespace: staging
|
||||
labels:
|
||||
maidn.io/e2e: "true"
|
||||
spec:
|
||||
instances: 1
|
||||
storage:
|
||||
size: 1Gi
|
||||
4
.maidn/kustomization.yaml
Normal file
4
.maidn/kustomization.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- database.yaml
|
||||
16
package.json
Normal file
16
package.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "maidn-e2e-secret",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"start": "node dist/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^5.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^5.0.1",
|
||||
"@types/node": "^22.15.0",
|
||||
"typescript": "~5.8.0"
|
||||
}
|
||||
}
|
||||
10
src/index.ts
Normal file
10
src/index.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import express from 'express';
|
||||
|
||||
const secretConfigured = Boolean(process.env.E2E_SECRET);
|
||||
const app = express();
|
||||
|
||||
app.get('/', (_request, response) => {
|
||||
response.status(secretConfigured ? 200 : 503).send(secretConfigured ? 'maidn-e2e-secret-ready' : 'maidn-e2e-secret-missing');
|
||||
});
|
||||
|
||||
app.listen(process.env.PORT ?? 3000);
|
||||
10
tsconfig.json
Normal file
10
tsconfig.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"outDir": "dist",
|
||||
"strict": true,
|
||||
"target": "ES2022"
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
Loading…
Reference in a new issue