It's a small, fast utility for SSH and Sftp.
Deploying your project to the server uses Slash
.
Slash uses a config-[alias].yml
file in the current directory.
slash [alias]
chmod u+x slash
slash dev
Uses the config-dev.yml
file in the current directory.
- host: wuhit.com
port: 22
user: dev
password: slash
tasks:
- alias: web
remoteDir: /root
localPath: /Users/zhaoxin/Pictures/wuhit.jar
beforeCommand: pwd
afterCommand: ls
- host: wuhit.com
port: 22
user: dev
password: slash
mfa:
secret: D4DDFZ2TCUO26Ri2
tasks:
- alias: web
remoteDir: /root
localPath: /Users/zhaoxin/Pictures/wuhit.jar
beforeCommand: pwd
afterCommand: ls
- host: js.wuhit.com
port: 2222
user: jumpServerUser@[email protected]
password: jumpServerPassword
tasks:
- alias: web
remoteDir: test-192.169.0.1
localPath: /Users/zhaoxin/Pictures/F6zHvUFWgAA-dj-.jpeg
beforeCommand: pwd
afterCommand: ls
- host: js.wuhit.com
port: 2222
user: jumpServerUser@[email protected]
password: jumpServerPassword
mfa:
secret: D4DDFZ2TCUO26Ri2
tasks:
- alias: web
remoteDir: test-192.169.0.1
localPath: /Users/zhaoxin/Pictures/F6zHvUFWgAA-dj-.jpeg
beforeCommand: pwd
afterCommand: ls
#!/bin/bash
jar_name=demo-0.0.1-SNAPSHOT
pid=$(jps -ml | grep "$jar_name" | awk '{print $1}')
echo "$jar_name pid: $pid"
if [ -n "$pid" ]; then
kill -9 $pid
fi
nohup java -jar ./${jar_name}.jar > /dev/null 2>&1 &
pid=$(jps -ml | grep "$jar_name" | awk '{print $1}')
echo "$jar_name pid: $pid"