Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: shell scripts #7189

Merged
merged 3 commits into from
Feb 19, 2024
Merged

fix: shell scripts #7189

merged 3 commits into from
Feb 19, 2024

Conversation

martabal
Copy link
Member

@martabal martabal commented Feb 18, 2024

optimize start.sh, format files and fix an incorrect variable introduced in #7186 (DB_PASSWORD is set twice)

@martabal martabal changed the title fix: bash scripts fix: shell scripts Feb 18, 2024
@martabal martabal requested review from jrasm91 and mertalev February 18, 2024 23:23
Copy link

cloudflare-workers-and-pages bot commented Feb 18, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 11f0c3e
Status: ✅  Deploy successful!
Preview URL: https://0e3ddafa.immich.pages.dev
Branch Preview URL: https://fix-bash-optimization.immich.pages.dev

View logs

server/start.sh Outdated
Comment on lines 3 to 15
read_file_and_export() {
if [ "$1" ]; then
content="$(cat "$1")"
export "$2"="$content"
unset "$1"
fi
}

read_file_and_export "DB_URL_FILE" "DB_URL"
read_file_and_export "DB_HOSTNAME_FILE" "DB_HOSTNAME"
read_file_and_export "DB_DATABASE_NAME_FILE" "DB_DATABASE_NAME"
read_file_and_export "DB_USERNAME_FILE" "DB_USERNAME"
read_file_and_export "DB_PASSWORD_FILE" "DB_PASSWORD"
read_file_and_export "REDIS_PASSWORD_FILE" "REDIS_PASSWORD"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooooh, fancy

@martabal martabal force-pushed the fix/bash-optimization branch from 78a31b3 to d2cc006 Compare February 18, 2024 23:50
@martabal martabal force-pushed the fix/bash-optimization branch from d2cc006 to 763aa10 Compare February 18, 2024 23:50
@martabal martabal force-pushed the fix/bash-optimization branch from b1b7499 to 11f0c3e Compare February 19, 2024 00:25
@alextran1502 alextran1502 merged commit 66d3daa into main Feb 19, 2024
26 checks passed
@alextran1502 alextran1502 deleted the fix/bash-optimization branch February 19, 2024 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants