misc/docker: TODOs for public link and version stamping

Change-Id: Ic1573ffa85e10e8f330676bfd7a19369763e4a4d
This commit is contained in:
mpl 2015-12-30 11:58:01 +01:00
parent 4086789731
commit 3a902458ef
2 changed files with 4 additions and 0 deletions

View File

@ -114,6 +114,7 @@ func genCamlistore(ctxDir string) {
"--volume=" + ctxDir + "/camlistore.org:/OUT",
"--volume=" + path.Join(dockDir, "server/build-camlistore-server.go") + ":" + genCamliProgram + ":ro",
}
// TODO(mpl, bradfitz): pass the version to genCamliProgram so it can stamp it into camlistored when building it.
if isWIP() {
args = append(args, "--volume="+localCamliSource()+":/IN:ro",
goDockerImage, goCmd, "run", genCamliProgram, "--rev="+rev(), "--camlisource=/IN")
@ -298,6 +299,7 @@ func uploadDockerImage() {
log.Printf("Uploaded tarball to %s", versionedTarball)
if !isWIP() {
log.Printf("Copying tarball to %s/%s ...", bucket, tarball)
// TODO(mpl, bradfitz): restore the code that forces the destination tarball to be public, so we don't have to make it public manually through the google console.
if _, err := stoClient.CopyObject(ctx, bucket, versionedTarball, bucket, tarball, nil); err != nil {
log.Fatalf("Error uploading %v: %v", tarball, err)
}

View File

@ -35,6 +35,7 @@ import (
)
var (
// TODO(mpl): make the flags the same as in dock.go
rev = flag.String("rev", "", "Camlistore revision to build (tag or commit hash)")
localSrc = flag.String("camlisource", "", "(dev flag) Path to a local Camlistore source tree from which to build. It is ignored unless -rev=WORKINPROGRESS")
outDir = flag.String("outdir", "/OUT/", "Output directory, where camlistored and all the resources will be written")
@ -115,6 +116,7 @@ func buildCamlistored() {
os.Setenv("PATH", "/usr/local/go/bin:"+oldPath)
os.Setenv("CGO_ENABLED", "0")
os.Setenv("GO15VENDOREXPERIMENT", "1")
// TODO(mpl, bradfitz): stamp the 0.9 version here with ldflags if a version was passed as a flag to the program.
cmd := exec.Command("go", "build",
"-o", path.Join(*outDir, "/bin/camlistored"),
`--ldflags`, "-w -d -linkmode internal -X camlistore.org/pkg/buildinfo.GitInfo="+*rev,