diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..49eaaf4 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,149 @@ +--- +kind: pipeline +type: docker +name: test + +# 挂载的主机卷,可以映射到docker容器中 +volumes: + # maven构建缓存(宿主机目录) + - name: ssh_key + host: + path: /root/.ssh/ + - name: cache + host: + path: /var/lib/cache + - name: data + host: + path: /var/lib/data + +steps: + # - name: restore-cache + # image: drillster/drone-volume-cache + # volumes: + # - name: cache + # path: /cache + # settings: + # restore: true + # mount: + # - ./node_modules + + - name: build + image: node:latest + pull: if-not-exists # default always + # volumes: + # - name: cache + # path: /root/.m2 + commands: + - npm config set registry http://registry.npm.taobao.org + - npm i + - npm run build:test + + # - name: rebuild-cache + # image: drillster/drone-volume-cache + # volumes: + # - name: cache + # path: /cache + # settings: + # rebuild: true + # mount: + # - ./node_modules + + - name: deploy-scp + image: appleboy/drone-scp + pull: if-not-exists + volumes: + - name: ssh_key + path: /root/.ssh/ + settings: + host: test.tall.wiki + port: 22 + username: root + key_path: /root/.ssh/id_rsa + rm: true # true则会删除目标目录重建 + target: /home/check-work + source: dist/* + strip_components: 1 # 去除的目录层数,如果没有该选项,则拷贝过去是 target/xxx.jar,1代表去除target + + # - name: run-ssh + # image: appleboy/drone-ssh + # pull: if-not-exists + # volumes: + # - name: ssh_key + # path: /root/.ssh/ + # settings: + # settings: + # host: test.tall.wiki + # port: 22 + # username: root + # key_path: /root/.ssh/id_rsa + # script_stop: true # stop script after first failure + # #command_timeout: 30s # 30seconds, the maximum amount of time for the execute commands, default is 10 minutes. + # script: + # - cd /home/iacd-platform-drone + # - ./re.sh > /dev/null 2> /dev/null & + + # - name: notify-email + # image: drillster/drone-email + # pull: if-not-exists + # settings: + # host: smtp.qiye.aliyun.com #例如 smtp.qq.com + # port: 465 #例如QQ邮箱端口465 + # username: devops@ccsens.com #邮箱用户名 + # password: #邮箱密码 + # from_secret: orgsecret_password_mail_devops + # from: devops@ccsens.com + # recipients: weizezhao@ccsens.com #收件人,多个用,隔开 + # when: #执行条件 + # status: + # - success + # - changed + # - failure + + - name: notify-wechatwork + image: fifsky/drone-wechat-work + pull: if-not-exists + settings: + url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=428e5c5d-f992-4349-939d-9c99556e50b8 + msgtype: markdown + content: | + {{if eq .Status "success" }} + #### 🎉 ${DRONE_REPO} 构建成功 + > Commit: [${DRONE_COMMIT_MESSAGE}](${DRONE_COMMIT_LINK}) + > Author: ${DRONE_COMMIT_AUTHOR} + > [点击查看](${DRONE_BUILD_LINK}) + {{else}} + #### ❌ ${DRONE_REPO} 构建失败 + > Commit: [${DRONE_COMMIT_MESSAGE}](${DRONE_COMMIT_LINK}) + > Author: ${DRONE_COMMIT_AUTHOR} + > 请立即修复!!! + > [点击查看](${DRONE_BUILD_LINK}) + {{end}} + when: + status: + - failure + - success + +trigger: + branch: develop + # - name: notify-dingtalk + # image: lddsb/drone-dingtalk-message + # environment: + # PASSWORD: + # from_secret: password_mail_devops + # settings: + # token: your-dingtalk-robot-access-token + # type: markdown + # message_color: true + # message_pic: true + # sha_link: true + + # -name: notify-slack + # image: plugins/slack + # webhook: https://hooks.slack.com/ www.dijiuyy.com services/xxx/xxx/xxx + # channel: dev + # template: > + # {{#success build.status}} + # build {{build.number}} succeeded. Good job. + # {{else}} + # build {{build.number}} failed. Fix me please. + # {{/success}} diff --git a/.env.production b/.env.production index b9b103f..fdb41e9 100644 --- a/.env.production +++ b/.env.production @@ -1,10 +1,10 @@ VUE_APP_MODE=production VUE_APP_NODE_ENV=production VUE_APP_SCENE=checkwork -VUE_APP_BASE_URL=https://test.tall.wiki/checkwork/ -VUE_APP_API_URL=https://test.tall.wiki/checkwork/gateway +VUE_APP_BASE_URL=https://www.tall.wiki/checkwork/ +VUE_APP_API_URL=https://www.tall.wiki/checkwork/gateway VUE_APP_PROXY_URL=/gateway VUE_APP_PUBLIC_PATH=/checkwork -VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws +VUE_APP_MSG_URL=wss://www.tall.wiki/websocket/message/v4.0/ws VUE_APP_TITLE=考勤管理 VUE_APP_DESCRIPTION=考勤管理 diff --git a/package.json b/package.json index 9b54bd4..7afe262 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "private": true, "scripts": { "serve": "vue-cli-service serve", - "build": "vue-cli-service build", + "build:test": "vue-cli-service build --mode development", + "build": "vue-cli-service build --mode production", "lint": "vue-cli-service lint" }, "dependencies": {