Sfoglia il codice sorgente

创建10个随机账户

guoyujing 1 mese fa
parent
commit
10bed0e3a5
2 ha cambiato i file con 40 aggiunte e 0 eliminazioni
  1. 29 0
      accounts/aitori-create-stylists.sh
  2. 11 0
      accounts/aitori-stylist-accounts.tsv

+ 29 - 0
accounts/aitori-create-stylists.sh

@@ -0,0 +1,29 @@
+#!/bin/sh
+set -eu
+
+script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
+project_dir=$(CDPATH= cd -- "$script_dir/.." && pwd)
+compose_dir="$project_dir/docker"
+compose_file="${COMPOSE_FILE:-docker-compose.yml}"
+accounts_file="$script_dir/aitori-stylist-accounts.tsv"
+
+if [ ! -r "$accounts_file" ]; then
+  echo "凭据文件不存在或不可读: $accounts_file" >&2
+  exit 1
+fi
+
+cd "$compose_dir"
+
+tail -n +2 "$accounts_file" | while IFS="$(printf '\t')" read -r id username email password; do
+  [ -n "$id" ] || continue
+
+  echo "Creating account: $email"
+  docker compose -f "$compose_file" exec -T \
+    -e INITIAL_STYLIST_ID="$id" \
+    -e INITIAL_STYLIST_USERNAME="$username" \
+    -e INITIAL_STYLIST_EMAIL="$email" \
+    -e INITIAL_STYLIST_PASSWORD="$password" \
+    backend node /app/prisma/seed-initial.cjs < /dev/null
+done
+
+echo 'Account import finished.'

+ 11 - 0
accounts/aitori-stylist-accounts.tsv

@@ -0,0 +1,11 @@
+id	username	email	password
+2	6tV7j	6tV7j@aitori.jp	BfsJsiCZ
+3	6Asf8	6Asf8@aitori.jp	tntt5xdy
+4	YLkcK	YLkcK@aitori.jp	cI9OM4h4
+5	vOoUv	vOoUv@aitori.jp	goD63Qxx
+6	kGwI1	kGwI1@aitori.jp	vYmwrfcD
+7	f1ITr	f1ITr@aitori.jp	c8jTWZqD
+8	3m1D7	3m1D7@aitori.jp	LVBeY87f
+9	8XTkL	8XTkL@aitori.jp	BijpayZD
+10	DUbN7	DUbN7@aitori.jp	PhKWU0Gh
+11	jbmR7	jbmR7@aitori.jp	mnMKMD0f