car4s/.drone.yml
孟凡懂 efc681ba9f
Some checks failed
continuous-integration/drone/push Build is failing
3333
2022-06-29 12:57:07 +08:00

62 lines
1.4 KiB
YAML

---
kind: pipeline
type: ssh
name: "服务器部署"
server:
host: 110.40.192.42:8022
user: root
ssh_key:
from_secret: SSH_KEY
clone:
disable: true
steps:
- name: "Git 设置"
environment:
GIT_NAME:
from_secret: GIT_NAME
GIT_PASSWD:
from_secret: GIT_PASSWD
commands:
- cd /www/wwwroot/car.des8.com
- git remote rm origin
- git remote add origin http://$GIT_NAME:$GIT_PASSWD@git.des8.com/$GIT_NAME/car4s.git
- name: "Clone 代码"
commands:
- cd /www/wwwroot/car.des8.com
- pwd && ls -l
- git pull origin master
- name: "设置Env配置"
commands:
- cd /www/wwwroot/car.des8.com
- echo "[app]" > .env
- echo "debug = false" >> .env
- echo "trace = false" >> .env
- echo "[database]" >> .env
- echo "hostname = 127.0.0.1" >> .env
- echo "database = car_des8_com" >> .env
- echo "username = car_des8_com" >> .env
- echo "password = eSfcCeDH76zC3MLG" >> .env
- echo "hostport = 3306" >> .env
- echo "prefix = car_" >> .env
- echo "debug = false" >> .env
- cat .env
- name: "更改文件权限"
commands:
- cd /www/wwwroot/car.des8.com
- rm -rf ./runtime/cache
- rm -rf ./runtime/cache
- rm -rf ./public/.user.ini
- chown -R www:www ./
- echo "open_basedir=/www/wwwroot/car.des8.com/:/tmp/" > ./public/.user.ini
- pwd && ls -l
trigger:
branch:
- master