Skip to content

Commit

Permalink
cmd/{gitmirror,pubsubhelper,gitlock}: use go modules, delete gitlock
Browse files Browse the repository at this point in the history
This removes the last two gitlock users, so this also deletes gitlock.

And update to multi-stage Dockerfiles, simplifying the build and
making it more consistent with others.

Updates golang/go#26872

Change-Id: I1e38c65eccfe9b8b7cb2d9acd6eb02aa33f8b877
Reviewed-on: https://go-review.googlesource.com/c/build/+/176604
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
  • Loading branch information
bradfitz committed May 13, 2019
1 parent 93d00f7 commit 52dbde8
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 417 deletions.
7 changes: 0 additions & 7 deletions cmd/gitlock/README.md

This file was deleted.

199 changes: 0 additions & 199 deletions cmd/gitlock/gitlock.go

This file was deleted.

39 changes: 36 additions & 3 deletions cmd/gitmirror/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,40 @@
# Copyright 2017 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
FROM debian:jessie

FROM golang:1.12 AS build
LABEL maintainer "golang-dev@googlegroups.com"

ENV GO111MODULE=on
ENV GOPROXY=https://proxy.golang.org

RUN mkdir /gocache
ENV GOCACHE /gocache

COPY go.mod /go/src/golang.org/x/build/go.mod
COPY go.sum /go/src/golang.org/x/build/go.sum

WORKDIR /go/src/golang.org/x/build

# Optimization for iterative docker build speed, not necessary for correctness:
# TODO: write a tool to make writing Go module-friendly Dockerfiles easier.
RUN go install cloud.google.com/go/compute/metadata
COPY gerrit /go/src/golang.org/x/build/gerrit
RUN go install golang.org/x/build/gerrit
COPY buildenv /go/src/golang.org/x/build/buildenv
RUN go install golang.org/x/build/buildenv
COPY maintner /go/src/golang.org/x/build/maintner
COPY cmd/pubsubhelper /go/src/golang.org/x/build/cmd/pubsubhelper
RUN go install golang.org/x/build/maintner/maintnerd/apipb
RUN go install golang.org/x/build/maintner/godata

COPY . /go/src/golang.org/x/build/
WORKDIR /go/src/golang.org/x/build/

COPY . /go/src/golang.org/x/build/
RUN go install golang.org/x/build/cmd/gitmirror

FROM debian:stretch
LABEL maintainer "golang-dev@googlegroups.com"

# For interacting with the Go source & subrepos
Expand All @@ -10,7 +43,7 @@ RUN apt-get update && apt-get install -y \
ca-certificates \
git-core \
openssh-client \
gnupg \
gnupg dirmngr \
&& rm -rf /var/lib/apt/lists/*

# See https://github.com/golang/go/issues/23705
Expand All @@ -30,5 +63,5 @@ RUN mkdir -p ~/.ssh/ \
&& echo "|1|HygGkfOGLovavKfixjXWFJ7Yk1I=|lb/724row8KDTMC1dZiJlHyjxWM= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts \
&& chmod 0600 ~/.ssh/known_hosts

COPY gitmirror /
COPY --from=build /go/bin/gitmirror /
ENTRYPOINT ["/tini", "--", "/gitmirror"]
96 changes: 0 additions & 96 deletions cmd/gitmirror/Dockerfile.0

This file was deleted.

Loading

0 comments on commit 52dbde8

Please sign in to comment.