[英]Chef - Read a file from git repo at runtime and use parse value in recipe
[英]store tag value from git repo into file
我是git的新手,我在git上存儲了一個倉庫。 我想實現版本控制git上可用的tag
值。
我有一個名為version.rb
的文件,它指定我當前正在使用的插件的版本,如下所示:
Version = "0.1.0"
並且與此提交關聯的標簽將為"0.1.0"
。
問題 :
Sometimes when I create a new tag for the repo, I would forget to update the value of `Version` in version.rb.
我想將version.rb
的Version
值更新為與回購中的標記值相同的值。 有沒有辦法做到這一點?
在標記的提交中更改文件不會使更改的文件成為先前標記的提交的一部分。 因此,如果更改version.rb
,則仍然必須創建另一個標記版本的存儲庫。
看起來您只需要記住在version.rb
中修改version.rb
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.