2 回答
TA貢獻(xiàn)1859條經(jīng)驗(yàn) 獲得超6個(gè)贊
當(dāng) build.sh 腳本缺少可執(zhí)行權(quán)限時(shí),可能會(huì)發(fā)生這種情況。在這種情況下,beantalk 上的“make.service”無(wú)法執(zhí)行腳本并生成錯(cuò)誤。
如果您在 unix 機(jī)器上開發(fā),請(qǐng)?jiān)诓渴鹎皣L試chmod +x build.sh 。
如果您在 Windows 機(jī)器上開發(fā),則無(wú)法設(shè)置 unix 文件屬性。但是您可以將這個(gè)技巧與 Buildfile 一起使用并以這種方式進(jìn)行部署。
構(gòu)建文件
make: chmod +x build.sh; ./build.sh
當(dāng) make 服務(wù)運(yùn)行時(shí),這將使 build.sh 可執(zhí)行。
TA貢獻(xiàn)1936條經(jīng)驗(yàn) 獲得超7個(gè)贊
在將 Golang 應(yīng)用程序的部署從 Amazon Linux 1 平臺(tái)遷移到 Amazon Linux 2 平臺(tái)時(shí),我也遇到了這個(gè)問(wèn)題。我在構(gòu)建過(guò)程中遇到了類似的錯(cuò)誤:
2021/07/10 16:33:21.411538 [ERROR] An error occurred during execution of command [app-deploy] - [Golang Specific Build Application]. Stop running the command. Error: build application failed on command ./build.sh with error: startProcess Failure: starting process "make" failed: Command /bin/sh -c systemctl start make.service failed with error exit status 1. Stderr:Job for make.service failed because the control process exited with error code. See "systemctl status make.service" and "journalctl -xe" for details.
在查看 systemctl 狀態(tài)后,按照錯(cuò)誤中的建議,我發(fā)現(xiàn) linux 用戶“webapp”似乎沒有正確的權(quán)限。
我在 sudoers 文件中添加了“webapp”,現(xiàn)在構(gòu)建過(guò)程完成,部署能夠成功。
# User rules for webapp user
webapp ALL=(ALL) NOPASSWD:ALL
- 2 回答
- 0 關(guān)注
- 237 瀏覽
添加回答
舉報(bào)
