我使用fabric在远程服务器上构建项目。 (虽然现在我正在对localhost进行测试。)s3和git repo中存储了几个文件依赖项。 git repo很好,直到我添加了其他依赖项,现在其中一个文件夹/test_fab/smart-targeting-service/classification/
在脚本末尾消失了。
这是Fabric的已知行为吗?
我已经评论了文件消失的位置。
from fabric.api import *
from fabric.context_managers import cd
env.activate = 'source venv/bin/activate'
def stand_up_smart_targeting():
sudo('rm -rf test_fab')
home_directory = run('pwd')
run('mkdir test_fab')
sudo('pip3 install virtualenv')
current_directory = home_directory + '/test_fab'
files = ['https://s3.amazonaws.com/subnet/file1.tar.gz', 'https://s3.amazonaws.com/subnet/file1.tar.gz']
with cd(current_directory):
for file in files:
run('wget {}'.format(file))
run('tar -xvzf {}'.format(file.split('/')[len(file.split('/')) - 1]))
run('git clone https://github.com/smart-targetting-service.git')
with cd(current_directory + '/smart-targetting-service'):
run('virtualenv -p python3 venv')
run('ls')
with cd(current_directory + '/smart-targetting-service/classification'):
run('ls')# <-- this command shows the files correctly
#They disappear here somehow