12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- FROM l.gcr.io/google/bazel:latest AS build
16
-
17
- WORKDIR /usr/src/copybara
18
-
15
+ FROM gcr.io/cloud-builders/bazel:latest AS build
19
16
COPY . .
20
-
21
- RUN bazel build //java/com/google/copybara:copybara_deploy.jar \
22
- && mkdir -p /tmp/copybara \
23
- && cp bazel-bin/java/com/google/copybara/copybara_deploy.jar /tmp/copybara/
24
-
25
- # Fails currently
26
- # RUN bazel test //...
17
+ RUN ./cloudbuild.sh build //java/com/google/copybara:copybara_deploy.jar
18
+ RUN mkdir -p /tmp/copybara && \
19
+ cp bazel-bin/java/com/google/copybara/copybara_deploy.jar /tmp/copybara/
27
20
28
21
FROM golang:latest AS buildtools
29
-
30
22
RUN go get github.com/bazelbuild/buildtools/buildozer
31
23
RUN go get github.com/bazelbuild/buildtools/buildifier
32
24
33
- FROM openjdk:8-jre-slim
25
+ FROM openjdk:11-jre-slim
26
+ WORKDIR /usr/src/app
34
27
ENV COPYBARA_CONFIG=copy.bara.sky \
35
28
COPYBARA_SUBCOMMAND=migrate \
36
29
COPYBARA_OPTIONS='' \
@@ -39,12 +32,7 @@ ENV COPYBARA_CONFIG=copy.bara.sky \
39
32
COPY --from=build /tmp/copybara/ /opt/copybara/
40
33
COPY --from=buildtools /go/bin/buildozer /go/bin/buildifier /usr/bin/
41
34
COPY .docker/entrypoint.sh /usr/local/bin/copybara
42
-
43
35
RUN chmod +x /usr/local/bin/copybara
44
-
45
- # Install git for fun times
46
- RUN apt-get update \
47
- && apt-get install -y git \
48
- && apt-get clean
49
-
50
- WORKDIR /usr/src/app
36
+ RUN apt-get update && \
37
+ apt-get install -y git && \
38
+ apt-get clean
0 commit comments