Compare commits
25 Commits
c88a5f18df
...
dev
Author | SHA1 | Date | |
---|---|---|---|
ce16b3396c | |||
eca130ebcc | |||
36986d8438 | |||
f632dca052 | |||
9638ba18e6 | |||
5948c5174a | |||
627d64601a | |||
a12add3225 | |||
3b870afa24 | |||
3f0fe051fc | |||
9397a45351 | |||
f80f3f5039 | |||
765198c4c7 | |||
3b1e08b6e6 | |||
c902a0a404 | |||
50cd862586 | |||
7c443c6ea2 | |||
44f5081623 | |||
b8710db94f | |||
e9af1269d5 | |||
151ea36640 | |||
eb1553507b | |||
19ccbfde29 | |||
c676a158c0 | |||
c6d9e84c65 |
@ -3,8 +3,9 @@ type: docker # 当前管道的类型
|
|||||||
name: test # 当前管道的名称
|
name: test # 当前管道的名称
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
# 第一步:构建项目
|
# 第一步:构建项目
|
||||||
- name: 构建
|
- name: 构建项目
|
||||||
image: node:18-alpine
|
image: node:18-alpine
|
||||||
commands:
|
commands:
|
||||||
- npm install
|
- npm install
|
||||||
@ -13,19 +14,21 @@ steps:
|
|||||||
- name: node_modules_cache
|
- name: node_modules_cache
|
||||||
path: /drone/src/node_modules
|
path: /drone/src/node_modules
|
||||||
|
|
||||||
# 第二步:上传静态资源到腾讯云COS
|
# 第二步:上传静态资源到腾讯云COS (使用另一个插件)
|
||||||
- name: 上传到腾讯云
|
- name: 静态资源上传到cos
|
||||||
image: ccr.ccs.tencentyun.com/dronestock/cos
|
image: ccr.ccs.tencentyun.com/xiaoqidun/gocos
|
||||||
settings:
|
settings:
|
||||||
endpoint: https://files-1302416092.cos.ap-shanghai.myqcloud.com
|
secret_id:
|
||||||
secret:
|
from_secret: cos_secret_id
|
||||||
id:
|
secret_key:
|
||||||
from_secret: cos_secret_id
|
from_secret: cos_secret_key
|
||||||
key:
|
bucket_url: https://files-1302416092.cos.ap-shanghai.myqcloud.com
|
||||||
from_secret: cos_secret_key
|
source: dist
|
||||||
|
target: /test
|
||||||
|
strip_prefix: dist
|
||||||
|
|
||||||
# 第三步:部署到服务器
|
# 第三步:部署到服务器
|
||||||
- name: deploy
|
- name: 清除服务器缓存
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host:
|
host:
|
||||||
@ -49,7 +52,7 @@ steps:
|
|||||||
- dev
|
- dev
|
||||||
|
|
||||||
# 第四步:上传构建文件
|
# 第四步:上传构建文件
|
||||||
- name: upload
|
- name: 上传构建文件
|
||||||
image: appleboy/drone-scp
|
image: appleboy/drone-scp
|
||||||
settings:
|
settings:
|
||||||
host:
|
host:
|
||||||
|
@ -4,8 +4,8 @@ name: test # 当前管道的名称
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
# 第一步:构建项目
|
# 第一步:构建项目
|
||||||
- name: build
|
- name: 构建
|
||||||
image: ccr.ccs.tencentyun.com/library/node:18-alpine
|
image: node:18-alpine
|
||||||
commands:
|
commands:
|
||||||
- npm install
|
- npm install
|
||||||
- npm run build
|
- npm run build
|
||||||
@ -13,30 +13,18 @@ steps:
|
|||||||
- name: node_modules_cache
|
- name: node_modules_cache
|
||||||
path: /drone/src/node_modules
|
path: /drone/src/node_modules
|
||||||
|
|
||||||
# 第二步:上传静态资源到腾讯云COS
|
# 第二步:上传静态资源到腾讯云COS (使用另一个插件)
|
||||||
- name: upload-to-cos
|
- name: 上传到腾讯云
|
||||||
image: tencentcloudcli/coscmd:latest
|
image: ccr.ccs.tencentyun.com/xiaoqidun/gocos
|
||||||
environment:
|
settings:
|
||||||
COS_SECRET_ID:
|
secret_id:
|
||||||
from_secret: cos_secret_id
|
from_secret: cos_secret_id
|
||||||
COS_SECRET_KEY:
|
secret_key:
|
||||||
from_secret: cos_secret_key
|
from_secret: cos_secret_key
|
||||||
COS_REGION:
|
bucket_url: https://files-1302416092.cos.ap-shanghai.myqcloud.com
|
||||||
from_secret: cos_region
|
source: dist
|
||||||
COS_BUCKET:
|
target: /test
|
||||||
from_secret: cos_bucket
|
strip_prefix: dist
|
||||||
commands:
|
|
||||||
# 配置coscmd
|
|
||||||
- coscmd config -a $${COS_SECRET_ID} -s $${COS_SECRET_KEY} -b $${COS_BUCKET} -r $${COS_REGION}
|
|
||||||
# 上传public文件夹下的所有文件
|
|
||||||
- coscmd upload -r public/ /static/
|
|
||||||
# 设置文件访问权限为公共读
|
|
||||||
- coscmd putobjectacl -r /static/ public-read
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
- dev
|
|
||||||
|
|
||||||
# 第三步:部署到服务器
|
# 第三步:部署到服务器
|
||||||
- name: deploy
|
- name: deploy
|
||||||
|
61
.drone.yml
61
.drone.yml
@ -1,37 +1,29 @@
|
|||||||
kind: pipeline # 定义一个管道
|
kind: pipeline
|
||||||
type: docker # 当前管道的类型
|
type: docker
|
||||||
name: test # 当前管道的名称
|
name: test
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# 第一步:构建项目
|
|
||||||
- name: 构建
|
- name: 构建项目
|
||||||
image: node:18-alpine
|
image: node:18-alpine
|
||||||
commands:
|
commands:
|
||||||
- npm install
|
- rm -rf node_modules
|
||||||
|
- npm ci
|
||||||
- npm run build
|
- npm run build
|
||||||
volumes:
|
|
||||||
- name: node_modules_cache
|
|
||||||
path: /drone/src/node_modules
|
|
||||||
|
|
||||||
# 第二步:上传静态资源到腾讯云COS
|
- name: 静态资源上传到cos
|
||||||
- name: 上传到腾讯云
|
image: ccr.ccs.tencentyun.com/xiaoqidun/gocos
|
||||||
image: ccr.ccs.tencentyun.com/dronestock/cos
|
|
||||||
settings:
|
settings:
|
||||||
endpoint: https://files-1302416092.cos.ap-shanghai.myqcloud.com
|
secret_id:
|
||||||
source: dist/*
|
from_secret: cos_secret_id
|
||||||
secret:
|
secret_key:
|
||||||
id:
|
from_secret: cos_secret_key
|
||||||
from_secret: cos_secret_id
|
bucket_url: https://files-1302416092.cos.ap-shanghai.myqcloud.com
|
||||||
key:
|
source: dist
|
||||||
from_secret: cos_secret_key
|
target: /test
|
||||||
when:
|
strip_prefix: dist
|
||||||
branch:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
- dev
|
|
||||||
|
|
||||||
# 第三步:部署到服务器
|
- name: 清除服务器缓存
|
||||||
- name: deploy
|
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host:
|
host:
|
||||||
@ -40,9 +32,6 @@ steps:
|
|||||||
from_secret: server_username
|
from_secret: server_username
|
||||||
password:
|
password:
|
||||||
from_secret: server_password
|
from_secret: server_password
|
||||||
# 或者使用SSH密钥
|
|
||||||
# key:
|
|
||||||
# from_secret: server_ssh_key
|
|
||||||
port: 22
|
port: 22
|
||||||
script:
|
script:
|
||||||
- rm -rf /www/wwwroot/show.zguiy.com/*
|
- rm -rf /www/wwwroot/show.zguiy.com/*
|
||||||
@ -54,8 +43,7 @@ steps:
|
|||||||
- master
|
- master
|
||||||
- dev
|
- dev
|
||||||
|
|
||||||
# 第四步:上传构建文件
|
- name: 上传构建文件
|
||||||
- name: upload
|
|
||||||
image: appleboy/drone-scp
|
image: appleboy/drone-scp
|
||||||
settings:
|
settings:
|
||||||
host:
|
host:
|
||||||
@ -64,9 +52,6 @@ steps:
|
|||||||
from_secret: server_username
|
from_secret: server_username
|
||||||
password:
|
password:
|
||||||
from_secret: server_password
|
from_secret: server_password
|
||||||
# 或者使用SSH密钥
|
|
||||||
# key:
|
|
||||||
# from_secret: server_ssh_key
|
|
||||||
port: 22
|
port: 22
|
||||||
source: dist/*
|
source: dist/*
|
||||||
target: /www/wwwroot/show.zguiy.com/
|
target: /www/wwwroot/show.zguiy.com/
|
||||||
@ -77,13 +62,9 @@ steps:
|
|||||||
- master
|
- master
|
||||||
- dev
|
- dev
|
||||||
|
|
||||||
# 定义数据卷用于缓存node_modules
|
# 移除 node_modules 缓存挂载
|
||||||
volumes:
|
# volumes: 已删除
|
||||||
- name: node_modules_cache
|
|
||||||
host:
|
|
||||||
path: /tmp/drone_cache/node_modules
|
|
||||||
|
|
||||||
# 触发条件
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
|
@ -1 +1 @@
|
|||||||
VITE_PUBLIC = https://cdn.files.zguiy.com/static/
|
VITE_PUBLIC = https://cdn.files.zguiy.com/test/
|
7
main.go
7
main.go
@ -1,7 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import "fmt"
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
fmt.Printf("Hello World from Test!");
|
|
||||||
}
|
|
@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import HelloWorld from './components/HelloWorld.vue'
|
import HelloWorld from './components/HelloWorld.vue'
|
||||||
|
const a="符合法1134353453311333规计划"
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ onMounted(()=>{
|
|||||||
console.log('所有环境变量:', import.meta);
|
console.log('所有环境变量:', import.meta);
|
||||||
|
|
||||||
url.value = publicPath + 'ui/背景.png'
|
url.value = publicPath + 'ui/背景.png'
|
||||||
console.log('最终图片路径:', url.value);
|
console.log('1最终图片路径:', url.value);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,12 +2,14 @@
|
|||||||
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||||
|
"target": "ES2020",
|
||||||
|
"module": "ES2020",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"erasableSyntaxOnly": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUncheckedSideEffectImports": true
|
"noUncheckedSideEffectImports": true
|
||||||
},
|
},
|
||||||
|
@ -6,7 +6,7 @@ export default defineConfig(({ mode }) => {
|
|||||||
const env = loadEnv(mode, process.cwd());
|
const env = loadEnv(mode, process.cwd());
|
||||||
|
|
||||||
return {
|
return {
|
||||||
base: './', //打包后的相对路径
|
base: env.VITE_PUBLIC || './', //使用环境变量设置资源路径,默认为相对路径
|
||||||
|
|
||||||
server: {
|
server: {
|
||||||
host: true,
|
host: true,
|
||||||
|
Reference in New Issue
Block a user