🌟 Github Action과 시스템 올 그린! 발진 준비완료!
This commit is contained in:
parent
2ba9b8ee32
commit
3a888af951
5 changed files with 53 additions and 7 deletions
31
app/gen-config.sh
Normal file
31
app/gen-config.sh
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Required environment variables
|
||||
required_vars=("BOT_ROOT" "BOT_INSTAGRAM_ID" "BOT_INSTAGRAM_PASSWORD" "BOT_KEY" "BOT_WEBHOOK_URL")
|
||||
|
||||
# Check for missing environment variables
|
||||
missing_vars=()
|
||||
for var in "${required_vars[@]}"; do
|
||||
if [ -z "${!var}" ]; then
|
||||
missing_vars+=("$var")
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${#missing_vars[@]} -ne 0 ]; then
|
||||
echo "Error: Missing required environment variables:"
|
||||
printf '%s\n' "${missing_vars[@]}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate config.json
|
||||
cat > config.json << EOF
|
||||
{
|
||||
"ROOT": "${BOT_ROOT}",
|
||||
"INSTAGRAM_ID": "${BOT_INSTAGRAM_ID}",
|
||||
"INSTAGRAM_PASSWORD": "${BOT_INSTAGRAM_PASSWORD}",
|
||||
"KEY": "${BOT_KEY}",
|
||||
"WEBHOOK_URL": "${BOT_WEBHOOK_URL}"
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "Successfully generated config.json"
|
||||
Loading…
Add table
Add a link
Reference in a new issue