Skip to content

Commit 76cb28b

Browse files
committed
feat: add db file name into env variables
1 parent 98f8a1d commit 76cb28b

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ KIBANA_PORT=5601
5454
## REMOTE REPOSITORY
5555
GIT_SSH_URL="[email protected]:cslant"
5656
GIT_TOKEN=
57+
DATABASE_FILE_NAME=cslant_blog
5758

5859
# ##################### DOMAIN SETTING ######################
5960
CSLANT_DOMAIN=cslant.com.local

setup/resource.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ resource_database() {
4141
echo '» 🚀 Downloading database file... 🚀'
4242
DATABASE_PATH="$CURRENT_DIR/postgres/entry.d"
4343

44-
if [ -f "$DATABASE_PATH/cslant_blog.sql" ]; then
44+
if [ -f "$DATABASE_PATH/$DATABASE_FILE_NAME.sql" ]; then
4545
echo "» Database file already exists"
4646
echo ''
4747
return
@@ -50,5 +50,5 @@ resource_database() {
5050
curl \
5151
-H "Authorization: token $GITHUB_TOKEN" \
5252
-L https://raw.githubusercontent.com/cslant-community/blog-storage/docker/database/postgres/cslant_blog.sql \
53-
-o "$DATABASE_PATH/cslant_blog.sql"
53+
-o "$DATABASE_PATH/$DATABASE_FILE_NAME.sql"
5454
}

setup/variables.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ BLOG_PACKAGE_REPO_NAMES=(
1616
'blog-api-package'
1717
'blog-core'
1818
)
19+
20+
# shellcheck disable=SC2034
21+
DATABASE_FILE_NAME=${DATABASE_FILE_NAME:-cslant_blog}

0 commit comments

Comments
 (0)