General Settings
Name: build_vue_admin
ID: buildVueAdmin
Description: none
Build configuration type: regular
Build number format: %build.counter%, next build number: #144
Publish artifacts: Even if build fails
Artifact paths:
none specified
Build options:
Enable hanging builds detection: ON
Allow triggering personal builds: ON
Enable status widget: OFF
Running builds limit:
per build configuration: unlimited
per branch: *:0
Version Control Settings (1)
VCS checkout mode: Prefer to checkout files on agent (recommended)
Checkout directory: default
Delete all files in the checkout directory before the build: OFF
Attached VCS roots:
VCS Root Checkout Rules
(git) https://www.gitea.com/vue_admin.git#refs/heads/master belongs to 888999
Commit hook is inactive
Changes checking interval: 1m
not specified
Show changes from snapshot dependencies: OFF
Exclude default branch changes: OFF
Branch filter: +:*
3.构建Setup
Step 1: npm
exportNVM_DIR="$HOME/.nvm"[-s"$NVM_DIR/nvm.sh"]&&\. "$NVM_DIR/nvm.sh"# This loads nvm#nvm install 16
nvm use 16npminstall-gyarnyarn--versionnpm config set strict-ssl falsenpm config set registry https://registry.npmmirror.com
npm cache clean --forcerm-rf node_modules package-lock.json dist
npminstall--forcenpm run build
tar-czvf vue_admin.tar.gz -C dist .
Step 2: ssh_backup
Runner type: SSH Exec (Runner able to execute commands over SSH)
Execute: If all previous steps finished successfully
Target host: 172.10.10.126
Target port: default
Use pty: none
Username: root
Commands: sh /data/sh/vue_admin_backup.sh
Step 3: ssh_upload
Runner type: SSH Upload (Deploys files/directories via SSH)
Execute: If all previous steps finished successfully
Target host: 172.10.10.126:/data/wwwroot/
Target port: default
Username: root
Transport: SCP
Source: %system.teamcity.build.workingDir%/vue_admin.tar.gz
Step 4: ssh_replace
Runner type: SSH Exec (Runner able to execute commands over SSH)
Execute: If all previous steps finished successfully
Target host: 172.10.10.126
Target port: default
Use pty: none
Username: root
Commands: rm-rf /data/wwwroot/vue_admin/* &&cd /data/wwwroot/ &&tar-zxvf vue_admin.tar.gz -C /data/wwwroot/vue_admin/ &&rm-rf /data/wwwroot/vue_admin.tar.gz