Skip to content

Commit e104371

Browse files
authored
devops: have generate random minio credentials (#283)
1 parent 6584311 commit e104371

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
- name: Generate K8 files
3232
run: |
3333
version="$(bash .github/workflows/determine_docker_image_tag.sh)"
34+
export MINIO_ROOT_USER="minioadmin"
35+
export MINIO_ROOT_PASSWORD=$(openssl rand -base64 32)
3436
bash k8/generate.sh $version
3537
env:
3638
WORKER_COUNT: 1

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ git clone https://github.com/mxschmitt/try-playwright.git
1515
openssl req -x509 -nodes -days 730 -newkey rsa:2048 -keyout tls.key -out tls.crt -subj "/CN=try.playwright.tech/O=try.playwright.tech"
1616
kubectl create secret tls try-playwright-cf-tls-cert --key=tls.key --cert=tls.crt
1717
cd try-playwright
18+
export MINIO_ROOT_USER="admin"
19+
export MINIO_ROOT_PASSWORD=$(openssl rand -base64 32)
1820
bash k8/generate.sh
1921
kubectl apply -f k8/
2022
```

e2e/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const config = defineConfig({
1818
testDir: path.join(__dirname, 'tests'),
1919
forbidOnly: !!process.env.CI,
2020
retries: process.env.CI ? 2 : undefined,
21-
reporter: 'html',
21+
reporter: [['list'], ['html']],
2222
workers: 1,
2323
use: {
2424
trace: process.env.CI ? 'on-all-retries' : undefined,

k8/file-deployment.yaml.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ spec:
2222
- name: MINIO_ENDPOINT
2323
value: minio:9000
2424
- name: MINIO_ACCESS_KEY
25-
value: "minio"
25+
value: "${MINIO_ROOT_USER}"
2626
- name: MINIO_SECRET_KEY
27-
value: "R9gGSFb4QkZH8LzzS8SECsG66JNX"
27+
value: "${MINIO_ROOT_PASSWORD}"
2828
- name: FILE_SERVICE_SENTRY_DSN
2929
value: https://[email protected]/5479804
3030
image: ghcr.io/mxschmitt/try-playwright/file-service:${DOCKER_TAG}

k8/generate.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ set -e
55
export DOCKER_TAG="${1:-latest}"
66
export WORKER_COUNT="${WORKER_COUNT:-2}"
77

8+
# Validate required environment variables
9+
: "${MINIO_ROOT_USER:?Need to set MINIO_ROOT_USER}"
10+
: "${MINIO_ROOT_PASSWORD:?Need to set MINIO_ROOT_PASSWORD}"
11+
812
for file_path in k8/*.yaml.tpl; do
913
filename="$(basename ${file_path})"
1014
outname="k8/generated-${filename/%.yaml.tpl/.yaml}"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
name: minio
2525
env:
2626
- name: MINIO_ROOT_USER
27-
value: "minio"
27+
value: "${MINIO_ROOT_USER}"
2828
- name: MINIO_ROOT_PASSWORD
29-
value: "R9gGSFb4QkZH8LzzS8SECsG66JNX"
29+
value: "${MINIO_ROOT_PASSWORD}"
3030
restartPolicy: Always

0 commit comments

Comments
 (0)