簡體   English   中英

從存儲升級后,Bitbucket服務器Webhook到jenkins無法發布

[英]Bitbucket server webhook to jenkins not posting after upgrade from stash

我們最近從Atlassian Stash 2.x升級到Atlassian Bitbucket Server 4.6.1。 許多提交后的鈎子不再起作用,因為它們的插件尚未更新,但是其中一個, JenkinsBitbucket Server Webhook在提交后沒有觸發。 當我在其配置窗口中單擊“ Trigger Jenkins”按鈕時,該鈎子起作用了,但是在推送了新的提交后,它並沒有觸發。

我不得不做一些挖掘。 首先,我通過UI啟用Bitbucket Server調試登錄 那時,我在日志中看到一些錯誤,這些錯誤使我引向一篇有關git hooks not firing的文章

從那里,我在bitbucket_home目錄中尋找丟失的腳本及其文件權限。 雖然我沒有找到20_bitbucket_callback腳本,但在同一目錄中確實找到了20_stash_callback腳本!

這篇文章建議檢查他們在服務器上的文件權限,所以我做了。

find . -name 20_stash_callback -printf "%p: %u:%g %m\\n" find . -name pre-receive -printf "%p: %u:%g %m\\n" find . -name post-receive -printf "%p: %u:%g %m\\n"

瞧,所有腳本的權限均為644,或者“對於root用戶是讀/寫的,對其他所有人都是只讀的”。 我通過一點find ... -exec改變了它。

sudo -u someuser find . -name 20_stash_callback -type f -exec chmod 774 {} \\; sudo -u someuser find . -name post-receive -type f -exec chmod 774 {} \\; sudo -u someuser find . -name pre-receive -type f -exec chmod 774 {} \\;

當我想到可能需要將回調腳本重命名為文檔中描述的腳本時,我仍然沒有看到我的詹金斯大火。

sudo -u someuser find . -name 20_stash_callback -type f -exec rename 20_stash_callback 20_bitbucket_callback {} \;

之后,我的鈎子起作用了! 有很多的欣喜。

請注意,上面使用的someuser帳戶是我們的隱藏實例在其下運行的本地用戶。 如果使用上述腳本,請確保根據您的需要進行更改。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM