Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trainee-schedule
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Đoàn Vũ Bình Dương
trainee-schedule
Commits
0b5e2d41
Commit
0b5e2d41
authored
Apr 13, 2026
by
Nguyễn Thị Nguyệt Quế
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tag]staging
parent
dd266982
Pipeline
#48856
passed with stage
in 35 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
.gitlab-ci.yml
.gitlab-ci.yml
+36
-0
pm2-be.config.js
pm2-be.config.js
+20
-0
No files found.
.gitlab-ci.yml
0 → 100644
View file @
0b5e2d41
stages
:
-
deploy
variables
:
APP_PATH
:
"
$CI_PROJECT_DIR"
PM2_CONFIG
:
"
$CI_PROJECT_DIR/pm2-be.config.js"
STAGING_URL
:
"
https://vietprodev.duckdns.org/gateway/trainee-schedule-backend"
HEALTH_URL
:
"
$STAGING_URL/health"
# Deploy to Staging
deploy
:
stage
:
deploy
before_script
:
-
mkdir -p storage/log ||
true
-
check=$(echo "$CI_COMMIT_MESSAGE" | sed -nE 's/^.*(\[tag\]staging).*$/\1/p')
-
|
if [ "$check" != "[tag]staging" ]; then
echo "Commit message does not contain [tag]staging → skip pipeline"
exit 0
fi
script
:
-
cp /mnt/data/trainee-schedule-backend/.env $CI_PROJECT_DIR/.env
-
pnpm install --no-frozen-lockfile
-
pnpm build:staging
-
pm2 delete trainee-schedule-backend ||
true
-
pm2 start $PM2_CONFIG
-
sleep 10
-
pm2 status trainee-schedule-backend | grep -q "online" || (echo "Server did not start successfully"; exit 1)
only
:
-
release/staging
environment
:
name
:
staging
url
:
$STAGING_URL
tags
:
-
runner-vpd-que
pm2-be.config.js
0 → 100644
View file @
0b5e2d41
module
.
exports
=
{
apps
:
[
{
name
:
"trainee-schedule-backend"
,
script
:
"node"
,
args
:
"dist/index.js"
,
autorestart
:
true
,
watch
:
false
,
max_restarts
:
10
,
instances
:
1
,
exec_mode
:
'fork'
,
env
:
{
NODE_ENV
:
"staging"
,
PORT
:
3010
,
},
env_file
:
".env"
,
merge_logs
:
true
}
]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment