How to write this shell function? Automatically publish front-end projects

function automatically uploads the files packaged at the front end under my window to the centos directory
simply throws my files to the specified directory without jenkins

May.22,2021

give me an idea

  1. execute the build script to compile the file
  2. After
  3. build is executed, call scp to copy the file directly to the service directory

wrote a simple sync script, you can refer to

var fs = require('fs')
var path = require('path')
var cp = require('child_process')

function release(src, dist, remote) {
  var script = `scp ${src} ${remote}/${dist}`
  cp.exec(script, function (err, stdout, stderr) {
      if (err) {
        console.log(`error: ${err}`)
        return
      }
      console.log(`stdout: ${stdout}`)
      console.log(`stderr: ${stderr}`)
  })
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3f8df-2c48a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3f8df-2c48a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?