草庐IT

build-environment

全部标签

google-app-engine - 使用 Cloud Build 部署 App Engine go 应用

目标:使用CloudBuild配置-将应用构建为可以部署到应用引擎的工件。不起作用的解决方案:这是cloudbuild.yaml:steps:-name:'gcr.io/cloud-builders/go'args:['get']env:['PROJECT_ROOT=project-name']-name:'gcr.io/cloud-builders/go'args:['build','.']env:['PROJECT_ROOT=project-name']-name:'gcr.io/cloud-builders/gcloud'args:['app','deploy']timeout:

go - 错误 : "build flag -mod=vendor only valid when using modules" when building Go project

根据thisdocument我需要将-mod=vendor添加到我的构建命令中以使用我的本地vendor文件夹:Bydefault,gocommandslikegobuildignorethevendordirectorywheninmodulemode.The-mod=vendorflag(e.g.,gobuild-mod=vendor)instructsthegocommandstousethemainmodule'stop-levelvendordirectorytosatisfydependencies.当我运行这个命令时:gobuild-mod=vendor-a-ldflag

docker - 在 .gitlab-ci.yml 中运行 docker-compose build

我有一个.gitlab-ci.yml文件,其中包含以下内容:image:docker:latestservices:-docker:dindbefore_script:-dockerinfo-docker-compose--versionbuildJob:stage:buildtags:-dockerscript:-docker-composebuild但在ci-log我收到消息:$docker-compose--version/bin/sh:eval:line46:docker-compose:notfound我做错了什么? 最佳答案

docker - 在 .gitlab-ci.yml 中运行 docker-compose build

我有一个.gitlab-ci.yml文件,其中包含以下内容:image:docker:latestservices:-docker:dindbefore_script:-dockerinfo-docker-compose--versionbuildJob:stage:buildtags:-dockerscript:-docker-composebuild但在ci-log我收到消息:$docker-compose--version/bin/sh:eval:line46:docker-compose:notfound我做错了什么? 最佳答案

go - `go build` 在没有指定要构建的特定包的情况下如何决定构建哪些子目录?

我最近注意到gobuild-a将构建几乎所有但不是我的$GOPATH子目录中的所有包。gobuild使用什么算法来决定构建什么?documentationforgo命令没有指定,或者我看错了。 最佳答案 如果未指定路径,“gobuild”命令会在当前目录中构建包。文档是here.“gobuild”命令还会构建任何过时的依赖项。 关于go-`gobuild`在没有指定要构建的特定包的情况下如何决定构建哪些子目录?,我们在StackOverflow上找到一个类似的问题:

go - `go build` 与 `go build file.go`

我在构建一个非常简单的通过cgo调用c代码的go程序时遇到了问题。我的设置:$:echo$GOPATH/go$:pwd/go/src/main$:lsctest.cctest.htest.gotest.go包含:包主//#include"ctest.c"//#includeimport"C"import"unsafe"import"fmt"funcmain(){cs:=C.ctest(C.CString("cfunction"))deferC.free(unsafe.Pointer(cs))index:="hellofromgo:"+C.GoString(cs)fmt.Println(

go build 找不到包源

我正在尝试构建我在此repo中找到的teamcityprometheus导出器.在自述文件中,它指示我执行以下应该构建项目的命令-dockerrun--rm-v"$PWD":/go/src/github.com/guidewire/teamcity_exporter-w/go/src/github.com/guidewire/teamcity_exporter-eGOOS=linux-eGOARCH=amd64golang:1.8gobuild-obin/teamcity_exporter-v但它失败并出现以下错误-teamcity_exporter.go:15:2:cannotfin

Go build shared-c 不输出头文件

我正在尝试在GoLang中测试构建一个共享的C库,但输出没有创建头文件(.h)测试.go:packagemainimport"C"import"fmt"funcExportedFun(sstring){fmt.Printf("Cgaveus%sstring",s)}funcmain(){}我运行的命令是:gobuild-buildmode=c-shared-otest.sotest.go我得到了.so文件,但没有头文件。有什么我想念的吗? 最佳答案 来自gocommanddocumentation:Theonlycallablesy

build - gox - 为 sqlite3 抛出错误并且所有构建都失败

我有Go应用程序pravasan在我的部署分支中,我正在尝试执行gox构建它的二进制文件,我遇到了几个错误,它们是18errorsoccurred:-->linux/amd64error:exitstatus2Stderr:#github.com/mattn/go-sqlite3../../mattn/go-sqlite3/sqlite3.c:92unknown#:if../../mattn/go-sqlite3/sqlite3.c:946c:Nosuchfileordirectory:mingw.h-->darwin/386error:exitstatus2Stderr:#githu

Go build 不构建自定义库

我的工作树是这样的:/opt/go/src/tb-to-composer/├──apis│  └──rtb.go├──config.yaml├──jsondef│  └──structures.go├──LICENSE.md├──README.md├──tb-to-composer└──thingsToComposer.go当我在/opt/go/src/tb-to-composer/中执行gobuild时,构建不会重新编译rtb.go和structures.go即使它们有变化。为了实现构建,每次我对rtb.go或structures.go进行更改时,我都需要运行gobuild-a,是g