iT邦幫忙

2019 iT 邦幫忙鐵人賽

DAY 28
0
自我挑戰組

Some thing with Reason系列 第 28

Reason-Work with Drone

Work With Drone

drone.yml

pipeline:
  scp:
    image: appleboy/drone-scp
    pull: true
    host: 
      - your server ip
    port: 22
    username: root
    user: root
    secrets: [ ssh_password ]
    target: /root
    source:
      - $DRONE_DIR
    when:
      branch: master

  ssh:
    image: appleboy/drone-ssh
    host: 
      - your server ip
    username: root
    user: root
    secrets: [ ssh_password ]
    command_timeout: 600
    script:
      - . /root/.nvm/nvm.sh && nvm use 10.9.0
      - mkdir -p Your target path
      - cd /root/$DRONE_DIR
      - yarn install
      - npm run webpack:production
      - cp -a build/* Your target path
      - cd /root
      - rm -rf /root/drone
    when:
      branch: master

這個範例代表當你的 master 有被push 的時候觸發 pipe 流程

會依序執行

問題

我在 linode 的 ubuntu 16 的 server

安裝 bs-platform 的時候遇到 node: permission denied 的問題

解法

code

github

Nginx

server {
  server_name  YourDomain;

  root /var/www/html/YourDomain;
  index index.html index.htm index.php;

  location / {
          try_files $uri $uri/ =404;
  }
}

然後要註冊一個 domain 指向你的 IP

Demo

demo

這樣只要有 push

就可以自動更新上去囉

方便吧!!!


上一篇
Reason-Publish
下一篇
ReasonReact- Lifecycle
系列文
Some thing with Reason30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言