Skip to content

Commit 334a355

Browse files
committed
chore: refactored deploy shell script
1 parent f389d6f commit 334a355

File tree

6 files changed

+40
-1
lines changed

6 files changed

+40
-1
lines changed

β€Ž.gitignoreβ€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# ignore secret keys
2+
deploy-scripts/vault-secrets
3+
14
# ignore settings for yarn berry zero install
25
.yarn/*
36
!.yarn/cache
@@ -29,4 +32,4 @@ dist-ssr
2932
*.sln
3033
*.sw?
3134

32-
.env
35+
.env
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
source ./config.sh
3+
4+
cd ${BACKEND_DIR}
5+
npm run build
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
source ./config.sh
3+
4+
cd ${FRONTEND_DIR}
5+
npm run build

β€Ždeploy-scripts/config.shβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
PROJECT_BASE_DIR=/home/wabuser/wabinar
3+
FRONTEND_DIR=${PROJECT_BASE_DIR}/client
4+
BACKEND_DIR=${PROJECT_BASE_DIR}/server
5+
VAULT_KEY_FILE=${PROJECT_BASE_DIR}/deploy-scripts/vault-secrets/keys
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
source ./config.sh
3+
4+
source ${VAULT_KEY_FILE}
5+
6+
cd ${FRONTEND_DIR}
7+
if [ ! -f ./.env.me ]; then
8+
npx dotenv-vault login ${VAULT_FRONTEND_KEY} > /dev/null
9+
fi
10+
11+
cd ${BACKEND_DIR}
12+
if [ ! -f ./.env.me ]; then
13+
npx dotenv-vault login ${VAULT_BACKEND_KEY} > /dev/null
14+
fi
15+
16+
echo "dotenv-vault login done"

β€Ždeploy.shβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
cd deploy-scripts
3+
(source try-dotenv-vault-login.sh)
4+
(source build-backend.sh)
5+
(source build-frontend.sh)

0 commit comments

Comments
Β (0)