第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

將 Go 項(xiàng)目文件部署到 AWS Elastic Beanstalk

將 Go 項(xiàng)目文件部署到 AWS Elastic Beanstalk

Go
翻閱古今 2022-06-27 15:13:33
溢出物,我一直在努力嘗試將 Go 應(yīng)用程序發(fā)布到 AWS Elastic Beanstalk 幾個(gè)小時(shí)。我的項(xiàng)目結(jié)構(gòu)現(xiàn)在是:以下文件都在我的根文件夾中:application.gobuild.shBuildfileProcfile應(yīng)用程序.gopackage mainimport (        "github.com/gin-gonic/gin")func main() {    router := gin.Default()    router.GET("/user/:name", func(c *gin.Context) {        name := c.Param("name")        c.String(http.StatusOK, "Hello %s", name)    })    router.Run(":5000")}build.shgo get "github.com/gin-gonic/gin"    //Have tried without quotation marksgo build application.go構(gòu)建文件make: ./build.sh檔案web: bin/application我還閱讀了 AWS網(wǎng)站上的文檔。據(jù)我所知,我的代碼和上面提到的演示中的代碼是正確的。我將根文件夾的全部?jī)?nèi)容壓縮為 .zip 文件,然后通過(guò) Web 門戶上傳到 AWS。
查看完整描述

2 回答

?
慕絲7291255

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í)行。


查看完整回答
反對(duì) 回復(fù) 2022-06-27
?
LEATH

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


查看完整回答
反對(duì) 回復(fù) 2022-06-27
  • 2 回答
  • 0 關(guān)注
  • 237 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)