- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
语境
我有一个应用程序,我在其中使用单元测试,我需要持续交付它。我选择使用github + travis + docker。
我的 Docker 容器是一个带有 openSSL 的 Ubuntu 12.04,我无法从外部连接,我对此没有任何问题
当 travis 构建正常时,我需要通过 SSH 连接我的 docker 容器并运行脚本。
问题
实际上,我正在使用:
但这根本不起作用,因为 sshpass 不在白名单中。似乎我无法使用 before_install 命令,因为我使用的是基于容器的基础架构。
注意:端口是 22,我在拍照时错过了它。
问题
Using worker: worker-linux-968a87ce-1.bb.travis-ci.org:travis-linux-14
system_info
Build system information
Build language: node_js
Build image provisioning date and time
Wed Feb 4 18:22:50 UTC 2015
Operating System Details
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
Linux Version
2.6.32-042stab090.5
Cookbooks Version
23bb455 https://github.com/travis-ci/travis-cookbooks/tree/23bb455
GCC version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
LLVM version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Pre-installed Ruby versions
ruby-1.9.3-p551
Pre-installed Node.js versions
v0.10.36
Pre-installed Go versions
1.4.1
Redis version
redis-server 2.8.19
riak version
2.0.2
MongoDB version
MongoDB 2.4.12
CouchDB version
couchdb 1.6.1
Neo4j version
1.9.4
Cassandra version
2.0.9
RabbitMQ Version
3.4.3
ElasticSearch version
1.4.0
Installed Sphinx versions
2.0.10
2.1.9
2.2.6
Default Sphinx version
2.2.6
Installed Firefox version
firefox 31.0esr
PhantomJS version
1.9.8
ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
Maven home: /usr/local/maven
Java version: 1.7.0_76, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-042stab090.5", arch: "amd64", family: "unix"
git.checkout
0.26s$ git clone --depth=50 --branch=master git://myPrivateRepo/Project
Cloning into 'user/Project'...
remote: Counting objects: 1363, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 1363 (delta 4), reused 0 (delta 0), pack-reused 1354
Receiving objects: 100% (1363/1363), 874.89 KiB | 0 bytes/s, done.
Resolving deltas: 100% (263/263), done.
Checking connectivity... done.
$ cd user/Project
$ git checkout -qf commitId
1.56s$ nvm install 0.10
######################################################################## 100.0%
Now using node v0.10.38
$ node --version
v0.10.38
$ npm --version
1.4.28
$ nvm --version
0.23.3
before_install
6.72s$ sudo apt-get install sshpass
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libgeos-3.2.2
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
sshpass
0 upgraded, 1 newly installed, 0 to remove and 102 not upgraded.
Need to get 10.5 kB of archives.
After this operation, 56.3 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe sshpass amd64 1.05-1 [10.5 kB]
Fetched 10.5 kB in 0s (234 kB/s)
Selecting previously unselected package sshpass.
(Reading database ... 75363 files and directories currently installed.)
Unpacking sshpass (from .../sshpass_1.05-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up sshpass (1.05-1) ...
install
1.12s$ npm install
npm WARN package.json UnitTest@0.0.0 No description
npm WARN package.json UnitTest@0.0.0 No repository field.
npm WARN package.json UnitTest@0.0.0 No README data
0.95s$ npm test
> UnitTest@0.0.0 test /home/travis/build/user/project
> node test
First test should fail: 1) First test should fail
0 passing (8ms)
1 failing
1) First test should fail:
AssertionError: true == false
+ expected - actual
-true
+false
at Context.<anonymous> (test/first.js:8:16)
The command "npm test" exited with 0.
after_success
0.91s$ sudo sshpass -p password ssh root@ip -p 7000
Done. Your build exited with 0.
最佳答案
sshpass 可以通过添加以下内容安装在 Travis CI 容器中:
addons:
apt:
packages:
- sshpass
关于Travis CI 不允许使用 SShpass,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30730660/
我正在尝试在 java 中执行一个简单的 sshpass 命令: String command = "sshpass -p password ssh user@host 'echo test' ";
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
有没有办法在使用 sshpass 命令时尝试多个密码?我有一个名为 hosts.txt 的 txt 文件,其中列出了多个系统的 IP 地址,每个系统都使用不同的密码(例如 - 'mypasswd'、'
我在 ubuntu 11.04 上使用 sshpass 以非交互方式传递密码。 当我使用 sshpass 和 scp 时 sshpass -p '123' scp sayuj@192.168.1.51
我正在尝试自动执行从一台服务器到另一台服务器的文件传输或 FTP。 #!/bin/bash ### In this model, the same filename is processed on e
语境 我有一个应用程序,我在其中使用单元测试,我需要持续交付它。我选择使用github + travis + docker。 我的 Docker 容器是一个带有 openSSL 的 Ubuntu 12
我想在不输入密码的情况下使用 bash 脚本列出远程机器上的文件。 我正在使用以下命令来做到这一点 sshpass -p password ssh user@ubuntusite.net "ls /
我有一个 Python 脚本,它使用 sshpass 对机器进行 ssh 访问 Popen(["sshpass","-p", "test!@#", "ssh", "-o UserKnownHostsF
我正在尝试创建一个登录到另一台服务器并检查一些不同文件夹的磁盘使用情况的脚本 (test.sh): 测试.sh: DIRS="dir_A dir_B dir_C" for DIR in $DIRS d
我有一个包含以下函数的 python 脚本: def upload2server(file): host_name = 'example.ex.am.com' port_num = '
我有一个包含以下行的脚本 sshpass -p 'password' ssh user@server "touch /tmp/test" 这在我运行脚本时有效,但如果我将脚本放入 cron 中,它就不
我是 Linux-SA 服务器自动化工具环境的新手。我正尝试按如下方式验证 sshpass: 在 linux 环境中,我在终端中使用以下代码并正确获取文件列表: sshpass -p Password
ssh 远程网关 sshpass -p gatewaypwd -t user@gateway sshpass -p targetpwd ssh user2@target这是 origin 命令,我把它
我是 bash 的新手,目前正在编写脚本。我正在使用两台远程机器并通过 sshpass 访问它们(我知道硬编码密码不好,但我应该这样做)。因此,如果我想将内容从本地计算机复制到远程计算机,我会这样做:
Closed. This question is not reproducible or was caused by typos。它当前不接受答案。 想改善这个问题吗?更新问题,以便将其作为on-to
我想从我的 Mac 自动进行 ssh 登录。 它确实有一个简单的解决方案: sshpass -p my_password ssh m_username@hostname 但我的问题是在我的 Mac 上
在我们的环境中,我们有几台服务器在生产中。每次我想搜索某些东西时,它可能在 4 个不同的服务器中的 1 个中。 我正在创建一个脚本来自动执行此搜索,以便我直接知道涉及哪个服务器。 我正在通过 jump
我有一个 bash 脚本需要在远程机器上启动一些进程。我已经使用 sshpass 做到了这一点命令。 我需要存储那个远程进程的 PID。 我用脚本尝试了以下操作: sshpass -p passwor
好吧,这可能听起来很荒谬,但是如何删除 sshpass 包??? 我安装的方式是这样的: $ tar -zxvf sshpass-1.05.tar.gz $ cd ./sshpass-1.05 $ .
我想从我的 Windows 运行 sshpass 命令到远程 Linux 服务器。我使用这个命令: sshpass -p 'password' ssh ldap.nextstep4it.com -l
我是一名优秀的程序员,十分优秀!