File tree Expand file tree Collapse file tree 3 files changed +27
-16
lines changed
java-bigquery/google-cloud-bigquery-jdbc Expand file tree Collapse file tree 3 files changed +27
-16
lines changed Original file line number Diff line number Diff line change 11FROM gcr.io/cloud-devrel-public-resources/java11
2-
2+ ARG BRANCH=main
33ENV JDBC_DOCKER_ENV=true
4- RUN apt-get update && apt-get install -y zip && rm -rf /var/lib/apt/lists/*
5-
6- RUN mkdir /tst
7- COPY ./pom.xml /src/pom.xml
8- COPY ./java.header /src/java.header
9- COPY ./license-checks.xml /src/license-checks.xml
10- COPY ./google-cloud-bigquery-jdbc/pom.xml /src/google-cloud-bigquery-jdbc/pom.xml
114
12- COPY ./google-cloud-bigquery /src/google-cloud-bigquery
13- COPY ./google-cloud-bigquery-bom /src/google-cloud-bigquery-bom
5+ # Changes to `pom.xml` will trigger re-sync
6+ COPY pom.xml /src/pom.xml
147
8+ # Doing it via single command, so layer contains only installed moduled vs full repo
9+ # Copy from local repo is taking forever. Doing via git clone will keep dependencies ~up to date.
10+ # It will fail on old branches forcing to sync to latest main branch.
11+ RUN bash -c " \
12+ mkdir /git \
13+ && cd /git \
14+ && git clone -b ${BRANCH} --depth 1 --single-branch https://github.com/googleapis/google-cloud-java.git \
15+ && cd /git/google-cloud-java \
16+ && source .kokoro/common.sh \
17+ && install_modules java-bigquery \
18+ && rm -rf /git"
1519
20+ # This will ensure all deps are present
1621WORKDIR /src
17- RUN mvn install -DskipTests
18-
19- WORKDIR /src/google-cloud-bigquery-jdbc
22+ RUN mvn install
2023
2124ENTRYPOINT []
Original file line number Diff line number Diff line change 1+ SHELL := /bin/bash # Default 'sh' doesn't support 'source'
2+ BUILD_BRANCH=main
13CONTAINER_NAME =jdbc
24PACKAGE_DESTINATION =$(PWD ) /drivers
3- SRC ="$(PWD ) /.. "
5+ SRC ="$(PWD ) "
46skipSurefire ?= true
57
68# no indendation for ifndef\endif due to their evaluation before execution
@@ -10,7 +12,9 @@ ifndef GOOGLE_APPLICATION_CREDENTIALS
1012endif
1113
1214install :
13- mvn clean install
15+ cd " $( PWD) /../.." && \
16+ source " .kokoro/common.sh" && \
17+ install_modules java-bigquery
1418
1519clean :
1620 mvn clean
@@ -77,7 +81,7 @@ generate-dependency-list:
7781 $(CONTAINER_NAME ) $(args )
7882
7983docker-build :
80- docker build -t $(CONTAINER_NAME ) -f Dockerfile ..
84+ docker build -t $(CONTAINER_NAME ) -f Dockerfile --build-arg BRANCH= ${BUILD_BRANCH} $( SRC )
8185
8286docker-session :
8387 $(MAKE ) .docker-run args=" bash"
Original file line number Diff line number Diff line change 366366 <!-- Ensure it doesn't conflict with local build directories -->
367367 <directory >/mvn/test-target</directory >
368368 </build >
369+ <properties >
370+ <!-- Disable to avoid bringing license-checks to docker env -->
371+ <checkstyle .skip>true</checkstyle .skip>
372+ </properties >
369373 </profile >
370374 </profiles >
371375</project >
You can’t perform that action at this time.
0 commit comments