接下来,使用Execute shell script on remote host using ssh命令,选择项目所在服务器,进入指定的目录,执行该目录下已经提前配置好的bat脚本,进行产物包挪位置,解压、删除等操作。 注意:由于前文提到使用powerShellServer工具连接到远程服务器后,其命令行所在的默认的路径(下图1),并不是将代码包复制过去的路径(下图2...
remote: remote, command: "cp -af /opt/job/tmp/${PROJECT_NAME} ${PROJECT_PATH}/" } } } } } } post { always { echo 'This will always run' script{ currentBuild.description = "\n always" withCredentials([usernamePassword(credentialsId: REMOTE_SERVER_CREDENTIALSID, passwordVariable: '...
我们再选择 构建后操作,选择 Send build artifacts over ssh,如下图: 上图中的 SSH server 也是我们再全局配置中配置的,Source files 是我们要上传的文件,Exec command 是要在远程服务器执行的 脚本命令: cd /root/remote/aspnetweb tar -xvzf published.tar.gz cd /root/remote/aspnetweb/published docker sto...
除了设置参数以外,Job 的内容是为了实现下载 Build 到指定的安装环境中。在 Build 选项中点击 Add build step 选择 Execute shell script on remote host using ssh,在 SSH site 中填写的机器上执行 Command 中的命令,将 build 下载到 install server 这台 Linux 机器的环境上。下图列出了如何配置的信息:图 ...
Execute shell script on remote host using ssh:使用 ssh 在远程主机上执行 shell 脚本,要在全局配置页面定义SSH,可不填; Inspect build log for publipei Gradle build scans:检查已发布的 Gradle 构建扫描的构建日志,可不填; ⑤Pre Steps 准备步骤。也就是在Build之前,需要执行的操作,这个大部分情况不用,但是...
在构建环境中勾选Execute shell script on remote host using ssh。然后填入脚本 cd /home/testdir/spirngcloud_basesh stop.shcd /home/testdir/spirngcloud_basesh start.sh >>./nohup.out 5. 同一机器构建Shell #!/bin/bash#author eric#time 2020-09-22#version v0.0.1. /etc/profileproject_name=bas...
Hostname:SSH Server的Hostname。 Username:SSH Server登录名和密码或密钥。 Remote Directory:指定将文件拷贝到哪个目录。 1.4.5 备份服务器 JAR 包 在上传打包好的JAR包之前,需要将应用服务器上的JAR备份。 备份的步骤如下: 在远程服务器创建一个备份目录 bak。
aws_logs_ecs_tasks.sh - lists AWS ECS task run requests, their callers and job definitions aws_meta.sh - AWS EC2 Metadata API query shortcut. See also the official ec2-metadata shell script with more features aws_nat_gateways_public_ips.sh - lists the public IPs of all NAT gateways. ...
secrets init.groovy.d workflow-libs scriptler config-history Tips: jenkins存放数据不依靠数据库所以在移植时只需要拷贝整个程序主目录即可,需要注意的是jobs和plugins目录比较重要 Docker 安装 描述: 使用容器化的方式部署 Jenkins Master 节点,可以选择自行构建镜像,推荐使用 Jenkins 官方提供的镜像。 Jenkins 服务官...
stage('Deploy'){steps{script{def remote=[:]remote.name='feService'remote.host='服务器ip'remote.user='root'remote.password='服务器密码'remote.allowAnyHosts=truestage('Remote SSH'){sshScript remote:remote,script:"deploy.sh"}}} 4.3.2 ngnix 发布shell 脚本 连接...