git - ansible git 模块中是否有缓存?

标签 git caching docker ansible

我正在使用 ansible-playbook 进行部署,并使用 git 来检查我的源代码。我遇到的问题是,我一直在获取源代码的陈旧版本。我不知道为什么会这样。在此之前还可以。有没有一种方法可以禁用缓存?

- name: Checkout eclaim_revamp source code
  git: repo={{ deployment_url }} dest=/opt/eclaim_revamp force=yes version={{ eclaim_branch }} key_file=~/.ssh/id_travis accept_hostkey=yes
  when: app_version == "eclaim_revamp"

以上是我用来从 bitbucket check out 源代码的声明。任何帮助,将不胜感激。

更多信息

我正在针对我创建的 docker 镜像运行此 playbook。

最佳答案

ansible git module应该强制 check out (当使用 force=yes 时),陈旧文件可能是正在运行的进程对本应更新的文件保持句柄的结果。

检查是否是这种情况,或者您是否看到任何错误消息。


从 Travis 作业(失败)中,我可以看到:

TASK [app_server : Checkout eclaim source code] ********************************

task path: /root/django_deployment/django_app_server_db_server/deployment/roles/app_server/tasks/main.yml:122

skipping: [localhost] => {"changed": false, "skip_reason": "Conditional check failed", "skipped": true}

它可能会在 issue 14438 中修复(和 Ansible 2.1)

但在这种情况下,这更简单:Low Kian Seong确认 in the comments :

I am over-writing one of my own files!

所以 checkout 工作正常,但有些文件被重写了。

关于git - ansible git 模块中是否有缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38008462/

相关文章:

git:如果当前目录是工作树子目录并且 $GIT_DIR 未设置,则获取有效的 GIT_DIR

python - 缓存访问被拒绝。请求模块中需要身份验证

python - Redis 中哪种抓取方式效率更高?

docker - Dokku 部署问题无法选择构建包

docker - Docker-套接字文件的卷映射是否是覆盖行为?

Go 和 chromedp 的 Dockerfile

git - 使用 GIT Bash,错误 : Repository not found - fatal: Could not read from remote

git - 在编写新的提交消息时如何使用以前的提交消息?

git - git 控制的文件可以知道它属于哪个分支吗?

java - 如果集群中的第一个节点关闭,Redis 客户端 (Redission) 将停止工作