nginx启动、停止和重启(二)

简介: nginx启动、停止和重启

nginx启动、停止和重启(一):https://developer.aliyun.com/article/1483532


重点是配置Jenkins:


1.配置全局jdk maven git

点Manage Jenkins(系统管理) --> Global Tool Configuaration(全局工具配置)

1.maven配置:配置settings.xml地址

2.配置jdk地址 (可以用echo $JAVA_HOME获取)

3.git配置地址 可以用(which -a git查看)

4.maven配置地址


2.新建任务


3.配置任务


1.配置源码管理 下面version是gitlab的版本号

Repository URL:访问的仓库名称 Credentials:访问账目密码或者ssh证书
Branch Specifier (blank for ‘any’):访问的分支,可以多个
源码库浏览器:选择源码库服务器
URL:源码仓库url
Version:源码库服务器版本号

2.配置构建

clean compile package install deploy -Dmaven.test.skip=true -U #将jar发布

然后应用,配置完成!

3.在my view(我的视图) -> 找到新建的项目 --> 点击build now(立即构建)

在构建历史中点击刚刚的构建如下图: #1 : 是构建的id ,控制台输出: 可以看到具体的输出


下面是输入日志 可以看到以前拉取到指定的项目master分支

Started by user root
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/first
using credential fad2813a-c894-4386-ae16-11d6e6d349d4
Cloning the remote Git repository
Cloning repository http://192.168.20.137:9029/root/wx-ssm.git
> /usr/local/git/bin/git init /var/lib/jenkins/workspace/first # timeout=10
Fetching upstream changes from http://192.168.20.137:9029/root/wx-ssm.git
> /usr/local/git/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials
> /usr/local/git/bin/git fetch --tags --progress http://192.168.20.137:9029/root/wx-ssm.git +refs/heads/*:refs/remotes/origin/*
> /usr/local/git/bin/git config remote.origin.url http://192.168.20.137:9029/root/wx-ssm.git # timeout=10
> /usr/local/git/bin/git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
> /usr/local/git/bin/git config remote.origin.url http://192.168.20.137:9029/root/wx-ssm.git # timeout=10
Fetching upstream changes from http://192.168.20.137:9029/root/wx-ssm.git
using GIT_ASKPASS to set credentials
> /usr/local/git/bin/git fetch --tags --progress http://192.168.20.137:9029/root/wx-ssm.git +refs/heads/*:refs/remotes/origin/*
> /usr/local/git/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> /usr/local/git/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 47d13c3ca0bc12fc0465c3e4c582b2c542276eb6 (refs/remotes/origin/master)
> /usr/local/git/bin/git config core.sparsecheckout # timeout=10
> /usr/local/git/bin/git checkout -f 47d13c3ca0bc12fc0465c3e4c582b2c542276eb6
Commit message: "更新 pom.xml"
First time build. Skipping changelog.
[first] $ /project/java/maven/apache-maven-3.6.1/bin/mvn -s /project/java/maven/apache-maven-3.6.1/conf/settings.xml -gs /project/java/maven/apache-maven-3.6.1/conf/settings.xml clean package
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.guojin:gjmetal-wx-ssm:jar:1.0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.httpcomponents:httpclient:jar -> version (?) vs 4.5.6 @ line 155, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ---------------------< com.guojin:gjmetal-wx-ssm >----------------------
[INFO] Building gjmetal-wx-ssm 1.0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ gjmetal-wx-ssm ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.9:prepare-agent (pre-test) @ gjmetal-wx-ssm ---
[INFO] argLine set to -javaagent:/var/lib/jenkins/.m2/repository/org/jacoco/org.jacoco.agent/0.7.9/org.jacoco.agent-0.7.9-runtime.jar=destfile=/var/lib/jenkins/workspace/first/target/jacoco.exec,includes=com.gjmetal.*
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gjmetal-wx-ssm ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ gjmetal-wx-ssm ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 27 source files to /var/lib/jenkins/workspace/first/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /var/lib/jenkins/workspace/first/src/main/java/com/gjmetal/Swagger2.java:[4,40] 程序包org.fuelteam.springboot.swagger2不存在
[ERROR] /var/lib/jenkins/workspace/first/src/main/java/com/gjmetal/Swagger2.java:[21,2] 找不到符号
  符号: 类 EnableSwagger2
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.183 s
[INFO] Finished at: 2019-08-23T17:05:09+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project gjmetal-wx-ssm: Compilation failure: Compilation failure:
[ERROR] /var/lib/jenkins/workspace/first/src/main/java/com/gjmetal/Swagger2.java:[4,40] 程序包org.fuelteam.springboot.swagger2不存在
[ERROR] /var/lib/jenkins/workspace/first/src/main/java/com/gjmetal/Swagger2.java:[21,2] 找不到符号
[ERROR]   符号: 类 EnableSwagger2
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE

上面报错是项目问题,可以看到已经拉取到项目了。所以要保证项目的正确性。


下面是正确的两个项目运行实例


在搭建好gitlab nexus jenkins后实现自动发jar到私服及启动jar项目


背景: gitlab nexus jenkins都已经完成了

1.从gitlab下载项目后发布jar到私服


重新配置gitlab地址:

配置maven命令:

clean compile package install deploy -Dmaven.test.skip=true -U


点击build now 然后看控制台输出如下

Started by user root
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/maven_home
using credential fad2813a-c894-4386-ae16-11d6e6d349d4
> /usr/local/git/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/local/git/bin/git config remote.origin.url http://192.168.20.143:8083/root/maven_demo.git # timeout=10
Fetching upstream changes from http://192.168.20.143:8083/root/maven_demo.git
> /usr/local/git/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials
> /usr/local/git/bin/git fetch --tags --progress http://192.168.20.143:8083/root/maven_demo.git +refs/heads/*:refs/remotes/origin/*
> /usr/local/git/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> /usr/local/git/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision a26adc740d331eabe5b0fb2a46b372dbf6673d2c (refs/remotes/origin/master)
> /usr/local/git/bin/git config core.sparsecheckout # timeout=10
> /usr/local/git/bin/git checkout -f a26adc740d331eabe5b0fb2a46b372dbf6673d2c
Commit message: "Update pom.xml"
> /usr/local/git/bin/git rev-list --no-walk a26adc740d331eabe5b0fb2a46b372dbf6673d2c # timeout=10
[maven_home] $ /project/java/maven/apache-maven-3.6.1/bin/mvn -s /project/java/maven/apache-maven-3.6.1/conf/settings.xml -gs /project/java/maven/apache-maven-3.6.1/conf/settings.xml clean compile package install deploy -Dmaven.test.skip=true -U
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.netease:maven_test_demo >---------------------
[INFO] Building maven_test_demo 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ maven_test_demo ---
[INFO] Deleting /var/lib/jenkins/workspace/maven_home/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven_test_demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/maven_home/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ maven_test_demo ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /var/lib/jenkins/workspace/maven_home/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven_test_demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/maven_home/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ maven_test_demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ maven_test_demo ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ maven_test_demo ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ maven_test_demo ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ maven_test_demo ---
[INFO] Building jar: /var/lib/jenkins/workspace/maven_home/target/maven_test_demo-1.0.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven_test_demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/maven_home/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ maven_test_demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ maven_test_demo ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ maven_test_demo ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ maven_test_demo ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ maven_test_demo ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ maven_test_demo ---
[INFO] Installing /var/lib/jenkins/workspace/maven_home/target/maven_test_demo-1.0.0-SNAPSHOT.jar to /var/lib/jenkins/.m2/repository/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-SNAPSHOT.jar
[INFO] Installing /var/lib/jenkins/workspace/maven_home/pom.xml to /var/lib/jenkins/.m2/repository/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-SNAPSHOT.pom
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven_test_demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/maven_home/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ maven_test_demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ maven_test_demo ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ maven_test_demo ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ maven_test_demo ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ maven_test_demo ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ maven_test_demo ---
[INFO] Installing /var/lib/jenkins/workspace/maven_home/target/maven_test_demo-1.0.0-SNAPSHOT.jar to /var/lib/jenkins/.m2/repository/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-SNAPSHOT.jar
[INFO] Installing /var/lib/jenkins/workspace/maven_home/pom.xml to /var/lib/jenkins/.m2/repository/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-SNAPSHOT.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ maven_test_demo ---
Downloading from nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven-metadata.xml
Progress (1): 776 B
Downloaded from nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven-metadata.xml (776 B at 6.5 kB/s)
Uploading to nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-20190827.062446-3.jar
Progress (1): 2.6 kB
Uploaded to nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-20190827.062446-3.jar (2.6 kB at 13 kB/s)
Uploading to nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-20190827.062446-3.pom
Progress (1): 2.1 kB
Uploaded to nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-20190827.062446-3.pom (2.1 kB at 19 kB/s)
Downloading from nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/maven-metadata.xml
Progress (1): 286 B
Downloaded from nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/maven-metadata.xml (286 B at 11 kB/s)
Uploading to nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven-metadata.xml
Progress (1): 776 B
Uploaded to nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven-metadata.xml (776 B at 4.6 kB/s)
Uploading to nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/maven-metadata.xml
Progress (1): 286 B
Uploaded to nexus-snapshots: http://192.168.20.143:8081/repository/maven-snapshots/com/netease/maven_test_demo/maven-metadata.xml (286 B at 2.5 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.640 s
[INFO] Finished at: 2019-08-27T14:24:47+08:00
[INFO] ------------------------------------------------------------------------
Finished: SUCCESS

2.将运行的jar发布到指定的机器

确保jenkins安装了Publish Over SSH插件 Manage Jenkins -> Manage Plugins -> 搜索ssh

然后配置ssh

配置后点击Test Configuration 出现success

配置完成后新建Item(项目)只是多加了一个构建后(注意前面的配置要想要的改 : 项目的git地址)

#最后一个执行的脚本放到的位置是/projects/scripts
mkdir scripts
vim run.sh
#按i将下面内容复制进去
Project_name=$1
Port_no=$2
#echo $Project_name
#echo $Port_no
. /etc/profile
# 进入到项目
cd /projects/$Project_name
# 找到原进程,kill
pid=$(ps -ef | grep java| grep $Project_name|awk -F '[ ]+' '{print $2}')
kill -9 $pid
#启动jar
nohup java -jar $Project_name-1.0-SNAPSHOT.jar --server.port=$Port_no -server -Xmx1000m -Xms1000m -Xmn700m -XX:+UseParallelGC &
echo "starting service..."
sleep 20
#根据重启后是否有当前应用判断启动是否成功
pid=$(ps -ef | grep java| grep $Project_name|awk -F '[ ]+' '{print $2}')
#echo $pid
if [ -z $pid ];then
  echo "启动失败"
  exit 1
else
  echo $Project_name :  $pid  "SUCCESS"
fi
现在立即构建 查看控制台输出 
Started by user root
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/maven_demo_impl
using credential fad2813a-c894-4386-ae16-11d6e6d349d4
> /usr/local/git/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/local/git/bin/git config remote.origin.url http://192.168.20.143:8083/root/maven_demo_impl.git # timeout=10
Fetching upstream changes from http://192.168.20.143:8083/root/maven_demo_impl.git
> /usr/local/git/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials
> /usr/local/git/bin/git fetch --tags --progress http://192.168.20.143:8083/root/maven_demo_impl.git +refs/heads/*:refs/remotes/origin/*
Seen branch in repository origin/master
Seen 1 remote branch
> /usr/local/git/bin/git show-ref --tags -d # timeout=10
Checking out Revision bf0f9bd981c053359167a0e46e517f4f936c8c98 (origin/master)
> /usr/local/git/bin/git config core.sparsecheckout # timeout=10
> /usr/local/git/bin/git checkout -f bf0f9bd981c053359167a0e46e517f4f936c8c98
Commit message: "Update TestDemoImpl.java"
> /usr/local/git/bin/git rev-list --no-walk bf0f9bd981c053359167a0e46e517f4f936c8c98 # timeout=10
[maven_demo_impl] $ /project/java/maven/apache-maven-3.6.1/bin/mvn -s /project/java/maven/apache-maven-3.6.1/conf/settings.xml -gs /project/java/maven/apache-maven-3.6.1/conf/settings.xml clean compile package -Dmaven.test.skip=true -U
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.netease:maven_demo_impl >---------------------
[INFO] Building maven_demo_impl 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from nexus-aliyun-repo: http://maven.aliyun.com/nexus/content/groups/public/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading from maven-public: http://192.168.20.143:8081/repository/maven-public/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven-metadata.xml
Progress (1): 776 B
Downloaded from maven-public: http://192.168.20.143:8081/repository/maven-public/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven-metadata.xml (776 B at 4.2 kB/s)
Downloading from nexus-aliyun-repo: http://maven.aliyun.com/nexus/content/groups/public/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-20190827.062446-3.pom
Downloading from maven-public: http://192.168.20.143:8081/repository/maven-public/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-20190827.062446-3.pom
Progress (1): 2.1 kB
Downloaded from maven-public: http://192.168.20.143:8081/repository/maven-public/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-20190827.062446-3.pom (2.1 kB at 47 kB/s)
Downloading from maven-public: http://192.168.20.143:8081/repository/maven-public/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-20190827.062446-3.jar
Progress (1): 2.6 kB
Downloaded from maven-public: http://192.168.20.143:8081/repository/maven-public/com/netease/maven_test_demo/1.0.0-SNAPSHOT/maven_test_demo-1.0.0-20190827.062446-3.jar (2.6 kB at 67 kB/s)
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ maven_demo_impl ---
[INFO] Deleting /var/lib/jenkins/workspace/maven_demo_impl/target
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ maven_demo_impl ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ maven_demo_impl ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /var/lib/jenkins/workspace/maven_demo_impl/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ maven_demo_impl ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ maven_demo_impl ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ maven_demo_impl ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ maven_demo_impl ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ maven_demo_impl ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ maven_demo_impl ---
[INFO] Building jar: /var/lib/jenkins/workspace/maven_demo_impl/target/maven_demo_impl-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.0.5.RELEASE:repackage (default) @ maven_demo_impl ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  11.163 s
[INFO] Finished at: 2019-08-27T15:00:40+08:00
[INFO] ------------------------------------------------------------------------
SSH: Connecting from host [localhost.localdomain]
SSH: Connecting with configuration [192.168.20.143] ...
SSH: EXEC: STDOUT/STDERR from command [sh /projects/scripts/run.sh maven_demo_impl 10010] ...
starting service...
nohup: 把输出追加到"nohup.out"
maven_demo_impl : 4406 SUCCESS
SSH: EXEC: completed after 20,262 ms
SSH: Disconnecting configuration [192.168.20.143] ...
SSH: Transferred 1 file(s)
Finished: SUCCESS

可以看到ssh已经有jar 并运行了。


nginx启动、停止和重启(三):https://developer.aliyun.com/article/1483547

相关文章
|
应用服务中间件 nginx 数据安全/隐私保护
百度搜索:蓝易云【Nginx启动,重启以及基本命令详解!】
请注意,上述命令可能需要在终端中以管理员权限(使用sudo)运行。根据你的系统配置和安装方式,可能会有所不同。确保使用适用于你的系统的正确命令。
155 3
|
4月前
|
应用服务中间件 Linux nginx
让 CentOS 定时重启 Nginx
在CentOS上设置Nginx定时重启可通过`cron`或`systemctl`
244 0
|
3月前
|
缓存 Ubuntu 前端开发
在Ubuntu上手动与自动启动Nginx的踩坑经历、以及重启服务
本文分享了作者在Ubuntu系统上手动和自动启动Nginx服务的踩坑经历,包括创建启动脚本、解决依赖问题、配置服务自动启动以及通过命令行管理Nginx服务的方法。
346 0
在Ubuntu上手动与自动启动Nginx的踩坑经历、以及重启服务
|
5月前
|
NoSQL 关系型数据库 MySQL
linux服务器重启php,nginx,redis,mysql命令
linux服务器重启php,nginx,redis,mysql命令
110 1
|
5月前
|
应用服务中间件 nginx
nginx更改配置文件后重启
nginx更改配置文件后重启
243 1
|
6月前
|
jenkins 应用服务中间件 持续交付
nginx启动、停止和重启(三)
nginx启动、停止和重启
116 0
|
6月前
|
Java jenkins 应用服务中间件
nginx启动、停止和重启(一)
nginx启动、停止和重启
681 0
|
应用服务中间件 nginx
window重启Nginx的BAT脚本
window重启Nginx的BAT脚本
362 0
|
应用服务中间件 Linux nginx
centos下nginx启动、重启、关闭
学习linux使用nginx笔记
73794 0
|
关系型数据库 MySQL 应用服务中间件
nginx启动、重启、关闭
nginx启动、重启、关闭
1332 0
nginx启动、重启、关闭